小舟Ferry分享 http://blog.sciencenet.cn/u/DonarF1

博文

BerkeleyGW的安装编译

已有 16097 次阅读 2012-10-17 17:34 |个人分类:QE|系统分类:科研笔记| 编译, 安装, pwscf, following, BerkeleyGW

版本:BGW-1.0.3.tar
系统:fortran mpi: parallel_studio_xe_2011_sp1_update2_intel64
The code can be installed via the following steps:
1, cp [flavor_real.mk/flavor_cplx.mk] flavor.mk
2, cp ./config/[mysystem].mk arch.mk。 我这借用的是mako.berkeley.edu.mk.mk文件。
3, make all
4, make check[-jobscript]
修改后的arch.mk文件如下:
arch.mk 如下:
# arch.mk for BerkeleyGW codes
#
# suitable for SCRS North cluster mako.berkeley.edu
#
# D. Strubbe
# February 2010, UC Berkeley
#
# module load openmpi/1.4.1-intel
# module load fftw/2.1.5-intel
# module load mkl/11.1.064

# Precompiler options
#
COMPFLAG  = -DINTEL
PARAFLAG  = -DMPI
MATHFLAG  = -DUSESCALAPACK
DEBUGFLAG = -DDEBUG -DVERBOSE

FCPP    = cpp -ansi
F90free = mpif90 -free
LINK    = mpif90 -i-static -openmp
FOPTS   = -O3 -no-prec-div
FNOOPTS = -O2 -no-prec-div
MOD_OPT = -module
INCFLAG = -I

C_PARAFLAG = -DPARA
CC_COMP = mpiCC
C_COMP  = mpicc
C_LINK  = mpiCC
C_OPTS  = -O3

REMOVE  = /bin/rm -f

# Math Libraries
FFTWPATH     = /home/ljzhou86/app/fftw
FFTWLIB      = /home/ljzhou86/app/fftw/lib/libfftw.a
FFTWINCLUDE  = /home/ljzhou86/app/fftw/include
MKLPATH      = /home/ljzhou86/intel/composer_xe_2011_sp1.9.293/mkl/lib/intel64
LAPACKLIB    = -Wl,--start-group /home/ljzhou86/intel/composer_xe_2011_sp1.9.293/mkl/lib/intel64/libmkl_intel_lp64.a /home/ljzhou86/intel/composer_xe_2011_sp1.9.293/mkl/lib/intel64/libmkl_sequential.a /home/ljzhou86/intel/composer_xe_2011_sp1.9.293/mkl/lib/intel64/libmkl_core.a /home/ljzhou86/intel/composer_xe_2011_sp1.9.293/mkl/lib/intel64/libmkl_blacs_openmpi_lp64.a -Wl,--end-group -lpthread -limf -lm
# LAPACKLIB    = -Wl,--start-group $(MKLPATH)/libmkl_intel_lp64.a $(MKLPATH)/libmkl_sequential.a $(MKLPATH)/libmkl_core.a $(MKLPATH)/libmkl_blacs_openmpi_lp64.a -Wl,--e#nd-group -lpthread
SCALAPACKLIB = /home/ljzhou86/intel/composer_xe_2011_sp1.9.293/mkl/lib/intel64/libmkl_scalapack_lp64.a
#SCALAPACKLIB = -L$(MKLPATH)/ -lmkl_scalapack_lp64.a (如使用如此书写方式,编译时会说找不到,很奇怪,不知道为什么)

TESTSCRIPT =  make check-parallel mako.scr

注明,FFTWPATH  LAPACKLIB SCALAPACKLIB等路径必须用绝对路径,不然说找不到相应的库文件。

 

后面在cluster上安装,

FCPP    = cpp -ansi
F90free = /cluster/node5/temp/software/openmpi1.6/bin/mpif90 -free
LINK    = /cluster/node5/temp/software/openmpi1.6/bin/mpif90 -i-static -openmp
FOPTS   = -O3 -no-prec-div
FNOOPTS = -O2 -no-prec-div
MOD_OPT = -module
INCFLAG = -I

