rust-math / intel-mkl-src

Redistribute Intel MKL as a crate
Other
78 stars 22 forks source link

Rust GNU toolchain in windows not able to compile #59

Open selvavm opened 3 years ago

selvavm commented 3 years ago

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?

aleon1138 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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