Ubuntu 16.04安装OpenMPI

Ubuntu 16.04安装OpenMPI环境

安装环境

  • Ubuntu 16.04
  • Intel(R) Core(TM) i7-6800K CPU @ 3.40GHz
  • openmpi-1.8.0

下载安装包

1
wget http://www.open-mpi.org/software/ompi/v1.8/downloads/openmpi-1.8.0.tar.gz

解压缩

1
2
tar zxvf openmpi-1.8.0.tar.gz
cd openmpi-1.8.0

配置安装文件

1
2
# 默认至目录:/usr/local/lib,可自定义安装目录,加参数--prefix="/usr/local/openmpi"
./configure --prefix="/usr/local/openmpi"

安装openMPI

1
2
sudo make
sudo make all install

配置环境变量

1
2
3
4
sudo gedit ~/.bashrc
# 在.bashrc文件的最后加上下面这行
export PATH=/usr/local/openmpi/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/openmpi/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

测试

1
2
3
cd openmpi-1.8.0/examples
make
mpirun -np 4 hello_c
作者

ChangingFond

发布于

2018-05-08

更新于

2018-05-10

许可协议

You need to set install_url to use ShareThis. Please set it in _config.yml.
You forgot to set the business or currency_code for Paypal. Please set it in _config.yml.

评论

You forgot to set the shortname for Disqus. Please set it in _config.yml.