Get open-mpi from https://www.open-mpi.org/
I downloaded openmpi-4.1.2
$ wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.2.tar.gz
Expand files
$ tar xzvf openmpi-4.1.2.tar.gz
$ cd openmpi-4.1.2
Specify the installation location and compiler.
You don’t have administrative privileges to /usr/local, so I set path like /home/
$ ./configure --prefix=<path-to-install>/openmpi-4.1.2 CC=gcc CXX=g++ FC=gfortran
Build
$ make all
$ make install
Open ~/.bashrc and add like this.
MPIROOT=<path-to-install>
PATH=$MPIROOT/bin:$PATH
LD_LIBRARY_PATH=$MPIROOT/lib:$LD_LIBRARY_PATH
MANPATH=$MPIROOT/share/man:$MANPATH
export MPIROOT PATH LD_LIBRARY_PATH MANPATH
Load bashrc
$ source ~/.bashrc
Make sure the compiler PATH is created.
$ which mpic++
=> <path-to-install>/bin/mpic++