Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added docs to remind users to populate the submodules #55

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
5 changes: 5 additions & 0 deletions llama-cpp-sys-2/build.rs
Original file line number Diff line number Diff line change
@@ -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();
Expand Down