24小时热门版块排行榜    

查看: 2340  |  回复: 6
【奖励】 本帖被评价5次,作者ggdh增加金币 3.6
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

[资源] Dalton2011 编译心得

小结:安装Dalton2011的关键点:1,一个较高版本的编译器。2,如果是装64位的dalton,那么就需要64位的数学库以及64位的openmpi。32的亦然。本文中没有包括数学库的安装。3,编译openmpi的编译器和编译dalton的编译器要保持一致。

编译Dalton失败,在网上一查。还没有完整的Dalton2011的编译过程
于是打算写一篇方便后来人:

编译Dalton时出错:
cc1: error: unrecognized command line option "-fbacktrace"*
上dalton官网的用户邮件列表看到回答说可能是gcc版本过低

Dear Ivan,

since it does not seem very likely that you changed the F90 compiler between
the initial compilation (until you hit the cc1 error) and the continuation,
which would render any first round-compiled module file unreadable, my best
guess is that your gfortran compiler is too old (your gcc line in the
previous mail said 4.1.2).
you need at least version 4.3 to work properly with module files.

the latest stable version of gfortran is 4.7 if I am not mistaken.
hope this helps.

with best regards,

stefan

sent from my iPad

用gcc -v 命令查看本机gcc版本
gcc version 3.4.6 20060404
于是开始安装gcc
安装gcc之前先得安装三个依赖包

gmp 安装
GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating point numbers.
http://gmplib.org/下载gmp-5.0.2.tar.bz2
拷贝到服务器上
解压
tar -jxvf gmp-5.0.2.tar.bz2
cd ./gmp-5.0.2
创建安装目录
mkdir ../../local/gmp-5.0.2
./configure --prefix=/home/qin/local/gmp-5.0.2
开始编译
make
make install
make check
编译成功后在~/.bashrc里面写入环境变量
export LD_LIBRARY_PATH=/home/qin/local/gmp-5.0.2/lib:$LD_LIBRARY_PATH

mpfr 安装
The MPFR library is a C library for multiple-precision floating-point computations with correct rounding
http://www.mpfr.org/下载mpfr-3.1.0.tar.bz2
拷贝到服务器上
解压
tar -jxvf mpfr-3.1.0
cd mpfr-3.1.0
创建安装目录
mkdir ../../local/mpfr-3.1.0
./configure --prefix=/home/qin/local/mpfr-3.1.0
开始编译
make
make check
make install
编译成功后在~/.bashrc里面写入环境变量
export LD_LIBRARY_PATH=/home/qin/local/mpfr-3.1.0/lib:$LD_LIBRARY_PATH

mpc安装
Mpc is a C library for the arithmetic of complex numbers with arbitrarily high precision and correct rounding of the result.
http://www.multiprecision.org/下载mpc-0.9.tar.gz
拷贝到服务器上
解压
tar -xzvf mpc-0.9.tar.gz
cd mpc-0.9
mkdir ../../local/mpc-0.9
./configure --prefix=/home/qin/local/mpc-0.9 --with-gmp=/home/qin/local/gmp-5.0.2 --with-mpfr=/home/qin/local/mpfr-3.1.0
make
make install
编译成功后在~/.bashrc里面写入环境变量
export LD_LIBRARY_PATH=/home/qin/local/mpc-0.9/lib:$LD_LIBRARY_PATH

gcc安装
从gcc官网下载最新gcc-4.6.2.tar.gz
解压后新建两个目录,一个用来编译,一个用来放编好的gcc
mkdir ~/local/gcc-4.6.2
mkdir ~/local/gcc-temp
cd  ~/local/gcc-temp
./configure --prefix=/home/qin/local/gcc-4.6.2 --with-gmp=/home/qin/local/gmp-5.0.2 --with-mpfr=/home/qin/local/mpfr-3.1.0 --with-mpc=/home/qin/local/mpc-0.9
make
make install
漫长等待2小时
安装好之后
在~/.bashrc中改环境变量
export LD_LIBRARY_PATH=/home/qin/local/gcc-4.6.2/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/home/qin/local/gcc-4.6.2/lib64:$LD_LIBRARY_PATH
export PATH=/home/qin/local/gcc-4.6.2/bin:$PATH
然后
source ~/.bashrc
然后
which gcc
显示
~/local/gcc-4.6.2/bin/gcc
大功告成了。
接下来安装dalton

Dalton2011安装
先解压
tar -jxvf Dalton2011_release_v0.tbz
cd Dalton2011_release/DALTON
./configure
出现一堆是非问答题。一般选默认即可
但是数学库的选择要注意一下
~/local/gcc-4.6.2/bin/gccFound /opt/intel/mkl/10.0.2.018/lib/32/libmkl.so, use it? [Y/n] n
Found /opt/intel/mkl/10.0.2.018/lib/64/libmkl.so, use it? [Y/n] n
Found /opt/intel/mkl/10.0.2.018/lib/em64t/libmkl.so, use it? [Y/n] n
Found /opt/intel/mkl/10.1.1.019/lib/32/libmkl.so, use it? [Y/n] n
Found /opt/intel/mkl/10.1.1.019/lib/64/libmkl.so, use it? [Y/n] y
显然服务器上装了不少数学库,我选了一个版本较高的64位的。
然后开始编译
make
不幸又出错了

