Compiling and Installing CP2K
Procedure
- Use PuTTY to log in to the server as the root user.
- Run the following command to decompress the CP2K installation package:
tar xvf cp2k-7.1.0.tar.gz
- Run the following command to switch to the directory generated after decompression:
cd cp2k-7.1.0/arch
- Run the following command to modify the configuration file:
- Open the configuration file.
vi Linux-x86-64-gfortran.psmp
- Press i to enter the insert mode and modify the file.
GNU_PATH = /path/to/EXTRA/ MATHLIBPATH = /path/to/EXTRA/mathlib include $(GNU_PATH)/plumed252/lib/plumed/src/lib/Plumed.inc.static ELPA_VER = 2019.05.001 ELPA_INC = $(GNU_PATH)/elpa/include/elpa_openmp-$(ELPA_VER) ELPA_LIB = $(GNU_PATH)/elpa/lib FFTW_INC = $(GNU_PATH)/fftw3/include FFTW_LIB = $(GNU_PATH)/fftw3/lib LIBINT_INC = $(GNU_PATH)/libint2/include LIBINT_LIB = $(GNU_PATH)/libint2/lib LIBXC_INC = $(GNU_PATH)/libxc434/include LIBXC_LIB = $(GNU_PATH)/libxc434/lib SPGLIB_INC = $(GNU_PATH)/spglib112/include SPGLIB_LIB = $(GNU_PATH)/spglib112/lib CFLAGS = -O2 -g -mtune=native 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 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) LDFLAGS = $(FCFLAGS) LIBS = $(PLUMED_DEPENDENCIES) -lgsl -lgslcblas -lz 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)/librefblas.a LIBS += -ldl -lpthread -lstdc++
- Open the configuration file.
- Run the following commands to go to the directory:
cd /path/to/CP2K/exts/dbcsr cp dbcsr-2.1.0-rc12.tar.gz ./
- Run the following commands to decompress the dbcsr-2.1.0-rc12.tar.gz installation package and go to the directory generated after the decompression:
tar -xvf dbcsr-2.1.0-rc12.tar.gz cd dbcsr-2.1.0-rc12
- Run the following command to move all the files in dbcsr-2.1.0-rc12 to dbcsr:
mv * ../
- Run the following command to compile and install CP2K:
make -j 16 ARCH=Linux-x86-64-gfortran VERSION=psmp
Parent topic: CP2K 7.1 Porting Guide (CentOS 7.6)