rust-math / intel-mkl-src

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

fix MKL openmp linking in windows and add one search path for linux f… #51

Closed ChingChuan-Chen closed 3 years ago

ChingChuan-Chen commented 3 years ago

Hi,

I was trying to link MKL on my windows computer. After some trials, I found that the reason for #46 . It was that the file of libiomp5.a / libiomp5.so is named after libiomp5md.a in windows environment. And libiomp5md.a is put in C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.2.254\windows\compiler\lib\intel64_win on my computer. Therefore, I change the searching path, then it works.

Also, I found that the test case will fail in windows because rust have error on searching \\\\?\\C:\\some_path/../../another_path. As a result, I fixed the test case with adding lines 171-177 in the intel-mkl-tool/src/entry.rs file.

In addition, I found that I can't use the mkl-*-*-iomp feature on my CentOS VM. It's very similar to the windows one, it can't find the libiomp5.a / libiomp.so. There is one more path that should be searched for, /opt/intel/compilers_and_libraries_2019.4.243/linux/compiler (in my case). So I add lines 115 and 125 in intel-mkl-tool/src/entry.rs file.

Ching-Chuan Chen

ChingChuan-Chen commented 3 years ago

There is another issue that Path::new("/opt/intel/mkl/../lib/libiomp5.a").exists() is false. cat /opt/intel/mkl/../lib/libiomp5.a also gave error No such file or directory. It seems that the absolute path with .. operations is invalid in some situations like ls, realpath and open file although cd is okay.

Therefore, I think that changing the default path as a mutable variable, then we can leverage .pop for the further seeking operation.