From 8554bd79536c8ba0482afed2b555f09b79cb8e3f Mon Sep 17 00:00:00 2001 From: marcus Date: Wed, 31 Jan 2024 11:17:19 -0800 Subject: [PATCH 1/2] added docs to remind users to populate the submodules --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index fff601a8..abdda51c 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,17 @@ This is the home for [llama-cpp-2][crates.io]. It also contains the [llama-cpp-s This project was created with the explict goal of staying as up to date as possible with llama.cpp, as a result it is dead simple, very close to raw bindings, and does not follow semver meaningfully. Check out the [docs.rs] for crate documentation or the [readme] for high level information about the project. + +## Hacking + +Ensure that when you clone this project you also clone the submodules. This can be done with the following command: + +```sh +git clone --recursive https://github.com/utilityai/llama-cpp-rs +``` + +or if you have already cloned the project you can run: + +```sh +git submodule update --init --recursive +``` \ No newline at end of file From 1df79cefbe3e7f7fe93873dd59b6f7d256f059ac Mon Sep 17 00:00:00 2001 From: marcus Date: Thu, 1 Feb 2024 08:37:50 -0800 Subject: [PATCH 2/2] added a warning if submodule not checked out --- llama-cpp-sys-2/build.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/llama-cpp-sys-2/build.rs b/llama-cpp-sys-2/build.rs index 5f1ab07b..ee819279 100644 --- a/llama-cpp-sys-2/build.rs +++ b/llama-cpp-sys-2/build.rs @@ -1,11 +1,16 @@ use std::env; use std::path::PathBuf; +use std::path::Path; fn main() { println!("cargo:rerun-if-changed=llama.cpp"); let cublas_enabled = env::var("CARGO_FEATURE_CUBLAS").is_ok(); + if !Path::new("llama.cpp/ggml.c").exists() { + panic!("llama.cpp seems to not be populated, try running `git submodule update --init --recursive` to init.") + } + let mut ggml = cc::Build::new(); let mut ggml_cuda = if cublas_enabled { Some(cc::Build::new()) } else { None }; let mut llama_cpp = cc::Build::new();