Problem with compilation with multi-threading + mkl + fftw3 (and gnu compiler)

Daniele Fontanari danielef... at gmail.com
Tue Nov 1 17:31:18 UTC 2016


Hello everyone

I have now a cp2k version which is running smoothly if I compile the *opt 
versions, however I have problems (in term of runtime failures) with the 
*smp version.

I can access the linear algebra routines through a MKL library, which 
provide also a wrapper for FFTW3 (but I DON'T have access to the intel 
compilers, I use the GNU ones)
The runtime error for the smp version is the following:

STOP Intel's FFTW3 interface to MKL is not thread-safe prior to MKL 
11.1.0!  Please rebuild CP2K, linking against FFTW 3 from www.fftw.org or a 
newer version of MKL. Now exiting...

This is quite strange since my version of MKL should be newer than 11.1.0 
(I am not the sysadmin, the intel folder is referred as "2016.0.109", a 
quick search suggests that the 11.3 version should be installed, but I'd 
like to know a way to check this for sure)

However if I try to install the "vanilla" version of fftw3 and try to 
install with the configure option "--enable-openmp" and thus linking the 
libraries "libfftw3.a" and "libfftw3_omp.a" I get the same error.
the arch file I am using is the following:
(the fftw libraries are in $(FFTW3ROOT)/lib )


## Begin test.ssmp ##
MKLROOT    = /opt/intel/compilers_and_libraries_2016.0.109/linux/mkl
MKLLIB     = $(MKLROOT)/lib/intel64
FFTW3ROOT  = $(HOME)/cp2k_build/src/fftw3_vanilla/fftw-3.3.5/installazione

CC         = gcc
CPP        =
FC         = mpif90
LD         = mpif90
AR         = ar -r
ALLFLAGS   = -D__MKL -D__FFTW3 -O2 -fopenmp -I$(MKLROOT)/include 
-I$(FFTW3ROOT)/include
FCFLAGS    = $(ALLFLAGS) -ffree-form
CFLAGS     = $(ALLFLAGS)
LDFLAGS    = -L$(FFTW3ROOT)/lib -fopenmp
LIBS       = -Wl,--start-group $(MKLLIB)/libmkl_gf_lp64.a 
$(MKLLIB)/libmkl_gnu_thread.a $(MKLLIB)/libmkl_core.a -Wl,--end-group 
-lpthread -lm -ldl -lstdc++ -lfftw3 -lfftw3_omp
## End test.ssmp ##


Just recently I noticed that the installation wiki on the website might be 
saying that if I compile with GNU+MKL I cannot have openmp? Is this the 
case?

Thanks

Daniele
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20161101/b36e0de8/attachment.htm>


More information about the CP2K-user mailing list