Compilation Guide

As a general recommendation, we suggest selecting the newest compilers available for a new project. For repeatability, you may not want to change compilers in the middle of an experiment.


Oakley

We recommend the Intel compilers on Oakley.

Intel

Compilers

  non-MPI MPI
Fortran ifort mpif90
C icc mpicc
C++ icpc mpicxx

Recommended optimization options – not portable (run on Oakley only)

Sequential, not numerically sensitive -fast
Sequential, numerically sensitive -ipo -O2 -static -xHost
MPI, not numerically sensitive -ipo -O3 -no-prec-div -xHost
MPI, numerically sensitive -ipo -O2 -xHost
Note:  The -fast flag is equivalent to -ipo -O3 -no-prec-div -static -xHost

Recommended optimization options – portable (run on Oakley or Glenn)

Sequential, not numerically sensitive -ipo -O3 -no-prec-div –static –axSSE4.2
Sequential, numerically sensitive -ipo -O2 -static –axSSE4.2
Note:  MPI code must be built on the system where it will be run.
Note:  Other options are available for code with extreme numerical sensitivity; their description is beyond the scope of this guide.
Note:  Intel 14.0.0.080 has a bug related to generation of portable code. Add the flag -msse3 to get around it.

OpenMP

Add this flag to any of the above:

-openmp


PGI

Compilers

  non-MPI MPI
Fortran 90 or 95 pgfortran or pgf90 mpif90
Fortran 77 pgf77 mpif77
C pgcc mpicc
C++ pgCC mpicxx

Recommended optimization options

The -fast option is appropriate with all PGI compilers:

-fast
Note:  The PGI compilers can generate code for accelerators such as GPUs. Description of these capabilities is beyond the scope of this guide.
Note:  Many other options are available. See the “man” pages for the compilers.

OpenMP

Add this flag to any of the above:

-mp

GNU

Compilers

  non-MPI MPI
Fortran 90 or 95 gfortran mpif90
Fortran 77 g77 mpif77
C gcc mpicc
C++ g++ mpicxx

Recommended optimization options

The following option is recommended with the gnu compilers:

-O3 -march=native

 

Note:  Many other options are available. See the “man” pages.

OpenMP

Add this flag to any of the above (except g77 and mpif77):

-fopenmp

Glenn

PGI

Compilers

  non-MPI MPI
Fortran 90 or 95 pgfortran or pgf90 mpif90
Fortran 77 pgf77 mpif77
C pgcc mpicc
C++ pgCC mpicxx

Recommended optimization options

The -fast option is appropriate with all PGI compilers:

-fast
Note:  The PGI compilers can generate code for accelerators such as GPUs. Description of these capabilities is beyond the scope of this guide.
Note:  Many other options are available. See the “man” pages for the compilers.

OpenMP

Add this flag to any of the above:

-mp

Intel

Compilers

  non-MPI MPI
Fortran ifort mpif90
C icc mpicc
C++ icpc mpicxx

Recommended optimization options

The following option is recommended with the Intel compilers on Glenn:

-O2

OpenMP

Add this flag to any of the above:

-openmp

GNU

Compilers

  non-MPI MPI
Fortran 90 or 95 gfortran mpif90
Fortran 77 g77 mpif77
C gcc mpicc
C++ g++ mpicxx

Recommended optimization options

The following option is recommended with the gnu compilers:

-O3
Note:  Many other options are available. See the “man” pages.

OpenMP

Add this flag to any of the above (except g77 and mpif77):

-fopenmp
Supercomputer: 
Technologies: 
Fields of Science: