Skip to content

Commit 63f6f7e

Browse files
authored
Merge pull request #3 from termoshtt/compress
Compress libraries
2 parents 0b27b17 + f3f8f95 commit 63f6f7e

File tree

5 files changed

+16
-2
lines changed

5 files changed

+16
-2
lines changed

build.rs

Lines changed: 14 additions & 2 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");
2839
println!("cargo:rustc-link-lib=static=mkl_intel_thread");
29-
println!("cargo:rustc-link-search=native={}/mkl_lib", dir);
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

mkl_lib/libmkl_intel_ilp64.a

-19.5 MB
Binary file not shown.

mkl_lib/libmkl_intel_thread.a

-37.2 MB
Binary file not shown.

mkl_lib/mkl.tar.xz

5.09 MB
Binary file not shown.

0 commit comments

Comments
 (0)