C_PARAFLAG = -DPARA
CC_COMP = /cluster/node5/temp/software/openmpi1.6/bin/mpiCC (先前已经安装了mpich2,与BGW不兼容,后重新安装openmpi,设置绝对路径才通过,否则显示错误:if90 -i-static -openmp -O3 -no-prec-div -o kgrid.x ../../Common/misc.o ../../Common/sort.o ../../Common/blas.o ../../Common/lapack.o ../../Common/symmetries.o ../../Common/global.o ../../Common/typedefs.o ../../Common/nrtype.o ../../Common/push_pop.o ../../Common/message.o ../../Common/peinfo.o ../../Common/timing.o ../../Common/system.o kgrid.o kgrid_routines.o ../../MeanField/spglib-1.0.9/libsymspg.a -Wl,--start-group /cluster/node5/temp/software/intel-2011/mkl/lib/intel64/libmkl_intel_lp64.a /cluster/node5/temp/software/intel-2011/mkl/lib/intel64/libmkl_sequential.a  /cluster/node5/temp/software/intel-2011/mkl/lib/intel64/libmkl_core.a /cluster/node5/temp/software/intel-2011/mkl/lib/intel64/libmkl_blacs_intelmpi_lp64.a -Wl,--end-group -lpthread -limf -lm
ln -sf /cluster/node5/temp/BGW/BerkeleyGW-1.0.4/MeanField/ESPRESSO/kgrid.x ../../bin
make[2]: Leaving directory `/cluster/node5/temp/BGW/BerkeleyGW-1.0.4/MeanField/ESPRESSO'
cd ICM && make
make[2]: Entering directory `/cluster/node5/temp/BGW/BerkeleyGW-1.0.4/MeanField/ICM'
mpiCC -I../../Common -DCPLX -DINTEL -DPARA -DDEBUG -DVERBOSE -c -O3 icm.cpp -o icm.o
make[2]: execvp: mpiCC: Permission denied
make[2]: *** [icm.o] Error 127
make[2]: Leaving directory `/cluster/node5/tlemp/BGW/BerkeleyGW-1.0.4/MeanField/ICM'
make[1]: *** [icm] Error 2
make[1]: Leaving directory `/cluster/node5/temp/BGW/BerkeleyGW-1.0.4/MeanField'
make: *** [meanfield] Error 2)


C_COMP  =/cluster/node5/temp/software/openmpi1.6/bin/mpicc
C_LINK  = /cluster/node5/temp/software/openmpi1.6/bin/mpiCC
C_OPTS  = -O3

REMOVE  = /bin/rm -f

# Math Libraries
FFTWPATH     =  /cluster/node5/temp/fftw2.1.5
FFTWLIB      = /cluster/node5/temp/fftw2.1.5/lib/libfftw.a
#FFTWINCLUDE  =$(FFTWPATH)/include
FFTWINCLUDE  = /cluster/node5/temp/fftw2.1.5/include
MKLPATH      = /cluster/node5/temp/software/intel-2011/mkl/lib/intel64

LAPACKLIB    = -Wl,--start-group /cluster/node5/temp/software/intel-2011/mkl/lib/intel64/libmkl_intel_lp64.a /cluster/node5/temp/software/intel-2011/mkl/lib/intel64/libmkl_sequential.a  /cluster/node5/temp/software/intel-2011/mkl/lib/intel64/libmkl_core.a /cluster/node5/temp/software/intel-2011/mkl/lib/intel64/libmkl_blacs_openmpi_lp64.a -Wl,--end-group -lpthread -limf -lm
SCALAPACKLIB = /cluster/node5/temp/software/intel-2011/mkl/lib/intel64/libmkl_scalapack_lp64.a
#SCALAPACKLIB = -L$(MKLPATH)/ -lmkl_scalapack_lp64.a

这里面如用先前的mkl库,会显示:

