diff --git a/README.md b/README.md index 82be3018..7864e44c 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Redistribution of Intel MKL as a crate. Tested on Linux, macOS, and Windows (sin - `static` means MKL will be linked statically, and `dynamic` means MKL will be linked dynamically - `lp64` means 32-bit integer interface, `ilp64` means 64-bit integer interface - `iomp` means MKL uses Intel OpenMP, `seq` means sequential execution, e.g. no parallelization - - OpenMP is not supported for Windows currently [#46](https://github.com/rust-math/intel-mkl-src/issues/46) + - For OpenMP supported on Windows check [#46](https://github.com/rust-math/intel-mkl-src/issues/46) - default is `mkl-static-ilp64-seq`, and you must choose one of them. - macOS is not supported [#42](https://github.com/rust-math/intel-mkl-src/issues/42) @@ -59,6 +59,7 @@ This crate seeks system MKL libraries, e.g. installed by [apt], [yum], or offici - Seek a directory set by `${MKLROOT}` environment variable - Seek default installation path - `/opt/intel/mkl` for Linux + - `C:\Program Files (x86)\Intel\oneAPI\` for Windows with oneAPI distribution - `C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows` for Windows If not found any MKL library and `download` feature is ON, this crate will download archive from AWS S3 `rust-intel-mkl` bucket. diff --git a/intel-mkl-tool/src/config.rs b/intel-mkl-tool/src/config.rs index 8729c5ba..cdc0f526 100644 --- a/intel-mkl-tool/src/config.rs +++ b/intel-mkl-tool/src/config.rs @@ -118,7 +118,10 @@ impl Config { }; libs.push("mkl_core".into()); if matches!(self.parallel, Threading::OpenMP) { + #[cfg(not(all(target_os = "windows", target_arch = "x86_64")))] libs.push("iomp5".into()); + #[cfg(all(target_os = "windows", target_arch = "x86_64"))] + libs.push("libiomp5md".into()); } libs } diff --git a/intel-mkl-tool/src/entry.rs b/intel-mkl-tool/src/entry.rs index 6885bb07..4430e696 100644 --- a/intel-mkl-tool/src/entry.rs +++ b/intel-mkl-tool/src/entry.rs @@ -115,11 +115,15 @@ impl Entry { } // Default setting for Windows installer - let windows_mkl = - PathBuf::from("C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows"); + let windows_mkl = if let Ok(oneapi) = std::env::var("ONEAPI_ROOT") { + oneapi.into() + } else { + PathBuf::from("C:/Program Files (x86)/IntelSWTools/compilers_and_libraries/windows") + }; if windows_mkl.exists() { targets.seek(windows_mkl.join("mkl/lib/intel64")); targets.seek(windows_mkl.join("compiler/lib/intel64")); + targets.seek(windows_mkl.join("compiler/latest/windows/compiler/lib/intel64_win")); } if targets.found_any() {