Skip to content

Commit ef7fc71

Browse files
committed
Filename convention for MKL libraries
1 parent bace1b7 commit ef7fc71

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

intel-mkl-tool/src/config.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,11 @@ impl Config {
186186
};
187187
libs.push("mkl_core".into());
188188
if matches!(self.parallel, Threading::OpenMP) {
189-
libs.push("iomp5".into());
189+
if cfg!(target_os = "windows") {
190+
libs.push("iomp5md".into());
191+
} else {
192+
libs.push("iomp5".into());
193+
}
190194
}
191195
libs
192196
}

intel-mkl-tool/src/entry.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,31 @@ use std::{
77
process::Command,
88
};
99

10+
/// Filename convention for MKL libraries.
11+
///
12+
/// Be sure that OpenMP runtime does not follow this rule.
13+
pub fn as_filename(link: LinkType, name: &str) -> String {
14+
if cfg!(target_os = "windows") {
15+
match link {
16+
LinkType::Static => {
17+
format!("{}.lib", name)
18+
},
19+
LinkType::Dynamic => {
20+
format!("{}_dll.lib", name)
21+
}
22+
}
23+
} else {
24+
match link {
25+
LinkType::Static => {
26+
format!("lib{}.a", name)
27+
},
28+
LinkType::Dynamic => {
29+
format!("lib{}.{}", name, std::env::consts::DLL_PREFIX)
30+
}
31+
}
32+
}
33+
}
34+
1035
/// Lacked definition of [std::env::consts]
1136
pub const STATIC_EXTENSION: &str = if cfg!(any(target_os = "linux", target_os = "macos")) {
1237
"a"

0 commit comments

Comments
 (0)