make[1]: Entering directory `/home/qin/Dalton2011_release/DALTON/lucita'
make --no-print-directory dalton_mpi.o lucita_mcscf_ci_cfg.o lucita_cfg.o lucita_orbitalspaces.o par_sync_cw.o par_io.o par_communication_model.o par_io_fh.o
mpif90 -I../include  -J../modules -DVAR_GFORTRAN -DSYS_LINUX -DVAR_MFDS -D'INSTALL_WRKMEM=1048000000' -D'INSTALL_MMWORK=1' -D_FILE_OFFSET_BITS=64 -DVAR_MPI -DGFORTRAN=462 -DVAR_INT64 -DIMPLICIT_NONE -march=x86-64 -O3 -ffast-math -funroll-loops -ftree-vectorize -fbacktrace -fdefault-integer-8 -c dalton_mpi.F90
dalton_mpi.F90:16.9:

  use mpi
         1
Fatal Error: Parse error when checking module version for file 'mpi.mod' opened at (1)

查原因,可能是openmpi编译用的gcc和现在gcc版本不同造成的。
于是去下openmpi

openmpi的安装
http://www.open-mpi.org/下载openmpi-1.4.4.tar.bz2
tar -jxvf openmpi-1.4.4.tar.bz2
建立目标目录
mkdir ./local/openmpi-1.4.4
cd ./openmpi-1.4.4
配置
./configure --prefix=/home/qin/local/openmpi-1.4.4
开始编译
make
make install
写入环境变量
export MPI_ROOT=/home/qin/local/openmpi-1.4.4
export LD_LIBRARY_PATH=$MPI_ROOT/lib:$LD_LIBRARY_PATH
export PATH=$MPI_ROOT/bin:$PATH
source ~/.bashrc

重新安装Dalton2011
。。。。
又出错了:
mpif90 -I../include  -J../modules -DVAR_GFORTRAN -DSYS_LINUX -DVAR_MFDS -D'INSTALL_WRKMEM=1048000000' -D'INSTALL_MMWORK=1' -D_FILE_OFFSET_BITS=64 -DVAR_MPI -DGFORTRAN=462 -DVAR_INT64 -DIMPLICIT_NONE -march=x86-64 -O3 -ffast-math -funroll-loops -ftree-vectorize -fbacktrace -fdefault-integer-8 -c par_sync_cw.F90
par_sync_cw.F90:244.68:

      call dalton_mpi_bcast(set_sync_default_val, 0, mpi_comm_world)
                                                                    1
Error: There is no specific subroutine for the generic 'dalton_mpi_bcast' at (1)
par_sync_cw.F90:223.64:
.........
Error: There is no specific subroutine for the generic 'dalton_mpi_bcast' at (1)
par_sync_cw.F90:142.78:

   call dalton_mpi_bcast(lucita_cfg_max_batch_size,      0, mpi_comm_world)
                                                                           1   
Error: There is no specific subroutine for the generic 'dalton_mpi_bcast' at (1)
Fatal Error: Error count reached limit of 25.

这次又在Dalton邮件列表上找到了类似错误

Hi Nikolai,

this is indeed a bit puzzling. Your Makefile.config seems OK at first glance wrt the MPI settings.
You are using OpenMPI, right? If so, could you please send me the output of

ompi_info -a
?

Wrt your MKL problem i note that you compile with 64-bit integers, i.e. the -i8 flag for ifort.
In this case you have to use the 64-bit version of the MKL libs as well!
The following line should do it:
LIBS = -L/site/VERSIONS/intel-11.1/mkl/lib/em64t -Wl,--rpath=/site/VERSIONS/intel-11.1/mkl/lib/em64t -lmkl_lapack -lmkl_intel_ilp64 -lmkl_solver_ilp64 -lmkl_intel_thread -lmkl_core -lguide -lpthread

Your MPI problem could also be related to a 64-bit/32-bit issue. Note that OpenMPI has to be configured with 64-bit integers if you want to use it with
a 64-bit Dalton. You can check this in the
ompi_info -a output by grepping for the line 'Fort integer size', i.e.:

ompi_info -a | grep 'Fort integer size'

should yield

Fort integer size: 8

with best regards,

stefan


openmpi 64位安装
意思就是不能用32为的openmpi去编译64位的Dalton
运行这个命令
ompi_info -a | grep 'Fort integer size'
得到
Fort integer size: 4
说明我的openmpi是32位的
于是要重新编译openmpi
回到openmpi 安装哪一步
在配置的地方写上
./configure --prefix=/home/qin/local/openmpi-1.4.4 CXX=g++ CC=gcc F77=gfortran FC=gfortran FFLAGS="-m64 -fdefault-integer-8" FCFLAGS="-m64 -fdefault-integer-8" CFLAGS=-m64  CXXFLAGS=-m64
删掉之前的安装
rm -r ~/local/openmpi-1.4.4/*
make
make install
ompi_info -a | grep 'Fort integer size'
得到
Fort integer size: 8
说明64位openmpi编译成功(在此感谢大漠孤狼,天外来客热心帮助)

Dalton TEST
在回到前面Dalton的安装,这次make成功了。
开始测试
cd /home/qin/Dalton2011_release/DALTON/test
./TEST -keep -benchmark all > TEST_all.log 2>&1 &
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dumbgirl

金虫 (小有名气)


点错星了。对不起了楼主
5楼2012-03-10 16:21:35
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 7 个回答

lonewolf659

铜虫 (小有名气)


★★★★★ 五星级,优秀推荐

兄台好有责任心啊,感谢分享经验。
2楼2011-11-10 14:35:18
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

xuhu_11

金虫 (职业作家)


★★★★★ 五星级,优秀推荐

没天理,版主也不给点打发!
3楼2012-02-25 19:14:44
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

小范范1989

木虫 (著名写手)


★★★★★ 五星级,优秀推荐

学习,关注楼主。楼主也用dalton
7楼2014-10-11 09:07:10
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
☆ 无星级 ★ 一星级 ★★★ 三星级 ★★★★★ 五星级
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[论文投稿] 岩土工程学报什么时候才能终审完呐 25+3 yeager111 2026-08-10 4/200 2026-08-16 20:42 by tfang
[基金申请] 时间戳又变了8-15 +13 archvillain 2026-08-15 25/1250 2026-08-16 20:13 by zhaosm1982
[基金申请] 哪位老哥知道今年的国自然具体哪一天放榜? +9 Ldrop2023 2026-08-13 9/450 2026-08-16 13:24 by wukun_007
[基金申请] 咱们一起用铁证分析2026国家社科基金中标与否 +7 启萌科技 2026-08-12 26/1300 2026-08-16 12:35 by 启萌科技
[基金申请] 我的国基提前知道中了,可是同事的操作让我实在接受不了,怎么会有这样的人 +11 家与远方 2026-08-10 16/800 2026-08-16 10:28 by ray43
[基金申请] filecode=后面第一个是大写字母 +6 wangze12014 2026-08-14 7/350 2026-08-15 20:12 by gltch
[基金申请] 各位道友,我要去昆明玩几天,回来见。 +7 Tide man 2026-08-14 8/400 2026-08-15 01:11 by arzu_hma
[基金申请] 是这周出结果还是下周出结果? +4 yuleib84 2026-08-11 4/200 2026-08-14 23:05 by lfy8008
[基金申请] 奇怪,两个人的filecode固定段从头到尾一模一样 +8 布布和一二 2026-08-10 11/550 2026-08-14 14:58 by Equinoxhua
[硕博家园] 读博的好处 +4 lnee 2026-08-11 4/200 2026-08-14 10:20 by ahsoarli
[基金申请] filecode +15 documentary 2026-08-10 17/850 2026-08-14 10:08 by kissu88
[基金申请] FileCode能看出啥? +10 要乐观耀哥 2026-08-10 32/1600 2026-08-14 09:37 by 要乐观耀哥
[基金申请] 重要来源:本周末出结果 +10 瞬息宇宙 2026-08-12 10/500 2026-08-13 15:46 by likettle
[基金申请] Filecode 又变了,巨变 +3 WH3796 2026-08-12 4/200 2026-08-13 14:13 by 小木虫6752397
[基金申请] 结合人工智能,周易传统文化,filecode打分制来了,3分以上希望很大。 +3 Tide man 2026-08-12 4/200 2026-08-13 08:35 by ZJTJZ
[基金申请] 2019年青年基金涵评意见,大家看看几个A,几个B? +11 Tide man 2026-08-11 11/550 2026-08-13 07:35 by 撸猫猫
[基金申请] 为什么网上很多人说本周 12号出结果 +6 瞬息宇宙 2026-08-10 7/350 2026-08-11 19:25 by Tide man
[基金申请] 什么时候出结果,有咨询渠道??? +3 Tide man 2026-08-11 3/150 2026-08-11 17:54 by kudofaye
[基金申请] 国自然结果 +4 Vierhys 2026-08-10 8/400 2026-08-10 15:06 by Vierhys
[基金申请] 据悉今年马上要出结果了 +7 瞬息宇宙 2026-08-10 8/400 2026-08-10 12:42 by Vivilian
信息提示
请填处理意见