爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 10563|回复: 10

MPICH3.2安装可能遇到的问题及解决方案

[复制链接]
发表于 2016-11-14 22:03:41 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
本帖最后由 JHONG 于 2016-11-15 09:15 编辑

花了很长时间终于成功把MPICH3.2装上了,为了让大家少走弯路,现在把安装过程中可能遇到的问题及解决方案汇总出来,供参考~

众所周知,linux下源码安装通常如下三步走:./configure --> make --> make install 就OK了,然而,这期间可能并不那么顺利,有时总会遇到各种各样的问题,比如环境依赖问题,比如编译器的选择问题,等等。

软件的下载(windows下):http://www.mpich.org/downloads/        将软件使用xftp上传到服务器并解压
编译:./configure --prefix=(指定安装路径),这时遇到问题:
----------------------------------------------------------------------------------------------------------------------------
configure: error:Fortran 90 support requires compatible Fortran 77 support.To force the use of the Fortran 90 compiler for Fortran 77, do not use configure option --disable-f77, and set the environment variable F77 to the name of the Fortran 90 compiler, or $FC. If you do not want any Fortran support, use configure options --disable-f77 and --disable-fc.
----------------------------------------------------------------------------------------------------------------------------
随后,参照http://www.cnblogs.com/reddatepz/p/5292970.html进行编译,仍出错,但给出提示:如果不用c++可以加入--disable-cxx(大致这个意思),于是使用如下命令进行编译:./configure CC=gccF77=gfortran FC=gfortran --prefix=/home/h***/usr/mpich/ --with-pm=hydra--enable-g=all --disable-cxx 成功

接着就是进行make了,以为编译成功了后面就比较顺利了,结果make也出问题了:
----------------------------------------------------------------------------------------------------------------------------
[h****@inode1mpich-3.2]$ make
CDPATH="${ZSH_VERSION+.}:"&& cd . && /bin/sh/home/software/MPICH/mpich-3.2/mpich-3.2/confdb/missing aclocal-1.15 -Iconfdb
/home/software/MPICH/mpich-3.2/mpich-3.2/confdb/missing:line 81: aclocal-1.15: command not found
WARNING: 'aclocal-1.15'is missing on your system.
         You should only need it if youmodified 'acinclude.m4' or
         'configure.ac' or m4 files included by'configure.ac'.
         The 'aclocal' program is part of theGNU Automake package:
         It also requires GNU Autoconf, GNU m4and Perl in order to run:
         <http://www.perl.org/>
make: *** [aclocal.m4] Error 127
----------------------------------------------------------------------------------------------------------------------------
然后从网上找到如下解决方案:
----------------------------------------------------------------------------------------------------------------------------
Often, you don'tneed any auto* tools and the simplest solution is to simply run touch aclocal.m4 configure inthe relevant folder (and also run touch on Makefile.am and Makefile.in if they exist). This willupdate the timestamp of aclocal.m4 and remind the system that aclocal.m4 isup-to-date and doesn't need to be rebuilt. After this, it's probably best toempty your build directory and rerun configure from scratchafter doing this. I run into this problem regularly. For me, the root cause isthat I copy a library (e.g. mpfr code for gcc) from anotherfolder and the timestamps change.
Of course, thistrick isn't valid if you really do need to regenerate those files, perhapsbecause you have manually changed them. But hopefully the developers of thepackage distribute up-to-date files.
----------------------------------------------------------------------------------------------------------------------------
于是根据所讲的,分别输入执行touchaclocal.m4 configure touch Makefile.am touchMakefile.in后,使用语句./configure CC=gcc F77=gfortran FC=gfortran--prefix=/home/h***/usr/mpich/ --with-pm=hydra --enable-g=all --disable-cxx重新编译,成功,之后make时出现如下错误:
----------------------------------------------------------------------------------------------------------------------------
[h****@inode1mpich-3.1]$ make
( cd . &&rm -f .err unusederr.txt ; rm -rf .tmp )
( cd . && \
          ./maint/extracterrmsgs -careful=unusederr.txt \
                                      -skip=src/util/multichannel/mpi.c \
                                      `cat maint/errmsgdirs` > .tmp 2>.err )
make: *** [src/mpi/errhan/defmsg.h] Error 126
----------------------------------------------------------------------------------------------------------------------------
然后从网上搜索到如下解决方案:
----------------------------------------------------------------------------------------------------------------------------
When I intended to run the make command you gave to me, I found that make clean didn't work. So I remove the entire directory, and re-decompress the tarball. This time the make can successfully pass.
----------------------------------------------------------------------------------------------------------------------------

删除整个MPICH3.2并重新解压一个,分别输入执行touch aclocal.m4configure touch Makefile.am touch Makefile.in后,使用语句./configureCC=gcc F77=gfortran FC=gfortran --prefix=/home/h****/usr/mpich/--with-pm=hydra --enable-g=all --disable-cxx重新编译,成功,之后make,成功,make install成功!!!



主要是修改path,为path添加mpibin目录:
vi .bashrc
.bashrc文件的末尾添加:export PATH=/usr/……/mpich/bin:$PATH
之后source .bashrc
which mpiexec,查看命令是否是我们安装目录下的命令


-- Over --




密码修改失败请联系微信:mofangbao
发表于 2016-11-14 22:41:01 | 显示全部楼层
收下我的膝盖==
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2016-11-15 14:24:36 | 显示全部楼层
密码修改失败请联系微信:mofangbao
发表于 2017-3-6 09:18:01 | 显示全部楼层
您好,安装的是mpich3.1.2,运行测试程序正确,但是怎样调用mpiexec呢,直接输入命令mpiexec -n 8 ./*.exe并没有执行并行运算。会是什么原因呢?
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2017-3-6 12:21:44 | 显示全部楼层
ylln_ln 发表于 2017-3-6 09:18
您好,安装的是mpich3.1.2,运行测试程序正确,但是怎样调用mpiexec呢,直接输入命令mpiexec -n 8 ./*.exe并 ...

mpiexec -n 8 ./*.exe 执行所有的.exe文件?  我不知道这样可不可以,没试过。你试一下mpiexec -n 8 ./wrf.exe  然后看一下wrf是不是在执行。
密码修改失败请联系微信:mofangbao
发表于 2017-3-6 13:59:32 | 显示全部楼层
执行,但是还是串行,并没有并行运算~
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2017-3-6 14:28:13 | 显示全部楼层
ylln_ln 发表于 2017-3-6 13:59
执行,但是还是串行,并没有并行运算~

也许是你wrf编译的时候没有选择并行
密码修改失败请联系微信:mofangbao
发表于 2017-3-6 14:38:53 | 显示全部楼层
还有个问题,因为wrf是fortran编写的,但是我在安装mpich3.1.2的时候./configure -prefix=/usr/local/mpich --disable-fortran --disable-fc 2>&1 | tee c.txt,执行的这个,禁用了fortran和fc,不知道有没有关系呢?编译wrf的时候选择的是 x86_64 Linux, gfortran compiler with gcc   (serial)。
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2017-3-7 20:00:00 | 显示全部楼层
ylln_ln 发表于 2017-3-6 14:38
还有个问题,因为wrf是fortran编写的,但是我在安装mpich3.1.2的时候./configure -prefix=/usr/local/mpich ...

x86_64 Linux, gfortran compiler with gcc   (serial) 是串行,所以你没法并行运算很正常,重新编译就可以了。
密码修改失败请联系微信:mofangbao
发表于 2017-3-8 10:21:28 | 显示全部楼层
好的,已经重新编译了,谢谢~
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表