FindBLAS.cmake should not (only) use the dynamic linker path
FindBLAS.cmake uses the dynamic linker path to search for BLAS libraries (see https://gitlab.kitware.com/cmake/cmake/blob/v3.14.0/Modules/FindBLAS.cmake#L134). Sadly, this breaks in several places. I found the following problems:
- On Linux,
LD_LIBRARY_PATH
is a colon-separated list. However FindBLAS.cmake accepts only a single path entry and fails if there are colons in the variable. Since the Intel MKL useslib/intel_lin
instead oflib
directory by default, a singleLD_LIBRARY_PATH
will not be sufficient for most users of the Intel MKL. - On MSVC, the variable
LIB
is used. However this is the same variable used by Visual Studio to find internal libraries. Users that overrideLIB
in the hope to point to a BLAS library may inadvertently break all default Visual Studio builds because i.e.kernel32.lib
and other essential runtime libraries will not be found anymore. - Last, not least, FindBLAS.cmake does not respect the
MKL_ROOT
variable. The default for Intel MKL is to search at least the CMake-variable and environment-variableMKL_ROOT
for the required Intel MKL libraries.