cp2k 编译安装教程

简介

CP2K is a quantum chemistry and solid state physics software package that can perform atomistic simulations of solid state, liquid, molecular, periodic, material, crystal, and biological systems. CP2K provides a general framework for different modeling methods such as DFT using the mixed Gaussian and plane waves approaches GPW and GAPW.

链接:官网地址下载地址

编译环境

cp2k 支持 multi-threading, MPI, and CUDA

单线程版本只需要串行编译器即可,多线程版本需要编译器支持例如-fopenmp参数,MPI版本需要MPI编译器,CUDA版本需要CUDA编译器。

本文仅介绍前两种,针对CUDA的编译暂略。

设置编译环境举例:

# 设置intel编译器环境
source /opt/intel/composer_xe_2013.0.079/bin/iccvars.sh intel64
source /opt/intel/composer_xe_2013.0.079/bin/ifortvars.sh intel64
source /opt/intel/composer_xe_2013.0.079/mkl/bin/mklvars.sh intel64
# 设置mpi编译环境
export PATH=/usr/local/mpi-intel2013/bin:$PATH  
export LD_LIBRARY_PATH=/usr/local/mpi-intel2013/lib:$LD_LIBRARY_PATH

一些依赖库

BLAS/LAPACK

使用Intel编译器,直接用MKL库即可。

LIBINT

Libint is a software stack for computing integrals used in molecular quantum mechanics.

# 下载:https://sourceforge.net/projects/libint/files/v1-releases/
./configure CC=icc CXX=icpc FC=ifort \
  --prefix=$HOME/software/libint-1.1.5 --enable-deriv
make
make install

LIBXC

Libxc is a library of exchange-correlation functionals for density-functional theory. The aim is to provide a portable, well tested and reliable set of exchange and correlation functionals that can be used by all the ETSF codes and also other codes.

# 下载:http://octopus-code.org/wiki/Libxc:download
tar zxvf libxc-2.2.3.tar.gz
cd libxc-2.2.3
./configure CC=icc CXX=icpc FC=ifort --prefix=$HOME/libxc/2.2.3
make
make install

编译cp2k

tar zxvf cp2k-4.1.tar.gz
cd cp2k-4.1

# 因为用的是mpich,所以修改mpi的编译命令
sed -i "s/mpiicpc/mpicxx/g" arch/Linux-x86-64-intel-mic.psmp 
sed -i "s/mpiicc/mpicc/g" arch/Linux-x86-64-intel-mic.psmp
sed -i "s/mpiifort/mpif90/g" arch/Linux-x86-64-intel-mic.psmp

cd makefiles/
make -j 12 ARCH=Linux-x86-64-intel-host \
  VERSION=popt \
  LIBINTROOT=$HOME/software/libint/1.1.5 \
  LIBXCROOT=$HOME/software/libxc/2.2.3 \
  MKL_STATIC=2

说明:

参数含义
-j 12用 12 个核同时编译
ARCH=Linux-x86-64-intel-host指定ARCH为linux系统,x86_64架构,用intel编译器
VERSION=popt指定为mpi版本
LIBINTROOT=$HOME/software/libint/1.1.5给出libint路径,不给出则不支持该库
LIBXCROOT=$HOME/software/libxc/2.2.3给出libxc路径,不给出则不支持该库
MKL_STATIC=2选择动态MKL库的支持

备注:
1. 可以依据需求编译各种版本:
- sopt 串行
- ssmp 多线程
- popt mpi版本
- psmp mpi+多线程
2. 网络上有一个非常详细的教程,可以参考:
- cp2k4.x-5.x 最新多进程并行版(host.popt版)超详细完美安装教程

我的个人网站:传送门

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值