方方长长

方方长长

CP2K并行编译

下载源码包此处为 cp2k6.1,本文编译方法和 cp2k 7.1 通用,cp2k7.1 安装时所需依赖包都是从 github 下载,比较慢,也容易下载出错,cp2k6.1 没有这种情况。

cd /opt#

wget https://github.com/cp2k/cp2k/releases/download/v6.1.0/cp2k-6.1.tar.bz2#

解压 cp2k

tar -xvf cp2k-6.1.tar.bz2#

安装 cp2k

cd /opt/cp2k-6.1/tools/toolchain#

./install_cp2k_toolchain.sh#

如果有报错可能 mpich 的环境冲突,在线安装 mpich

yum install mpich-*#

安装完成后出现以下
Now copy:
cp /opt/cp2k-6.1/tools/toolchain/install/arch/* to the cp2k/arch/ directory
To use the installed tools and libraries and cp2k version
compiled with it you will first need to execute at the prompt:
source /opt/cp2k-6.1/tools/toolchain/install/setup
To build CP2K you should change directory:
cd cp2k/makefiles/
make -j 8 ARCH=local VERSION="sopt sdbg ssmp popt pdbg psmp"
按照提示安装
cp -r /opt/cp2k-6.1/tools/toolchain/install/arch/ /opt/cp2k-6.1/arch/
source /opt/cp2k-6.1/tools/toolchain/install/setup
cd /opt/ cp2k-6.1/makefiles/
make -j 8 ARCH=local VERSION= "popt "
等待编译安装完成
生成的文件在 /opt/cp2k-6.1/exe/local
cp2k.popt 这个就是生成可执行文件
添加环境变量

export PATH=/opt/cp2k-6.1/exe/local:$PATH#

测试算例

cd /opt/cp2k-6.1/tests/FE/regtest-1#

mpirun -np 8 cp2k.popt Solv_alch_chng.inp#

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.