At a minimum, CP2K requires a Fortran 95 compiler, BLAS and LAPACK libraries in order to compile, and an MPI-2 implementation and ScaLAPACK library to build a parallel version. Optionally, FFT libraries, and the the libint[4] library, required for Hartree-Fock exchange (HFX) calculations, can also be used. There is a single Makefile, and the code comes with over 100 `arch' files which customise the make procedure to a particular system. By customising the existing CRAY-XT5.popt arch file, the following settings were used, and saved as CRAY-XT-CNL-pathscale.popt:
CC = cc CPP = cpp FC = ftn -freeform LD = ftn AR = ar -r DFLAGS = -D__PATHSCALE -D__XT5 -D__FFTW3 -D__FFTSG -D__LIBINT \ -D__parallel -D__BLACS -D__SCALAPACK CPPFLAGS = -traditional -C $(DFLAGS) -P $(FFTW_INCLUDE_OPTS) FCFLAGS = -O3 -OPT:Ofast LDFLAGS = $(FCFLAGS) LIBS = -L/work/z01/z01/ibethune/cp2k/libint/lib \ /work/z01/z01/ibethune/cp2k/cp2k/libint_tools/libint_cpp_wrapper.o \ -lderiv -lint -lstdc++ OBJECTS_ARCHITECTURE = machine_xt5.o MODDEPS = no
To build the code the following was used:
module swap PrgEnv-pgi PrgEnv-pathscale make ARCH=CRAY-XT-CNL-pathscale VERSION=popt
On HECToR, the linear algebra (BLAS, LAPACK, BLACS, ScaLAPACK) are provided in the libsci library which is loaded and linked by the default module environment. FFTW 3 is also available on HECToR and is found to give very good performance (see section 4). The FFTSG is an in-built set of FFT routines that can be used as a fallback where no FFT library is available on the system. Here, libint is built and linked in, but could easily be omitted by removing the -D__LIBINT definitation and the libraries in the LIBS variable.