-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.rs
27 lines (22 loc) · 939 Bytes
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
extern crate cc;
fn main() {
/* Link CUDA Runtime (libcudart.so) */
// Add link directory
// - This path depends on where you install CUDA (i.e. depends on your Linux distribution)
// - This should be set by `$LIBRARY_PATH`
println!("cargo:rustc-link-search=native=/usr/local/cuda-11.1/lib64");
println!("cargo:rustc-link-lib=cudart");
/* Optional: Link CUDA Driver API (libcuda.so) */
// println!("cargo:rustc-link-search=native=/usr/local/cuda/lib64/stub");
// println!("cargo:rustc-link-lib=cuda");
cc::Build::new()
.cuda(true)
.cudart("static")
.flag("-gencode")
.flag("arch=compute_75,code=sm_75")
.file("merkletree-poseidon-cuda/field.cu")
.file("merkletree-poseidon-cuda/poseidon.cu")
.file("merkletree-poseidon-cuda/merkle_tree.cu")
.file("merkletree-poseidon-cuda/cc_rust.cu")
.compile("libmerkletree_cuda.a");
}