方方长长

方方长长

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#

載入中......
此文章數據所有權由區塊鏈加密技術和智能合約保障僅歸創作者所有。