Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
Add verify_state to ggml/sys/build.rs
Browse files Browse the repository at this point in the history
Helps newbies like me set up the repo correctly.
  • Loading branch information
steventrouble committed Jul 6, 2023
1 parent a69d953 commit 2d939e6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/ggml/sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use std::path::{Path, PathBuf};
// the host and target are the same. If they are not, it will turn off auto-feature-detection,
// and you will need to manually specify target features through target-features.
fn main() {
verify_state();

println!("cargo:rerun-if-changed=llama-cpp");

let mut builder = cc::Build::new();
Expand Down Expand Up @@ -104,6 +106,14 @@ fn main() {
}
}

/// Verify the state of the repo to catch common newbie mistakes.
fn verify_state() {
assert!(
Path::new("llama-cpp/ggml.c").exists(),
"Could not find llama-cpp/ggml.c. Try running `git submodule update --init`"
);
}

fn cfg_cublas() -> bool {
!cfg!(target_os = "macos") && cfg!(feature = "cublas")
}
Expand Down

0 comments on commit 2d939e6

Please sign in to comment.