Skip to content

Commit ba09082

Browse files
committed
Support windows
1 parent 8c55081 commit ba09082

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

intel-mkl-tool/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ pkg-config = "0.3.17"
1515
tar = "0.4.26"
1616
xz2 = "0.1.6"
1717
log = "0.4.8"
18-
dirs = "*"
19-
glob = "*"
20-
zstd = "*"
18+
dirs = "2.0.2"
19+
glob = "0.3.0"
20+
zstd = "0.5.1"
2121

2222
# CLI
23-
structopt = { version = "0.3.4", optional = true }
23+
structopt = { version = "0.3.5", optional = true }
2424
env_logger = { version = "0.7.1", optional = true }
2525

2626
[[bin]]

intel-mkl-tool/src/lib.rs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,28 @@ pub fn package(mkl_path: &Path) -> Fallible<PathBuf> {
122122
bail!("MKL directory not found: {}", mkl_path.display());
123123
}
124124
let (year, update) = get_mkl_version(&mkl_path.join("include/mkl_version.h"))?;
125-
let out = PathBuf::from(format!("mkl_linux64_{}_{}.tar.zst", year, update));
126125
info!("Intel MKL version: {}.{}", year, update);
127-
info!("Create archive for Linux/64bit systems: {}", out.display());
128-
let shared_libs: Vec<_> = glob(mkl_path.join("lib/intel64/*.so").to_str().unwrap())?
129-
.map(|path| path.unwrap())
130-
.collect();
126+
let out = if cfg!(target_os = "Linux") {
127+
let out = PathBuf::from(format!("mkl_linux64_{}_{}.tar.zst", year, update));
128+
info!("Create archive for Linux/64bit systems: {}", out.display());
129+
out
130+
} else {
131+
let out = PathBuf::from(format!("mkl_windows64_{}_{}.tar.zst", year, update));
132+
info!(
133+
"Create archive for Windows/64bit systems: {}",
134+
out.display()
135+
);
136+
out
137+
};
138+
139+
let shared_libs: Vec<_> = glob(
140+
mkl_path
141+
.join(format!("lib/intel64/*.{}", mkl::EXT))
142+
.to_str()
143+
.unwrap(),
144+
)?
145+
.map(|path| path.unwrap())
146+
.collect();
131147
let f = fs::File::create(&out)?;
132148
let buf = io::BufWriter::new(f);
133149
let zstd = zstd::stream::write::Encoder::new(buf, 6)?;

0 commit comments

Comments
 (0)