FindBLAS returns wrong MKL libraries when gfortran is used
Hello,
FindBLAS returns the wrong mkl libraries when gfortran is used on linux systems. It returns libmkl_intel_lp64 instead of libmkl_gf_lp64. The attached archive provides a simple example that reproduces the problem. Once the archive is decompressed do this (assuming MKL is in your LD_LIBRARY_PATH):
mkdir build
cd build
export CC=gcc; export FC=gfortran
cmake ..
make
./main_c
This should result in a segfault inside sub_f because this uses the mkl fortran interface for the ifort Intel Fortran compiler although gfortran is used. To resume, in this case the MKL libraries incorrectly returned by FindBLAS are libmkl_intel_lp64, libmkl_intel_thread and libmkl_core whereas the good ones are libmkl_gf_lp64, libmkl_gnu_thread and libmkl_core.bug_findblas_cmake.tgz