CMake configuration for using MKL as FFT library
Hi,
I've found strange behavior while trying to build Gromacs (master Branch, but also should be the same in 2020.2) using MKL as external BLAS/LAPACK and FFT library.
I'm using the following CMake configuration:
cmake ../gromacs/ -DCMAKE_CXX_COMPILER=mpicxx -DGMX_MPI=ON -DGMX_FFT_LIBRARY=mkl -DCMAKE_INSTALL_PREFIX=$(pwd)/bin -DGMX_EXTERNAL_BLAS=ON -DGMX_EXTERNAL_LAPACK=ON
which produces an error:
-- Looking for DftiCreateDescriptor
-- Looking for DftiCreateDescriptor - not found
CMake Error at cmake/gmxManageFFTLibraries.cmake:174 (message):
Linking with MKL was requested, but was not successful: The include path to
mkl.h in MKL_INCLUDE_DIR, and the link libraries in MKL_LIBRARIES= need to
match what the MKL documentation says you need for your system: Use full
paths to library files, in the right order, and separated by semicolons.
Call Stack (most recent call first):
CMakeLists.txt:649 (include)
So apparently CMake could not find FFTW inside the MKL. However, I have checked $MKLROOT is defined correctly and moreover CMake is able to use MKL as BLAS/LAPACK without any problems, so this only affects FFT part of it.
Could someone confirm if that is bug or intended behavior?