1. 程式人生 > >安裝openmpi-3.1.0

安裝openmpi-3.1.0

OpenMPI

1.確認以下編譯器已安裝:

yum install gcc

gcc –version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

g++ --version
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28)

Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

python --version

Python 2.7.5

建議去官方網站下載最新版本:http://www.open-mpi.org
2.下載(默認至當前用戶的Downloads目錄下)
URL: http://www.open-mpi.org

https://download.open-mpi.org/release/open-mpi/v3.1/openmpi-3.1.0.tar.gz

目前版本:openmpi-3.1.0.tar.gz
3.解壓openMPI安裝文件,放在當前用戶目錄下:
tar zxvf openmpi-3.1.0.tar.gz
4.進入安裝文件目錄
cd openmpi-3.1.0
5.安裝openMPI(默認至目錄:/usr/local/lib):
./configure
6.安裝所有需要的文件:
sudo make all install
7.添加庫共享路徑:
sudo gedit /etc/profile
在profile文件的最後加上一行:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

8.使該配置文件生效:
source /etc/profile
9.進行測試:
要使用普通用戶執行
cd openmpi-3.1.0/examples
make
$mpirun -np 4 hello_c

查看OpenMPI的信息

ompi_info

安裝openmpi-3.1.0