libint wrapper for Intel compiler

Lukasz Walewski Lukasz.... at
Mon Dec 22 13:13:08 UTC 2008


My compilation of CP2K (popt version) with IFC Version 10.1 and MKL without libint works fine and all the regression tests pass
except for 35 due to the lack of libint. After turning the libint
support on (-D__LIBINT) and having actual libint compiled the following
linking error shows up:

ifort -D__INTEL -D__parallel -D__BLACS -D__SCALAPACK -D__FFTSG -D__FFTW3
-D__FFTMKL -D__LIBINT -fpp -free -heap-arrays 64
-I/opt/intel/mkl/ -O3 -funroll-loops -fp-model precise
-pc64 -D__COMPILE_ARCH="\"Linux-x86-64-intel\"" -D__COMPILE_DATE="\"Mon
Dec 22 10:26:54 CET 2008\"" -D__COMPILE_HOST="\"magrathea\""
-D__COMPILE_LASTCVS="\"D\"" -L/opt/intel/mkl/
-L/home/lwalewsk/opt/libint-1.1.2/lib -static-intel -pthread
-o /home/lwalewsk/rt/cp2k/makefiles/../exe/Linux-x86-64-intel/cp2k.popt
cp2k.o /home/lwalewsk/rt/cp2k/makefiles/../lib/Linux-x86-64-intel/popt/libcp2k_lib.a /home/lwalewsk/rt/cp2k/makefiles/../lib/Linux-x86-64-intel/popt/libcp2k_fft_lib.a /home/lwalewsk/rt/cp2k/makefiles/../lib/Linux-x86-64-intel/popt/libcp2k_base_lib.a  -lfftw3 -lmkl_scalapack_lp64 -lmkl_blacs_openmpi_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_lapack -lmkl_core -lguide -lmpi_f77 -lmpi -lopen-rte -lopen-pal -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl -lderiv -lint -lstdc++
/home/lwalewsk/rt/cp2k/makefiles/../lib/Linux-x86-64-intel/popt/libcp2k_lib.a(hfx_libint_wrapper.o)(.text+0x9e): In function `hfx_libint_wrapper_mp_get_derivs_':
/home/lwalewsk/rt/cp2k/makefiles/../src/hfx_libint_wrapper.F: undefined
reference to `wrap_to_build_deriv1_eri'
/home/lwalewsk/rt/cp2k/makefiles/../lib/Linux-x86-64-intel/popt/libcp2k_lib.a(hfx_libint_wrapper.o)(.text+0x2a1): In function `hfx_libint_wrapper_mp_get_eris_':
/home/lwalewsk/rt/cp2k/makefiles/../src/hfx_libint_wrapper.F: undefined
reference to `wrap_to_build_eri'
make[1]: ***
Error 1
make[1]: Leaving directory
make: *** [build] Error 2

Looking into src/hfx_libint_wrapper.F in the #elif defined (__INTEL)
section there is
DIMENSION(0:build_eri_size,0:build_eri_size,0:build_eri_size,0:build_eri_size), BIND(C) :: build_eri
declaration at line 335 but then the wrapper is bound to
    FUNCTION wrapper_build_eri(na, nb, nc, nd, lib) BIND(C,
at line 341.

On the other hand what is really defined in the libint.a library is

lwalewsk at magrathea:~/opt/libint-1.1.2> nm lib/libint.a | grep build_eri
0000000000000000 B build_eri

So we need to bind our wrapper_build_eri to build_eri and not to
wrap_to_build_eri - am I right ? If so, then the line 341 of
src/hfx_libint_wrapper.F should be replaced by:

    FUNCTION wrapper_build_eri(na, nb, nc, nd, lib) BIND(C,

The same applies to build_deriv1_eri function. After making the
appropriate changes (see the attached patch) the compilation process
ends up cleanly.

The same problem might affect the NAG compiler version of the wrapper
but I did not check this.

Merry Christmas!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: hfx_libint_wrapper.patch
Type: text/x-patch
Size: 988 bytes
Desc: not available
URL: <>

More information about the CP2K-user mailing list