_sys2blacs_handle_.c:(.text+0x24): undefined reference to `ompi_mpi_comm_null'
_sys2blacs_handle_.c:(.text+0x9e): undefined reference to `ompi_mpi_comm_null'
_sys2blacs_handle_.c:(.text+0x13e): undefined reference to `ompi_mpi_comm_null'
_sys2blacs_handle_.c:(.text+0x160): undefined reference to `ompi_mpi_comm_world'
_sys2blacs_handle_.c:(.text+0x1d2): undefined reference to `ompi_mpi_comm_world'
/cluster/node5/program/intel/mkl/10.1.3.027/lib/em64t/libmkl_blacs_openmpi_lp64.a(BI_MPI_F77_to_c_trans_comm.o): In function `BI_MPI_F77_to_c_trans_comm':
_BI_MPI_F77_to_c_trans_comm.c:(.text+0x6): undefined reference to `MPI_Comm_f2c'
make[2]: *** [pw.x] Error 1
make[2]: Leaving directory `/cluster/node5/temp/qe/espresso-5.0.1/PW/src'
make[1]: *** [pw] Error 2
make[1]: Leaving directory `/cluster/node5/temp/qe/espresso-5.0.1/PW'
make: *** [pw] Error 2

 


Openmpi编译时:

Q1:

Catastrophic error: could not set locale "" to allow processing of multibyte characters

R1:

vi ~/.bashrc

LANG=en_US.utf8

LC_ALL=en_US.utf8


BGW install

Question2


../Common/fftw.o: In function `fftw_m_mp_do_fft_':

Common/fftw.p.f:(.text+0x5ea): undefined reference to `fftwnd_f77_create_plan_'

Common/fftw.p.f:(.text+0x60d): undefined reference to `fftwnd_f77_create_plan_'

Common/fftw.p.f:(.text+0xb0a): undefined reference to `fftwnd_f77_one_'

Common/fftw.p.f:(.text+0x1419): undefined reference to `fftwnd_f77_one_'

Common/fftw.p.f:(.text+0x18f7): undefined reference to `fftwnd_f77_destroy_plan_'

Common/fftw.p.f:(.text+0x1903): undefined reference to `fftwnd_f77_destroy_plan_'

../Common/fftw.o: In function `fftw_m_mp_destroy_fftw_plans_':

Common/fftw.p.f:(.text+0x1d4d): undefined reference to `fftwnd_f77_destroy_plan_'

Common/fftw.p.f:(.text+0x1d59): undefined reference to `fftwnd_f77_destroy_plan_'

make[2]: *** [epsilon.cplx.x] Error 1

make[2]: Leaving directory `/lustre/jhome15/hhb17/hhb172/source/BGW-1.1.beta/Epsilon'

make[1]: *** [epsilon-all] Error 2

make[1]: Leaving directory `/lustre/jhome15/hhb17/hhb172/source/BGW-1.1.beta'

make: *** [all] Error 2


Resolution2:


fftw-2.1.5编译时:F77=ifort ./configure --prefix=/***/fftw-2.1.5 -enable-float

Q3:


icm.cpp:(.text+0x17cf): undefined reference to `operator new[](unsigned long)'

icm.cpp:(.text+0x1895): undefined reference to `operator new[](unsigned long)'

icm.cpp:(.text+0x1955): undefined reference to `operator new[](unsigned long)'

icm.cpp:(.text+0x1b57): undefined reference to `operator delete[](void*)'

icm.cpp:(.text+0x1bd4): undefined reference to `operator delete[](void*)'

icm.cpp:(.text+0x1c04): undefined reference to `operator delete[](void*)'

icm.cpp:(.text+0x235a): undefined reference to `operator new[](unsigned long)'

icm.o: In function `terminate(int, int, int)':

icm.cpp:(.text+0x2b1f): undefined reference to `operator delete[](void*)'

icm.cpp:(.text+0x2b30): undefined reference to `operator delete[](void*)'

icm.cpp:(.text+0x2b77): undefined reference to `operator delete[](void*)'

icm.cpp:(.text+0x2bbb): undefined reference to `operator delete[](void*)'

icm.cpp:(.text+0x2bd4): undefined reference to `operator delete[](void*)'

icm.o:icm.cpp:(.text+0x2be5): more undefined references to `operator delete[](void*)' follow

icm.o: In function `scalar_trunc(double, int*, int*, int*, CARTESIAN*, CARTESIAN const*)':

icm.cpp:(.text+0x53a0): undefined reference to `operator new[](unsigned long)'

icm.cpp:(.text+0x541b): undefined reference to `operator new[](unsigned long)'

icm.cpp:(.text+0x54ab): undefined reference to `operator new[](unsigned long)'

icm.cpp:(.text+0x5647): undefined reference to `operator delete[](void*)'

