Skip to content

Commit cafeadf

Browse files
committed
Use mkl::* for Linux/Windows split
1 parent ba09082 commit cafeadf

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

intel-mkl-tool/src/lib.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const S3_ADDR: &'static str = "https://s3-ap-northeast-1.amazonaws.com/rust-inte
1212

1313
#[cfg(target_os = "linux")]
1414
mod mkl {
15+
pub const ARCHIVE_NAME: &'static str = "mkl_linux64";
1516
pub const ARCHIVE: &'static str = "mkl_linux.tar.xz";
1617
pub const EXT: &'static str = "so";
1718
pub const PREFIX: &'static str = "lib";
@@ -26,6 +27,7 @@ mod mkl {
2627

2728
#[cfg(target_os = "windows")]
2829
mod mkl {
30+
pub const ARCHIVE_NAME: &'static str = "mkl_windows64";
2931
pub const ARCHIVE: &'static str = "mkl_windows64.tar.xz";
3032
pub const EXT: &'static str = "lib";
3133
pub const PREFIX: &'static str = "";
@@ -123,18 +125,8 @@ pub fn package(mkl_path: &Path) -> Fallible<PathBuf> {
123125
}
124126
let (year, update) = get_mkl_version(&mkl_path.join("include/mkl_version.h"))?;
125127
info!("Intel MKL version: {}.{}", year, update);
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-
};
128+
let out = PathBuf::from(format!("{}_{}_{}.tar.zst", mkl::ARCHIVE_NAME, year, update));
129+
info!("Create archive: {}", out.display());
138130

139131
let shared_libs: Vec<_> = glob(
140132
mkl_path

0 commit comments

Comments
 (0)