Underworld

a long term geodynamics simulation platform

OpenMPI Download and Installation


Downloading and Installing OpenMPI using MacPorts (mac only)

Note: If you intend to use Macports packages to install the dependencies required by Underworld and gLucifer, we recommend you use Macports for all dependencies (except PETSc). This will avoid problems of confusion between Macports-installed and default system libraries such as X11, which can cause run-time issues.

Type the following (from any directory, assuming you have MacPorts in your path):

port install openmpi


Downloading and Installing OpenMPI Manually

These instructions apply to any Linux, Unix or Mac operating system.

The OpenMPI package can be downloaded from here.

Untar and unzip the downloaded file. For example:

tar zxvf openmpi-1.4.4.tar.gz

Then navigate into the unzipped directory and type the following, where:

  • /usr/local/opemmpi is the location in which you would like to install OpenMPI (root or administrator access may be required; on macs type "sudo make install" in place of the "make install" step)
  • on 64 bit machines, add the following flags, which ensure that you pass the -m64 flag to gcc and g++ during the build phase and also that the mpicc wrapper knows to use -m64 when it compiles your code later: CFLAGS=-m64 CXXFLAGS=-m64 --with-wrapper-cflags=-m64 --with-wrapper-cxxflags=-m64
./configure --prefix=/usr/local/openmpi
make
make install


Setting up Environment Variables

Add the following environment variable to your ~/.bashrc (if you are using bash) or ~/.tcshrc (if you are using tcsh), where /usr/local is the installation directory:

bash:

export MPI_DIR=/usr/local/openmpi

tcsh:

setenv MPI_DIR /usr/local/openmpi


Adding OpenMPI to your Path

You will also need to add OpenMPI to your path. To view your PATH, type the following:

echo $PATH

This will probably look something like PATH=/usr/bin:/bin:/usr/local/bin, which is a list of ':' separated directories of where commands can be executed from without typing the full path. To add OpenMPI to your path add the following to your ~/.bashrc or ~/.tcshrc file (where /usr/local/openmpi is the path where your MPI implementation was installed):

linux:

export PATH=/usr/local/openmpi/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/openmpi/lib:$LD_LIBRARY_PATH

macs:

export PATH=/usr/local/openmpi/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/openmpi/lib:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH


You have now completed MPI Implementation.


-- Jerico Revote - 13 September 2011
-- Wendy Mason - 28 October 2010
-- Patrick Sunter - 21 October 2010
-- Wendy Sharples - 21 October 2010
-- Alan Lo - 25 Jan 2006