Compilation and Installation
Procedure
- Use PuTTY to log in to the server as the root user.
- Decompress the CP2K installation package.
tar -xvf cp2k-7.1.tar.bz2
- Go to the directory generated after the decompression.
cd cp2k-7.1/arch
- Modify the Linux-x86-64-gfortran.psmp file.
- Open the Linux-x86-64-gfortran.psmp file.
vi Linux-x86-64-gfortran.psmp
- Press i to enter the edit mode and modify the following information in bold:
#Tested with: GFortran 7.4.0, MPICH 3.3, LAPACK 3.8.0, ScaLAPACK 2.0.2, FFTW 3.3, Libint 2.6.0, Libxc 4.3.4, libxsmm 1.14, ELPA 2019.05.001, PLUMED 2.5.2, SPGLIB 1.12.2 # Author: Matthias Krack (matthias.krack@psi.ch, PSI, December 2019) CC = mpicc FC = mpif90 LD = mpif90 AR = ar -r GNU_PATH = /path/to/install MATHLIBPATH = /path/to/EXTRA/mathlib include /path/to/install/PLUMED/lib/plumed/src/lib/Plumed.inc.static ELPA_INC = $(GNU_PATH)/ELPA/include/elpa_openmp-2019.05.001 ELPA_LIB = $(GNU_PATH)/ELPA/lib FFTW_INC = $(GNU_PATH)/FFTW/include FFTW_LIB = $(GNU_PATH)/FFTW/lib LIBINT_INC = $(GNU_PATH)/LIBINT/include LIBINT_LIB = $(GNU_PATH)/LIBINT/lib LIBXC_INC = $(GNU_PATH)/LIBXC/include LIBXC_LIB = $(GNU_PATH)/LIBXC/lib SPGLIB_INC = $(GNU_PATH)/SPGLIB/include SPGLIB_LIB = $(GNU_PATH)/SPGLIB/lib PLUMED_LIB = $(GNU_PATH)/PLUMED/lib PLUMED_INC = $(GNU_PATH)/PLUMED/include GSLBLAS_LIB = $(GNU_PATH)/GSL/lib GSLBLAS_INC = $(GNU_PATH)/GSL/include CFLAGS = -O1 -g -mtune=native -fno-unroll-loops -fstack-protector DFLAGS = -D__ELPA -D__FFTW3 -D__LIBINT -D__LIBXC DFLAGS += -D__MPI_VERSION=3 -D__PLUMED2 -D__SPGLIB DFLAGS += -D__parallel -D__SCALAPACK FCFLAGS = $(CFLAGS) $(DFLAGS) FCFLAGS += -ffree-form -ffree-line-length-none FCFLAGS += -fopenmp -fno-omit-frame-pointer FCFLAGS += -ftree-vectorize -funroll-loops -std=f2008 FCFLAGS += -I$(ELPA_INC)/elpa -I$(ELPA_INC)/modules FCFLAGS += -I$(FFTW_INC) -I$(LIBINT_INC) -I$(LIBXC_INC) -I$(GSLBLAS_INC) -I$(PLUMED_INC) LDFLAGS = $(FCFLAGS) -static-flang-libs LIBS = -L$(GSLBLAS_LIB) -L$(PLUMED_LIB) -lgsl -lgslcblas -lz -lplumed -lplumedKernel LIBS += $(ELPA_LIB)/libelpa_openmp.a LIBS += $(LIBXC_LIB)/libxcf03.a LIBS += $(LIBXC_LIB)/libxc.a LIBS += $(LIBINT_LIB)/libint2.a LIBS += $(SPGLIB_LIB)/libsymspg.a LIBS += $(FFTW_LIB)/libfftw3.a LIBS += $(FFTW_LIB)/libfftw3_threads.a LIBS += $(MATHLIBPATH)/libscalapack.a LIBS += $(MATHLIBPATH)/liblapack.a LIBS += $(MATHLIBPATH)/libblas.a LIBS += -ldl -lpthread -lstdc++
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the Linux-x86-64-gfortran.psmp file.
- Go to the cp2k-7.1 directory.
cd ../
- Perform the installation and compilation.
export LD_LIBRARY_PATH=/path/to/PLUMED/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=/path/to/GSL/lib:$LD_LIBRARY_PATH make -j 16 ARCH=Linux-x86-64-gfortran VERSION=psmp
Parent topic: CP2K 7.1 Porting Guide (openEuler 21.03)