Linux中MPICH3.2.1安装步骤及遇到的问题并解决

一、下载Mpich并解压

Downloads | MPICH

到官方网站下载Mpich,并解压到自己的文件目录下

 二、安装过程及遇到的问题

        正确安装步骤,可以直接看Mpich解压文件下的README文件,有详细安装步骤及某些问题解决方式。

1、Configure MPICH specifying the installation directory

for csh and tcsh:

      ./configure --prefix=/home/<USERNAME>/mpich-install |& tee c.txt

for bash and sh:

      ./configure --prefix=/home/<USERNAME>/mpich-install 2>&1 | tee c.txt

 遇到的问题:

(1)configure: error: no acceptable C compiler found in $PATH...

原因:没有安装GCC编译器

解决方法:如何在Ubuntu 18.04上安装GCC编译器_Linux教程_Linux公社-Linux系统门户网站

(2)No Fortran 77 compiler found. ...

原因:缺少such as后面的那两个包中的一个

解决方法:

sudo apt-get install gfortran

2、Build MPICH

for csh and tcsh:

      make |& tee m.txt

for bash and sh:

      make 2>&1 | tee m.txt

安装时未遇到问题

官方给出的可能遇到的问题的解决方法:

If there were problems, do a "make clean" and then run make again with V=1.

      make V=1 |& tee m.txt       (for csh and tcsh)

      OR

      make V=1 2>&1 | tee m.txt   (for bash and sh)

Then go to step (2) below, for reporting the issue to the MPICH developers and other users.

3、Install the MPICH commands

for csh and tcsh:

      make install |& tee mi.txt

for bash and sh:

      make install 2>&1 | tee mi.txt

未遇到问题

4、Add the bin subdirectory of the installation directory to your
    path in your startup script

配置环境变量查看和修改PATH环境变量(Linux通用) - 唐僧公子 - 博客园

PATH=/home/<USERNAME>/mpich-install/bin:$PATH ; export PATH

配置完成后,可以使用以下两个命令检查配置是否成功

which mpicc
which mpiexec

 配置成功会显示,mpicc和mpiexec的路径

 5、MPICH uses a process manager for starting MPI applications.

使用以下两种方式运行Mpich自带的例子

To run the CPI example with 'n' processes on your local machine, you can use:

      mpiexec -n <number> ./examples/cpi

Test that you can run an 'n' process CPI job on multiple nodes:

      mpiexec -f machinefile -n <number> ./examples/cpi

The 'machinefile' is of the form:

      host1
      host2:2
      host3:4   # Random comments
      host4:1

'host1', 'host2', 'host3' and 'host4' are the hostnames of the machines you want to run the job on. 
The ':2', ':4', ':1' segments depict the number of processes you want to run on each node.
If nothing is specified, ':1' is assumed.

安装成功

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值