Skip to content

Commit

Permalink
better warning msg
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanting Zhang committed Jan 23, 2024
1 parent 8021176 commit 498c207
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ fn main() {
return;
}

#[cfg(feature = "cuda")]
if cuda_available() {
let mut implement_sort: bool = true;
compile_cuda("cuda/bn254.cu", "bn256_msm_cuda", implement_sort);
Expand All @@ -30,8 +31,11 @@ fn main() {
compile_cuda("cuda/vesta.cu", "vesta_msm_cuda", implement_sort);
println!("cargo:rerun-if-changed=cuda");
println!("cargo:rerun-if-env-changed=CXXFLAGS");
#[cfg(feature = "cuda")]
println!("cargo:rustc-cfg=feature=\"cuda\"");
} else {
println!("warning=feature \"cuda\" was enabled but no valid installation of CUDA was found");
println!("warning=the crate's default CPU methods will be compiled instead; NO GPU IMPLEMENTATION WILL USED WHEN CALLING THIS CRATE'S METHODS");
println!("warning=please recompile without feature \"cuda\" or provide a valid CUDA configuration");
}
println!("cargo:rerun-if-env-changed=NVCC");
}
Expand Down

0 comments on commit 498c207

Please sign in to comment.