大部分安装包可以在https://www.cp2k.org/static/downloads/找到,其它的可以去官网自行下载。https://www.cndba.cn/shuye100/article/1723
操作系统版本:Red Hat Enterprise Linux Server release 7.3 (Maipo)
[root@cp2k Linux-x86-64-gfortran]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/gcc/libexec/gcc/x86_64-pc-linux-gnu/6.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure –prefix=/opt/gcc –enable-languages=c,c++,fortran –disable-multilib
Thread model: posix
gcc version 6.3.0 (GCC)
安装gcc
./contrib/download_prerequisites
./configure –prefix=/opt/gcc –enable-languages=c,c++,fortran –disable-multilib
https://www.cndba.cn/shuye100/article/1723
需要把对应的文件做成软连接,建议把之前的重命名一下,如下:
ln -s /opt/gcc/bin/gfortran /bin/gfortran
安装libint
./configure –prefix=/opt/libint –with-ar=ar FC=gfortran F77=gfortran F90=gfortran CC=gcc
安装acml5.3.1
http://developer.amd.com/tools-and-sdks/archive/compute/amd-core-math-library-acml/acml-downloads-resources/#download
解压后执行如下脚本:
./install-acml-5-3-1-gfortran-64bit.sh
安装fftw
https://www.cndba.cn/shuye100/article/1723
./configure –prefix=/opt/fftw CC=gcc FC=gfortran F77=gfortran –enable-threads –enable-shared=yes
安装libxc
./configure –prefix=/opt/libxc/ AR=ar FC=gfortran F77=gfortran F90=gfortran CC=gcc
安装lapack
cp make.inc.example make.inc
make blaslib
make lapacklib
vi make.inc
# LAPACK make include file. #
# LAPACK, Version 3.5.0 #
# November 2013 #
#
SHELL = /bin/sh
#
# Modify the FORTRAN and OPTS definitions to refer to the
# compiler and desired compiler options for your machine. NOOPT
# refers to the compiler options desired when NO OPTIMIZATION is
# selected. Define LOADER and LOADOPTS to refer to the loader and
# desired load options for your machine.
#
FORTRAN = gfortran
OPTS = -O2 -frecursive
DRVOPTS = $(OPTS)
NOOPT = -O0 -frecursive
LOADER = gfortran
LOADOPTS =
#
# Timer for the SECOND and DSECND routines
#
# Default : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME
#TIMER = EXT_ETIME
# For RS6K : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME_
# TIMER = EXT_ETIME_
# For gfortran compiler: SECOND and DSECND will use a call to the INTERNAL FUNCTION ETIME
TIMER = INT_ETIME
# If your Fortran compiler does not provide etime (like Nag Fortran Compiler, etc…)
# SECOND and DSECND will use a call to the INTERNAL FUNCTION CPU_TIME
# TIMER = INT_CPU_TIME
# If neither of this works…you can use the NONE value… In that case, SECOND and DSECND will always return 0
# TIMER = NONE
#
# Configuration LAPACKE: Native C interface to LAPACK
# To generate LAPACKE library: type ‘make lapackelib’
# Configuration file: turned off (default)
# Complex types: C99 (default)
# Name pattern: mixed case (default)
# (64-bit) Data model: LP64 (default)
#
# CC is the C compiler, normally invoked with options CFLAGS.
#
CC = gcc
CFLAGS = -O3
#
# The archiver and the flag(s) to use when building archive (library)
# If you system has no ranlib, set RANLIB = echo.
#
ARCH = ar
ARCHFLAGS= cr
RANLIB = ranlib
#
# Location of the extended-precision BLAS (XBLAS) Fortran library
# used for building and testing extended-precision routines. The
# relevant routines will be compiled and XBLAS will be linked only if
# USEXBLAS is defined.
#
# USEXBLAS = Yes
XBLASLIB =
# XBLASLIB = -lxblas
#
# The location of the libraries to which you will link. (The
# machine-specific, optimized BLAS library should be used whenever
# possible.)
#
BLASLIB = ../../librefblas.a
LAPACKLIB = liblapack.a
TMGLIB = libtmglib.a
LAPACKELIB = liblapacke.a
会生成librefblas.a liblapack.a
安装scalapack
cp SLmake.inc.example SLmake.inc
makevi SLmake.inc
#
#
# Program: ScaLAPACK
#
# Module: SLmake.inc
#
# Purpose: Top-level Definitions
#
# Creation date: February 15, 2000
#
# Modified: October 13, 2011
#
# Send bug reports, comments or suggestions to
#
#
#
# C preprocessor definitions: set CDEFS to one of the following:
#
# -DNoChange (fortran subprogram names are lower case without any suffix)
# -DUpCase (fortran subprogram names are upper case without any suffix)
# -DAdd_ (fortran subprogram names are lower case with “_” appended)
CDEFS = -DAdd_
#
# The fortran and C compilers, loaders, and their flags
#
FC = mpif90
CC = mpicc
NOOPT = -O0
FCFLAGS = -O3
CCFLAGS = -O3
FCLOADER = $(FC)
CCLOADER = $(CC)
FCLOADFLAGS = $(FCFLAGS)
CCLOADFLAGS = $(CCFLAGS)
#
# The archiver and the flag(s) to use when building archive (library)
# Also the ranlib routine. If your system has no ranlib, set RANLIB = echo
#
ARCH = ar
ARCHFLAGS = cr
RANLIB = ranlib
#
# The name of the ScaLAPACK library to be created
#
SCALAPACKLIB = libscalapack.a
#
# BLAS, LAPACK (and possibly other) libraries needed for linking test programs
#
BLASLIB = /opt/lapack/librefblas.a
LAPACKLIB = /opt/lapack/liblapack.a
LIBS = $(LAPACKLIB) $(BLASLIB)
安装openmpi
./configure –prefix=/opt/openmpi CC=gcc FC=gfortran F77=gfortran
安装mpich3
./configure –prefix=/opt/mpich3 –enable-cxx F77=gfortran FC=gfortran FCFLAGS=”-O2 -xHost” FFLAGS=”-O2 -xHost” CC=gcc CXX=g++ CFLAGS=”-O2 –xHost” CXXFLAGS=”-O2 -xHost” –enable-threads=multiple –enable-fast=all –enable-mpit-pvars=all
编辑环境变量/etc/profile
export PATH=$PATH:/opt/mpich3/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/ mpich3/lib
https://www.cndba.cn/shuye100/article/1723
https://www.cndba.cn/shuye100/article/1723
source /etc/profile
安装cp2k41
vi *.ssmp

https://www.cndba.cn/shuye100/article/1723
make -j 8 ARCH=Linux-x86-64-gfortran VERSION=psmp

最后会在~/cp2k-4.1/exe/Linux-x86-64-gfortran/目录下面生成N多个psmp文件包含cp2k.psmp
刚刚开始写博客,也得不清楚或有问题的地方还请多多指正,:
版权声明:本文为博主原创文章,未经博主允许不得转载。
hpc cp2k
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/217692.html原文链接:https://javaforall.net
