Cannot seek `mkl-dynamic-*-iomp` when Intel-MKL is not located in `/opt/intel`
Hi, I just found intel-mkl-tool may not work well with libiomp5.so when Intel MKL suite is not installed to /opt/intel.
If I didn't misunderstand the code, the function seek_directory just finds the paths of MKL libraries with given root_dir. When Intel MKL suite is installed to /opt/intel, seek_directory just can find the correct path of libiomp5.so since Library::new() already includes /opt/intel, and everything works well. However, libiomp5.so doesn't lie in MKLROOT, but in oneapi/compiler/${version}/${platform}/compiler/lib, leading to the failure.
There might be two possible solution:
- I found
intel-mkl-toolusedpkg-configto find alternative ofMKLROOT, but it may be easier to parse the output ofpkg-config --libs mkl-dynamic-lp64-iomp, since the corresponding.pcfiles are provided by Intel and can work as expected in most environments; - For the case that
pkg-configis not found, just add an additionalroot_dir=$MKLROOT/../../and useseek_directoryto find the right path. There may be some issues when multiple versions of oneAPI is installed to oneroot_dir, but this can be resolved by using the same version of MKL and compiler. It seems you've implementedLibrary::versionfunction but not used it, so here comes the role of it.
I can make an PR to fix this but it would be better to fix it by the author since my coding style may not match this repo very well....