FindLAPACK: Extend search directories for MKL

Even though Intel MKL typically puts the libraries under
`$MKLROOT/lib/$arch_$os` some installations may still use
`$MKLROOT/lib/$arch/` path. Ideally, `$arch` should be a
symlink to `$arch_$os`, but sometimes the opposite happens
(for instance, see Intel MKL distribution in Arch Linux [1]),
and sometimes only `$arch` directory alone is present.

This patch extends the search list with `$MKLROOT/lib/$arch` with
lower priority than `$MKLROOT/lib/$arch_$os`, as the latter is the
official path to Intel MKL libraries.

It is also worth mentioning that Intel MKL Link Line Adviser [2]
recommends using `$MKLROOT/lib/$arch` directory in a link line:
```
 -L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_intel_lp64
 -lmkl_sequential -lmkl_core -lpthread -lm -ldl
```

[1] https://www.archlinux.org/packages/community/x86_64/intel-mkl/files/

[2] https://software.intel.com/content/www/us/en/develop/articles/intel-mkl-link-line-advisor.html
This commit is contained in:
evatux
2020-06-16 10:23:45 -07:00
parent d880d2805f
commit 8d5a07ce76

View File

@@ -289,7 +289,9 @@ if(BLAS_FOUND)
endif()
set(LAPACK_mkl_LIB_PATH_SUFFIXES
"compiler/lib" "compiler/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}"
"compiler/lib/${LAPACK_mkl_ARCH_NAME}"
"mkl/lib" "mkl/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}"
"mkl/lib/${LAPACK_mkl_ARCH_NAME}"
"lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}")
# First try empty lapack libs