Open hajgato opened 3 years ago
Hmm, I'm not sure the order in which libraries are linked really determine which FFT implementation is being used by CP2K...
In both cases, the cp2k.popt
binary will link to both libfftw3.so.3
and statically linking to MKL.
CP2K is compiled with -D__FFTW3
when FFTW is included as a dependency (both with or without MKL), and that determines which functions are being used I think...
@hajgato How did you come to the conclusion that CP2K isn't actually leveraging FFTW3 when MKL is included in the toolchain?
@boegel Just checked the order of linked libraries
Just to complicate matters even more, apparently CP2K provides runtime control over which FFT library is used, see https://manual.cp2k.org/cp2k-2_1-branch/CP2K_INPUT/GLOBAL.html#desc_PREFERRED_FFT_LIBRARY ... (hat tip @smoors)
this is the link command:
However, FFTW is after MKL, and it should be before:
the same is true for includes:
-I/apps/gent/RHEL8/zen2-ib/software/FFTW/3.3.8-intel-2020a/include
should be before-I/apps/gent/RHEL8/zen2-ib/software/imkl/2020.0.166-iimpi-2020a/mkl/include
(or theMKL
FFT
include should be not there.)