OpenMpi and mpi4py install on ubuntu

OpenMPI

in here XXX is you computer name
mkdir /home/XXX/Software/openmpi
cd  /home/XXX/Software/openmpi
wget http://www.open-mpi.org/software/ompi/v1.4/downloads/openmpi-1.4.1.tar.gz
tar xzvf openmpi-1.4.1.tar.gz
mkdir openmpi
cd openmpi-1.4.1
./configure --prefix =  /home/XXX/Software/openmpi/openmpi
make all install
then cd ..
cd openmpi

這時候此目錄下有bin ,lib,local....等文件夾.

in ~/.profile中加入環境變量
export PATH=/home//home/zhb/install/openmpi/bin:$PATH
export LD_LIBRARY=/home/zhb/install/openmpi/lib:$LD_LIBRARY
last:
source ~/.profile

end openmpi

mpi4py

在mpi4py网址下载mpi4py源码,然后在shell中执行

tar -zxvf mpi4py.zip
cd mpi4py dir
因爲我用conda中python3的環境安裝
故 conda activate, 啓動base environment in anaconda,
the version of python is 3.6
then 
$ python setup.py build
no error then
$ *python setup.py install*一般我不用這個方式,爲了卸載方便,加上參數,--record,記錄下做了什麼操作,即:
$ **python ./setup.py install --record install.txt**
要卸載setup.py安裝的軟件包時,只需要
cat install.txt | xargs rm -rf
or you are only user not root, you can directely use
IN THE tiger Cluster:
$ python setup.py install --user --record install.txt

你可能感兴趣的:(OpenMpi and mpi4py install on ubuntu)