续上篇

cd /home/share/
tar jxf openmpi-3.1.6.tar.bz2
cd openmpi-3.1.6
./configure prefix=/home/software/openmpi
make -j4 && make install

vi /home/software/modules/openmpi
#内容根据自己的安装环境自行编辑
module add openmpi

测试:
which mpicc
cd /home/share/openmpi-3.1.6/examples/
mpicc -o hello_c hello_c.c
mpirun -n 4 ./hello_c
mpirun --allow-run-as-root -n 4 ./hello_c
module purge

12-26 13:32