操作系统为centOS7
进入安装包目录并下载mpich安装包
cd /opt/software
wget http://www.mpich.org/static/downloads/3.4.1/mpich-3.4.1.tar.gz
安装包解压到当前目录
tar -zxvf mpich-3.4.1.tar.gz
在当前目录下生成解压后的文件夹mpich-3.4.1
进入解压后的文件夹并开始安装
cd mpich-3.4.1/
sudo ./configure --prefix=/opt/module/mpich-3.4.1 --with-device=ch4:ofi
configure后报错
configure: error: No Fortran 77 compiler found. If you don't need to
build any Fortran programs, you can disable Fortran support using
--disable-fortran. If you do want to build Fortran
programs, you need to install a Fortran compiler such as gfortran
or ifort before you can proceed.
根据提示在末尾加上--disable-fortran指令
sudo ./configure --prefix=/opt/module/mpich-3.4.1 --with-device=ch4:ofi --disable-fortran
注:--prefix后为设置的mpi安装路径
编译安装
(时间较长)
sudo make
sudo make install
安装后在/opt/module/mpich-3.4.1路径下生成bin、include、lib、share四个文件夹
vim ~/.bashrc
在bashrc文件最底下添加环境变量
export MPI_ROOT=/opt/module/mpich-3.4.1
export PATH=$MPI_ROOT/bin:$PATH
export MANPATH=$MPI_ROOT/man:$MANPATH
环境生效
source ~/.bashrc
配置成功验证
mpirun -version