CentOS7 搭建MPI环境

单机搭建

进了很多坑,最后还是啃了官方文档搞定的。参考:http://www.mpich.org/static/downloads/3.2.1/mpich-3.2.1-installguide.pdf

MPI记得要装在用户目录下


  1. 准备工作,需要提前获取root权限
# yum update
# yum install wget -y
# yum install gcc gcc-c++ gcc-fortran kernel-devel -y
  1. 下载mpi安装包
# wget http://www.mpich.org/static/downloads/3.1.4/mpich-3.1.4.tar.gz
  1. 安装mpi到$HOME/install下
# tar -zxvf mpich-3.1.4.tar.gz -C $HOME/mpich-install
  1. 进入安装目录
# cd $HOME/mpich-install
  1. 编译安装三部曲
# ./configure --prefix=$HOME/mpich-install 2>&1 | tee c.txt
# make 2>&1 | tee m.txt
# make install
# make install
  1. 配置
# vim ~/.bashrc

添加:

export MPICH=$HOME/mpich-install
export PATH=$MPICH/bin:$PATH

(:wq退出vim)

令配置生效

# source ~/.bashrc
  1. 检验
# which mpicc

如果返回mpicc目录~/mpich-install/bin/mpicc,则安装成功

你可能感兴趣的:(linux)