From 1df79cefbe3e7f7fe93873dd59b6f7d256f059ac Mon Sep 17 00:00:00 2001 From: marcus Date: Thu, 1 Feb 2024 08:37:50 -0800 Subject: [PATCH] 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();