icm.cpp:(.text+0x56ad): undefined reference to `operator delete[](void*)'

icm.cpp:(.text+0x56ca): undefined reference to `operator delete[](void*)'

icm.o: In function `__sti__$E':

icm.cpp:(.text+0x67c7): undefined reference to `std::ios_base::Init::Init()'

icm.cpp:(.text+0x67cc): undefined reference to `std::ios_base::Init::~Init()'

icm.o: In function `rand_init(int, CARTESIAN const*)':

icm.cpp:(.text+0x6800): undefined reference to `operator new[](unsigned long)'

icm.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'

../../Common/wfn_utils.o: In function `cub_read(char*, int*, int*, int*, int*, CARTESIAN*, CARTESIAN*, CARTESIAN*)':

Common/wfn_utils.cpp:(.text+0xdd5): undefined reference to `operator new[](unsigned long)'

Common/wfn_utils.cpp:(.text+0xdfa): undefined reference to `operator new[](unsigned long)'

Common/wfn_utils.cpp:(.text+0xed1): undefined reference to `operator new[](unsigned long)'

Common/wfn_utils.cpp:(.text+0xef7): undefined reference to `operator new[](unsigned long)'

Common/wfn_utils.cpp:(.text+0xf4a): undefined reference to `operator new[](unsigned long)'

../../Common/wfn_utils.o:Common/wfn_utils.cpp:(.text+0x1683): more undefined references to `operator new[](unsigned long)' follow

../../Common/wfn_utils.o: In function `scalar_clone(int*, int*, int*, CARTESIAN*, CARTESIAN*, CARTESIAN, CARTESIAN*, CARTESIAN, CARTESIAN*)':

Common/wfn_utils.cpp:(.text+0x4458): undefined reference to `operator delete[](void*)'

Common/wfn_utils.cpp:(.text+0x44f6): undefined reference to `operator delete[](void*)'

Common/wfn_utils.cpp:(.text+0x4551): undefined reference to `operator delete[](void*)'

../../Common/wfn_utils.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'

make[4]: *** [icm.x] Error 1

make[4]: Leaving directory `/lustre/jhome15/hhb17/hhb172/source/BGW-1.1.beta/MeanField/ICM'

make[3]: *** [icm] Error 2

make[3]: Leaving directory `/lustre/jhome15/hhb17/hhb172/source/BGW-1.1.beta/MeanField'

make[2]: *** [all] Error 2

make[2]: Leaving directory `/lustre/jhome15/hhb17/hhb172/source/BGW-1.1.beta/MeanField'

make[1]: *** [meanfield] Error 2

make[1]: Leaving directory `/lustre/jhome15/hhb17/hhb172/source/BGW-1.1.beta'

make: *** [all] Error 2

R3:


CC_COMP = mpicxx

C_COMP  = mpicc

C_LINK  = mpicxx


4: iop-0826上的编译 ,采用hodduk.mit.edu.mk

   * 编译 c++ 程序需要添加 -lstdc++   sample: gcc -lstdc++ -o test test.c,否则会报 "undefinedreference to '__gxx_personality_v0' " 等错误

2. 唉,用gcc命令编译C程序,用g++命令编译C++程序。

g++和gcc本质一样的,本质上还是gcc,我们实验室所有的c++程序都是用gcc编译的,一般的程序用gcc足够了。 对于 C++ 程序,编译的时候用 gcc 或者 g++ 都可以。但是在进行连接的时候最好用 g++,因为用 g++ 会自动进行 C++ 标准库的连接;用 gcc 连接 C++ 程序也可以,但是需要人为指定连接 C++ 标准库,否则就会出现 undefined reference to `__gxx_personality_v/0' 之类的错误。

可见-lstdc++ 所对应的是标准C++库


C_PARAFLAG = -DPARA -DMPICH_IGNORE_CXX_SEEK  







https://wap.sciencenet.cn/blog-100989-623569.html

上一篇:yambo的编译安装
下一篇:USPEX使用与错误解决方案
收藏 IP: 159.226.35.*| 热度|

1 刘洋

该博文允许注册用户评论 请点击登录 评论 (1 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-27 19:50

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部