单机环境安装MPICH2(简化版)

系统环境:Fedora 16
预装软件:gcc、gfortran(yum install gcc-gfortran)
1.mpich2.tar.gz下载: http://www.mcs.anl.gov/research/projects/mpich2/downloads/index.php?s=downloads
   最新稳定版本为:MPICH2-1.4.1p1
2.解压缩包
1 tar xzpvf mpich2-1.4.1p1.tar.gz
3.配置、编译MPICH(关闭c++编译功能)
1  cd  mpich2-1.4.1p1
2 ./configure --prefix=/usr/local/mpi --disable=cxx
3 make
4.开启ssh服务,检查/etc/hosts文件中是否存在并且其中包含本机的主机名。系统默认开启,未作变化。
5.切换root身份,安装
1 make install
6.编辑~/.bashrc文件添加环境变量(为 /root 目录下的文件)
PATH=${PATH}:/usr/local/mpi/bin 
export PATH
MANPATH=${MANPATH}:/usr/local/mpi/man
export MANPATH
或者添加
PATH=/usr/local/mpi/bin:$PATH
执行命令
1 # source ~/.bashrc
7.测试环境变量设置
1 which mpif77
2 which mpif90
3 which mpicc
4 man mpif90
8.测试运行 MPICH 的例子程序
1 cd /home/guge/mpi/examples/f90
2 mpif90 -o pi3 pi3f90.f90
3 mpirun -np 2 ./pi3

转载于:https://www.cnblogs.com/Parallel-Life/archive/2012/02/26/2369075.html

你可能感兴趣的:(运维)