Skip to content

Commit

Permalink
build: add mpi lib dirs && lib64 dir (#12)
Browse files Browse the repository at this point in the history
在centos 上编译的al路径是在lib64下面。另外就是centos上安装的mpi so不在系统目录,需要手动指定下
  • Loading branch information
liuhatry authored and NOBLES5E committed Sep 15, 2021
1 parent d4bf356 commit b8b4a55
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bagua-core/bagua-core-internal/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,23 @@ fn main() {
cpp_builder.include(bagua_data_path.join("include"));
cpp_builder.build("src/lib.rs");

let mpi_lib_dirs = cmd_lib::run_fun!(bash -c "mpicxx --showme:libdirs").unwrap();
let mpi_lib_dirs: Vec<&str> = mpi_lib_dirs.split(' ').collect();
for mpi_lib_dir in mpi_lib_dirs.iter() {
println!("cargo:rustc-link-search={}", mpi_lib_dir);
}
println!(
"cargo:rustc-link-search=native={}",
format!("{}/lib64", cuda_home)
);

println!(
"cargo:rustc-link-search={}",
bagua_data_path.join("lib").as_path().to_str().unwrap()
);
println!(
"cargo:rustc-link-search={}",
bagua_data_path.join("lib64").as_path().to_str().unwrap()
);
println!("cargo:rustc-link-lib=static=Al");
println!("cargo:rustc-link-lib=mpi");
println!("cargo:rustc-link-lib=nccl");
Expand Down

0 comments on commit b8b4a55

Please sign in to comment.