编译支持HDF5的VASP
冬夜秋雾
2022年01月28日 22:23
收录于文集
共10篇

一、安装HDF5

  1. 下载HDF5及相关的SZIP和ZLIB,链接如下

    ZLIB: https://www.zlib.net/zlib-1.2.11.tar.gz

    SZIP: https://support.hdfgroup.org/ftp/lib-external/szip/2.1.1/src/szip-2.1.1.tar.gz

    HDF5: https://www.hdfgroup.org/downloads/hdf5/source-code/

  2. 安装

代码块
Shell
自动换行
复制代码
export CC=icc
export CXX=icpc
export FC=ifort
export CFLAGS='-O3 -xHost -ip'
export CXXFLAGS='-O3 -xHost -ip'
export FCFLAGS='-O3 -xHost -ip'
tar -zxvf szip-2.1.1.tar.gz
cd szip-2.1.1
./configure --prefix=~/bin/szip
make
make check
make install

tar -zxvf zlib-1.2.7.tar.gz
cd zlib-1.2.7 
./configure --prefix=~/bin/zlib
make
make install

tar -zxvf hdf5-1.8.8.tar.gz
cd hdf5-1.8.8
./configure --prefix=~/bin/hdf5 --enable-fortran --with-szip=~/bin/szip --with-zlib=~/bin/zlib 
make 
make install
复制成功

3. VASP编译

修改makefile.include,添加

代码块
Shell
自动换行
复制代码
#HDF5-support (optional but strongly recommended)
CPP_OPTIONS+= -DVASP_HDF5
HDF5_ROOT  ?= ~/bin/hdf5
LLIBS      += -L$(HDF5_ROOT)/lib -lhdf5_fortran
INCS       += -I$(HDF5_ROOT)/include
复制成功