From 95f1f7c154b517ac6c87370796ae163287610031 Mon Sep 17 00:00:00 2001 From: Pedro Valente Date: Fri, 5 Apr 2024 17:03:27 +0100 Subject: [PATCH 1/2] removed cpp standard from nvcc --- crates/llama_cpp_sys/build.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/llama_cpp_sys/build.rs b/crates/llama_cpp_sys/build.rs index c1e0744..99070ed 100644 --- a/crates/llama_cpp_sys/build.rs +++ b/crates/llama_cpp_sys/build.rs @@ -151,11 +151,9 @@ impl ParseCallbacks for GGMLLinkRename { fn push_common_flags(cx: &mut Build, cxx: &mut Build) { cx.static_flag(true) .cpp(false) - .std("c11") .define("GGML_SCHED_MAX_COPIES", "4"); cxx.static_flag(true) .cpp(true) - .std("c++11") .define("GGML_SCHED_MAX_COPIES", "4"); if !cfg!(debug_assertions) { @@ -401,6 +399,7 @@ fn compile_hipblas(cx: &mut Build, cxx: &mut Build, mut hip: Build) -> &'static cxx.include(&rocm_include); hip.compiler(rocm_hip_bin) + .std("c++17") .file(LLAMA_PATH.join(cuda_file)) .include(LLAMA_PATH.join(cuda_header)) .define("GGML_USE_HIPBLAS", None) @@ -429,7 +428,6 @@ fn compile_cuda(cx: &mut Build, cxx: &mut Build, featless_cxx: Build) -> &'stati let mut nvcc = featless_cxx; nvcc.cuda(true) - .std("c++17") .flag("--forward-unknown-to-host-compiler") .flag("-arch=all") .define("K_QUANTS_PER_ITERATION", Some("2")) @@ -576,7 +574,8 @@ fn compile_vulkan(cx: &mut Build, cxx: &mut Build) -> &'static str { fn compile_ggml(mut cx: Build) { println!("Compiling GGML.."); - cx.include(LLAMA_PATH.as_path()) + cx.std("c11") + .include(LLAMA_PATH.as_path()) .file(LLAMA_PATH.join("ggml.c")) .file(LLAMA_PATH.join("ggml-alloc.c")) .file(LLAMA_PATH.join("ggml-backend.c")) @@ -586,7 +585,8 @@ fn compile_ggml(mut cx: Build) { fn compile_llama(mut cxx: Build, _out_path: impl AsRef) { println!("Compiling Llama.cpp.."); - cxx.include(LLAMA_PATH.as_path()) + cxx.std("c++11") + .include(LLAMA_PATH.as_path()) .file(LLAMA_PATH.join("unicode.cpp")) .file(LLAMA_PATH.join("unicode-data.cpp")) .file(LLAMA_PATH.join("llama.cpp")) From 1c48149a2572dbd12399c6855a90aa5ce31454c6 Mon Sep 17 00:00:00 2001 From: Pedro Valente Date: Fri, 5 Apr 2024 17:04:49 +0100 Subject: [PATCH 2/2] reverted hipblas cpp standard --- crates/llama_cpp_sys/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/llama_cpp_sys/build.rs b/crates/llama_cpp_sys/build.rs index 99070ed..54c47fb 100644 --- a/crates/llama_cpp_sys/build.rs +++ b/crates/llama_cpp_sys/build.rs @@ -399,7 +399,7 @@ fn compile_hipblas(cx: &mut Build, cxx: &mut Build, mut hip: Build) -> &'static cxx.include(&rocm_include); hip.compiler(rocm_hip_bin) - .std("c++17") + .std("c++11") .file(LLAMA_PATH.join(cuda_file)) .include(LLAMA_PATH.join(cuda_header)) .define("GGML_USE_HIPBLAS", None)