MKL 64lp versus 64ilp difficulties

Hello,

I’ve been having difficulty with using Eigen and the Intel MKL backend in my project. My CMake version is 3.15.2. For the full details, see here: https://gitlab.com/libeigen/eigen/-/issues/1890

The summary version is that the linking flags from

set(BLA_VENDOR Intel10_64lp)
find_package(BLAS)

appear to be incorrect. When using them, when I start my programs I receive this error:

dyld: Symbol not found: _mkl_blas_caxpy
  Referenced from: /opt/intel/compilers_and_libraries_2019.4.233/mac/mkl/lib/libmkl_intel_lp64.dylib
  Expected in: flat namespace
 in /opt/intel/compilers_and_libraries_2019.4.233/mac/mkl/lib/libmkl_intel_lp64.dylib

Using Intel’s tool at https://software.intel.com/content/www/us/en/develop/articles/intel-mkl-link-line-advisor.html I tried specifying the compile flags manually with:

    target_compile_options(${TGT} PRIVATE -m64 -I${MKLROOT}/include)
    target_link_options(${TGT} PRIVATE -L$ENV{MKLROOT}/lib -Wl,-rpath,${MKLROOT}/lib -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl)

And my programs now run correctly. Please note that the 64ilp interface found by CMake works correctly, it is only the 64lp that appears to be incorrect. Eigen requires the 64lp interface to be used.

Is this an error with the find_package(BLAS) or something that I’m doing?

Thanks in advance.