Compilers
Compiling MPI Applications
Open MPI
The Open MPI compiler wrapper scripts listed in the table below add in all relevant compiler and link flags, and then invoke the underlying compiler, i.e. the compiler that the Open MPI installation was built with.
Language |
Wrapper script |
Default compiler |
Environment variable |
---|---|---|---|
C |
|
|
|
C++ |
|
|
|
Fortran |
|
|
|
It is possible to change the underlying compiler that is 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.
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 |
|
|
|
|
C |
|
|
|
|
C |
|
|
|
|
C++ |
|
|
|
|
C++ |
|
|
|
|
C++ |
|
|
|
|
Fortran |
|
|
|
|
Fortran |
|
|
|
|
Fortran |
|
|
|
|
Specify option -show
with one of the compiler wrapper scripts to see the underlying compiler together with compiler options, link flags and libraries.
Example: use the available MPI C wrapper command before the Intel oneAPI 2023.2 release but with the LLVM based compiler
$ module load intel/2022a
$ mpiicc -cc=icx mpi_hello_world.c
Notice, the Intel Compiler Classic drivers commands icc
and icpc
have been removed since the Intel oneAPI 2024.0 release (i.e. 2024 toolchains for NRIS clusters). Use the LLVM-based Intel Compiler drivers icx
and icpx
instead, for more information see the Porting Guide for ICC Users to DPCPP or ICX.
The Classic ifort
command will be discontinued in the oneAPI 2025 release. Use LLVM-based Intel Compiler driver ifx
instead, for more information see the Porting Guide for ifort Users to ifx..
See also Running MPI Applications.