Recent Linux distributions offer ready-to-use MPI-enabled compilers. Installing the relevant packages should provide you with an ‘
mpif90‘ executable, an ‘
mpirun‘ launcher, libraries etc, and you would not need to go through the instructions below (see A1 above instead).
If you want a different compiler, or if your distribution does not provide said package(s), follow these instructions:
- Install the Fortran compilers you want to use (
- Download OpenMPI from
www.open-mpi.org. (NB, we use OpenMPI in this example, but you can choose to use any other MPI implementation so long as it fully supports MPI-2 [LAM/MPI can not be used].).
- Extract from the archive and change into the newly created directory.
- Choose a directory for the installation. We will refer to this directory as (e.g. /opt/openmpi).
- For each compiler you want OpenMPI to work with, let:
<fc>= name of Fortran compiler binary,
<f77>= name of Fortran 77 compiler (may be the same as ),
<cc>= name of C compiler, and
<c++> = name of C++ compiler
<comp>= name under which we will refer to this setup.
(e.g., <fc>=<f77>=<comp>=ifort,<cc> =icc <c++>=icpc).
Configure OpenMPI with:
./configure CC=<cc> CXX=<c++> FC=<fc> F77=<f77> --prefix=<install-dir>/<comp>
sudo make install
Repeat this step with the next compiler.
- Add <install-dir>/<comp>/bin to your PATH, and <install-dir>/<comp>/lib
to your LD_LIBRARY_PATH. Use the compiler as mpif90 / mpicc.
- Refer to A2 above to set up CASINO for this compiler.
- To switch compilers, change your
CASINO_ARCH. Simple bash functions (which can be put in your
.bashrcfile) can be written to simplify this task.
← Frequently Asked Questions