Skip to content

Commit 09c7b61

Browse files
committed
Update build script to remove cudarc
1 parent 6b0f923 commit 09c7b61

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

llama-cpp-sys-2/build.rs

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,6 @@ fn compile_hipblas(cx: &mut Build, cxx: &mut Build, mut hip: Build) -> &'static
413413
fn compile_cuda(cx: &mut Build, cxx: &mut Build, featless_cxx: Build) -> &'static str {
414414
println!("Compiling CUDA GGML..");
415415

416-
// CUDA gets linked through the cudarc crate.
417-
418416
cx.define("GGML_USE_CUDA", None);
419417
cxx.define("GGML_USE_CUDA", None);
420418

@@ -425,12 +423,27 @@ fn compile_cuda(cx: &mut Build, cxx: &mut Build, featless_cxx: Build) -> &'stati
425423
.define("K_QUANTS_PER_ITERATION", Some("2"))
426424
.define("GGML_CUDA_PEER_MAX_BATCH_SIZE", Some("128"));
427425

428-
if cfg!(target_os = "linux") {
429-
nvcc.flag("-Wno-pedantic");
430-
// TODO Are these links needed?
431-
println!("cargo:rustc-link-lib=pthread");
432-
println!("cargo:rustc-link-lib=dl");
433-
println!("cargo:rustc-link-lib=rt");
426+
// if cfg!(target_os = "linux") {
427+
// nvcc.flag("-Wno-pedantic");
428+
// }
429+
430+
for lib in [
431+
"cuda", "cublas", "culibos", "cudart", "cublasLt", "pthread", "dl", "rt",
432+
] {
433+
println!("cargo:rustc-link-lib={}", lib);
434+
}
435+
if !nvcc.get_compiler().is_like_msvc() {
436+
for lib in ["culibos", "pthread", "dl", "rt"] {
437+
println!("cargo:rustc-link-lib={}", lib);
438+
}
439+
}
440+
441+
println!("cargo:rustc-link-search=native=/usr/local/cuda/lib64");
442+
443+
if nvcc.get_compiler().is_like_msvc() {
444+
nvcc.std("c++14");
445+
} else {
446+
nvcc.flag("-std=c++11").std("c++11");
434447
}
435448

436449
if cfg!(feature = "cuda_dmmv") {

llama-cpp-sys-2/src/lib.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,4 @@
44
#![allow(non_camel_case_types)]
55
#![allow(non_snake_case)]
66

7-
// [`ash`] is only included to link to the Vulkan SDK.
8-
#[allow(unused)]
9-
#[cfg(feature = "vulkan")]
10-
use ash;
11-
12-
// [`cudarc`] is only included to link to CUDA.
13-
#[allow(unused)]
14-
#[cfg(feature = "cuda")]
15-
use cudarc;
16-
177
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));

0 commit comments

Comments
 (0)