skip to primary navigationskip to content
 

Compilers

There are both GNU and Intel compilers on Darwin (in several versions depending on the currently loaded modules. The following table summarises the available compiler commands on the cluster:

Language GNU Intel
C gcc icc
C++ g++ icc
Fortran77 gfortran ifort
Fortran90 gfortran ifort
Fortran95 gfortran ifort
Recommended optimisation flag -O3 -O3 -ipo -xHost

 

For best performance, use of the Intel compilers is recommended. Please see the online documentation for the Intel compilers and the Math Kernel library. For more information about optimisation for GNU, please refer to the respective man and info pages (or here).

The commands referred to above should be used directly for single processor or OpenMP parallel applications. For MPI parallel applications it is preferable to use the MPI-specific wrappers which automatically locate the correct MPI header and library files. These wrappers are available in the default user environment and are:

Language C Fortran77 F90 C++
Command mpicc mpif77 mpif90 mpicxx

These commands are wrappers around the Intel compilers (unless overridden, see below) and ensure that the correct MPI include and library files are used. Since they are wrappers, the same optimisation flags can be used as with the standard Intel compilers.

Typically, applications use a Makefile that has to be adapted for compilation. (Please refer to the application's documentation in order to adapt the Makefile for a Linux/x86_64 cluster.) Frequently, it is sufficient to choose a Makefile specifically for a Linux MPI environment and to adapt the CC & FC parameters in the Makefile, which should point to mpicc and mpif77 (or mpif90 in the case of Fortran90 code) respectively.

By default mpicc/mpif77 etc use the Intel compilers. To use another compiler, e.g. the GNU compiler, the following flags will override the default behaviour:

mpicc  -cc=gcc
mpif77 -fc=gfortran
mpif90 -f90=gfortran
mpicxx  -cxx=g++