Compilers

Compiling MPI Applications

Intel MPI

The following table shows available Intel MPI compiler commands, the underlying Intel and GNU compilers, and ways to override underlying compilers with environment variables or command line options:

Language Wrapper script Default compiler Environment variable Command line
C mpiicc icc I_MPI_CC -cc=<compiler>
mpigcc gcc
C++ mpiicpc icpc I_MPI_CXX -cxx=<compiler>
mpigxx g++
Fortran mpiifort ifort I_MPI_FC -fc=<compiler>
mpifc gfortran

Specify option -show with one of the compiler wrapper scripts to see the underlying compiler together with compiler options, link flags and libraries.

The Intel MPI toolchain is loaded by using module load:

module load intel/2017a

Please see also Running MPI Applications.

Open MPI

The Open MPI compiler wrapper scripts listed in the table below add in all relevant compiler and link flags, and the invoke the underlying compiler, i.e. the compiler the Open MPI installation was built with.

Language Wrapper script Environment variable
C mpicc OMPI_CC
C++ mpiCC, mpicxx, mpic++ OMPI_CXX
Fortran mpifort OMPI_FC

It is possible to change the underlying compiler invoked when calling the compiler wrappers using the environment variables listed in the table. Use the option -showme to see the underlying compiler, the compile and link flags, and the libraries that are linked.