FindBLAS: Choose MKL arch based on BLA_VENDOR
Recently, FindBLAS has been extended with additional library search path based on the environment variable MKLROOT
. However, the choice of the Intel MKL architecture (IA-32 vs Intel64) was based on unrelated (and possibly undefined) size of integer.
This commit changes the selection of the Intel MKL architecture to instead consider the variable BLA_VENDOR
, if available.
So, if the environment variable MKLROOT
is defined and BLA_VENDOR=Intel10_32
, then $ENV{MKLROOT}/lib/ia32_OS will be added to the search path (where OS = lin, win, or mac).
Similarly, if MKLROOT
is defined and BLA_VENDOR
is one of Intel10_64lp
, Intel10_64lp_seq
, Intel10_64ilp
or Intel10_64ilp_seq
, then the path $ENV{MKLROOT}/lib/intel64_OS will be used.
If either MKLROOT
or BLA_VENDOR
is undefined, no additional search path on top of the already used LD_LIBRARY_PATH
/ DYLD_LIBRARY_PATH
/ LIB
is be added.
This is a small step back from !3108 (merged) in that MKLROOT
alone is now not enough and explicit specification of the architecture (via BLA_VENDOR
) is needed. However, at least it makes sure that the library search path will not contain directories for wrong architecture.
BTW, the method introduced in !3108 (merged) also does not work with the combination of non-Intel compiler and threaded Intel MKL, because the library libiomp5 needed by libmkl_intel_thread is neither in $MKLROOT/lib/ia32 nor in $MKLROOT/lib/intel64 and will not be found by FindBLAS unless it is in LD_LIBRARY_PATH
etc. This commit does not change that behaviour.
Fixes #19259 (closed)