A brief guide on installing OpenMPI from source code.
Download OpenMPI source code
Download the Open MPI release with the suffix .tar.gz from Open MPI’s Download page.
As far as the guide is written, the current stable release is openmpi-1.10.2.tar.gz.
Compile OpenMPI
-
Uncompress the source code tar package. You may need to change the version part in
openmpi-1.10.2to the version you have downloaded just now.$ tar xvzf openmpi-1.10.2.tar.gz $ cd openmpi-1.10.2 -
Compile Open MPI from source code.
# use flag --enable-static to enable .a file for Open MPI library $ ./configure --prefix=/absolute/path/to/install --enable-static $ make -
Install Open MPI.
$ make install -
Modify shell environment variables. We need to add the following environment variables to the shell environment setup script (
/etc/profilefor global install and~/.bashrcfor local install):export OMPI=/absolute/path/to/install export PATH=$PATH:$OMPI/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OMPI/bin -
Copy all files of
/absolute/path/to/installand/etc/profileor~/.bashrcto every node in the cluster. -
Done!