要设置Ubuntu中OpenMPI的环境变量,可以按照以下步骤操作:
nano ~/.bashrc
export PATH=/usr/lib/openmpi/bin:$PATH
export LD_LIBRARY_PATH=/usr/lib/openmpi/lib:$LD_LIBRARY_PATH
export MANPATH=/usr/lib/openmpi/share/man:$MANPATH
source ~/.bashrc
mpirun --version
这样就可以在Ubuntu中成功设置OpenMPI的环境变量。