intel-mkl-src icon indicating copy to clipboard operation
intel-mkl-src copied to clipboard

Rust GNU toolchain in windows not able to compile

Open selvavm opened this issue 3 years ago • 3 comments

I am using NDArray Linalg (https://github.com/rust-ndarray/ndarray-linalg) with intel-mkl-static feature. It is working in msvc toolchain perfectly.

However, when I switch to GNU toolchain, I am getting below error,

could not find native static library `mkl_intel_lp64`, perhaps an -L flag is missing?

Any idea why?

selvavm avatar Apr 05 '21 07:04 selvavm

I just ran into this same problem just now. This is also happening on Linux. It seems you cant build a static library with iomp5. So for example:

[dependencies]
intel-mkl-src = { version = "0.6", default-features = false, features = ["mkl-static-ilp64-iomp"] }

Will fail to compile, but mkl-static-ilp64-seq or mkl-dynamic-ilp64-iomp will work just fine. This seems to be an issue with the build script somewhere.

aleon1138 avatar Jun 05 '21 13:06 aleon1138

Ok I found a work-around: the libmkl_core.a library is in a different directory than libiomp5.a. So what I did is just create a symlink:

$ ls 
libiomp5.a -> ../../../compiler/lib/intel64_lin/libiomp5.a
libmkl_core.a
....

... and it now compiles and works.

FYI - my MKL install is under /opt/intel/ and I'm on Ubuntu 18.04

aleon1138 avatar Jun 05 '21 14:06 aleon1138

I've pushed a potential fix https://github.com/rust-math/intel-mkl-src/pull/63

aleon1138 avatar Jun 09 '21 06:06 aleon1138