The National Institute for Computational Sciences

Compiling on Nautilus

Nautilus was decommissioned on May 1, 2015. For more information, see Nautilus Decommission FAQs.

Compilers and PE Modules

Nautilus provides C, C++ and Fortran compilers from Intel, GNU and PGI, with Intel being the default. Special programming environment or PE modules are used to easily switch compilers. For instance to switch from Intel to GNU:

> module swap PE-intel PE-gnu

The PE modules take care of setting the appropriate compiler macros (e.g. CC and F90) as well as loading MPT, which is SGI's MPI implementation. For sanity, only one PE module can be loaded at a time. The following table shows the macros and executable names for the various compilers:

macro executable name
Intel GNU PGI
C CC icc gcc pgcc
C++ CXX icpc g++ pgCC
Fortran FC,F77,F90 ifort gfortran pgfortran,pgf77,pgf90

Explore the man pages of the respective compilers for complete lists of compiler options.

Libraries

MPI

MPI is provided on Nautilus by SGI's Message Passing Toolkit (MPT) which supports version 2.2 of the MPI standard as well as providing the SHMEM programming model. MPT is loaded by default with any of the PE modules. When compiling your MPI code, use the -lmpi linker flag, for example:
icc myprogram.c -o myprogram -lmpi

For C++ code, also include the -lmpi++ flag:

icpc  myprogram.c -o myprogram -lmpi++ -lmpi

OpenMP

OpenMP programs require certain compiler flags according to which compiler you are using:

compilerflag
Intel-openmp
GNU-fopenmp
PGI-mp

MKL

The Intel Math Kernel Library (MKL) is available for use with the Intel compilers. When compiling, specify the -mkl flag, for example:

icpc test.cpp -mkl