cndaqiang Web Linux DFT

gcc 编译 ATOM

2019-03-05
cndaqiang
DFT
RSS

gcc编译赝势产生程序atom

前提

假设已经编译好了GCC,OPENMPI,LIBXC
此文环境

(GCC) 4.8.4
(Open MPI) 1.10.3  (不用也可以)
libxc-3.0.0 (不用也可以)

相关环境安装方法:
centos6.5 gcc Openmpi 编译octopus-4.1.2
gcc Openmpi 编译siesta
编译文件
下载 atom-4.2.7-100.tgz libgridxc-0.8.4.tgz xmlf90-1.5.4.tar.gz

环境变量设置

编译前前执行环境变量设置

GCCDIR=/opt/software/gcc-4.8.4-release
MPIDIR=/opt/software/openmpi
LIBXC_ROOT=/opt/lib/libxc-3.0.0
export PATH=$GCCDIR/bin:$PATH
export LD_LIBRARY_PATH=$GCCDIR/lib64:$LD_LIBRARY_PATH
export PATH=$MPIDIR/bin:$PATH
export LD_LIBRARY_PATH=$MPIDIR/lib:$LD_LIBRARY_PATH
export PATH=$LIBXC_ROOT/bin:$PATH
export LD_LIBRARY_PATH=$LIBX_ROOT/lib:$LD_LIBRARY_PATH

libgridxc

cd libgridxc-0.8.4/
mkdir Gfortran
cd Gfortran/
cp ../extra/fortran.mk .
../src/config.sh

修改文件vi makefile添加LIBXC环境

LIBXC_ROOT=/opt/lib/libxc-3.0.0

修改文件vi build.sh添加编译环境变量

GCCDIR=/opt/software/gcc-4.8.4-release
MPIDIR=/opt/software/openmpi
LIBXC_ROOT=/opt/lib/libxc-3.0.0
export PATH=$GCCDIR/bin:$PATH
export LD_LIBRARY_PATH=$GCCDIR/lib64:$LD_LIBRARY_PATH
export PATH=$MPIDIR/bin:$PATH
export LD_LIBRARY_PATH=$MPIDIR/lib:$LD_LIBRARY_PATH
export PATH=$LIBXC_ROOT/bin:$PATH
export LD_LIBRARY_PATH=$LIBX_ROOT/lib:$LD_LIBRARY_PATH

编译,若无MPI环境,WITH_MPI不用添加,若无LIBXC环环境,WITH_LIBXC不用添加

WITH_LIBXC=1  WITH_MPI=1  sh build.sh

记下当前目录,如/home/cndaqiang/work/compile-atom/atom_generate/libgridxc-0.8.4/Gfortran

xmlf90

cd xmlf90-1.5.4/
mkdir Gfortran
./configure --prefix=$(pwd)/Gfortran
make -j4
make install

记下安装目录,/home/cndaqiang/work/compile-atom/atom_generate/xmlf90-1.5.4/Gfortran

atom

cp arch.make.sample arch.make
vi arch.make

添加如下,若无libxc可不添加LIBXC_ROOT

LIBXC_ROOT=/opt/lib/libxc-3.0.0
XMLF90_ROOT=/home/cndaqiang/work/compile-atom/atom_generate/xmlf90-1.5.4/Gfortran
GRIDXC_ROOT=/home/cndaqiang/work/compile-atom/atom_generate/libgridxc-0.8.4/Gfortran

编译make 之后在,当前文件夹下生成可执行文件atm

附录

算盘下编译环境

GCCDIR=/opt/software/gcc-4.8.4-release
MPIDIR=/opt/software/openmpi
LIBXC_ROOT=/opt/lib/libxc-3.0.0
export PATH=$GCCDIR/bin:$PATH
export LD_LIBRARY_PATH=$GCCDIR/lib64:$LD_LIBRARY_PATH
export PATH=$MPIDIR/bin:$PATH
export LD_LIBRARY_PATH=$MPIDIR/lib:$LD_LIBRARY_PATH
export PATH=$LIBXC_ROOT/bin:$PATH
export LD_LIBRARY_PATH=$LIBX_ROOT/lib:$LD_LIBRARY_PATH

本文首发于我的博客@cndaqiang.
本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!


类似文章


评论


广告


广告
访客数据