Skip to content

Commit f3f8f95

Browse files
committed
Expand archive in build.rs
1 parent 7739cf7 commit f3f8f95

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

build.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,22 @@
2121
// SOFTWARE.
2222

2323
use std::env;
24+
use std::path;
25+
use std::process::Command;
2426

2527
fn main() {
26-
let dir = env::var("CARGO_MANIFEST_DIR").unwrap();
28+
let mkl_dir = path::Path::new(&env::var("CARGO_MANIFEST_DIR").unwrap()).join("mkl_lib");
29+
let st = Command::new("tar")
30+
.args(&["Jxvf", "mkl.tar.xz"])
31+
.current_dir(&mkl_dir)
32+
.status()
33+
.expect("Failed to start decompression (maybe 'tar' is missing?)");
34+
if !st.success() {
35+
panic!("Failed to extract MKL libraries");
36+
}
37+
2738
println!("cargo:rustc-link-lib=static=mkl_intel_ilp64");
28-
println!("cargo:rustc-link-lib=static=gomp");
29-
println!("cargo:rustc-link-search=native={}/mkl_lib", dir);
39+
println!("cargo:rustc-link-lib=static=mkl_intel_thread");
40+
println!("cargo:rustc-link-lib=static=iomp5");
41+
println!("cargo:rustc-link-search=native={}", mkl_dir.display());
3042
}

mkl_lib/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# expanded libraries
2+
*.a

0 commit comments

Comments
 (0)