stacpolly Compilers

The Intel compilers provide superior performance.

The GNU compilers maximise portability.

Intel Compilers

We have licenses for the intel compiler suite, V11.0, for:

icc
C compiler
icpc
C++ compiler
ifort
Fortran 77/90/95 compiler

Configuration

To configure your environment to use the Intel compilers, add to your .tcshrc/.cshrc/.login file:

source /opt/intel/cce/10.1.015/bin/iccvars.csh
source /opt/intel/fce/10.1.015/bin/ifortvars.csh

Note that this will set up environment variables that can conlict with the GCC compiler suite. In particular, you may get errors that you are attempting to use math.h supplied by Intel. To fix this:

unsetenv INCLUDE
unsetenv CPATH

Compiler Flags

Various flags that might be useful:

-m32 or -m64
32-bit or 64-bit. 64-bit isn't automatically faster. If the problem can always be contained in 32-bit space, -m32 is faster because the cache is better used. If the problem requires 64-bit integers for array access, then -m64 will be faster.
32-bit libraries must be linked to 32-bit libraries.
64-bit libraries must be linked to 64-bit libraries.
Hint: if your indices exceed 2 billion, then use 64-bit.

-fast
Tunes for the host machine

-xSSE4.1
Tunes for the Xeon E5430 CPU

-fPIC
Produce position-independent code. Not always useful. Sometime necessary.

-parallel
Automatically parallelise code, when possible. Not the same thing as parallelising with OpenMP or MPI. Generally not as powerfull as it may suggest.

-funroll-all-loops
Unrolls loops which makes for bigger code, but faster as well.

-fast
An alternative to -O2 or -O3 that optimises heavily. But not necessarily faster nor safer.

Recommended compiler flags

-fast -m64 -O3 -parallel -funroll-all-loops

GNU Compilers

Version 4.3.2 of the GNU Compilers are available.

gcc
C compiler
g++
C++ compiler
gfortran
Fortran 77/90/95 compiler

Recommended compiler flags

-march=native -mfpmath=sse,387 -m64 -fPIC -O3 -ftree-vectorize -funroll-loops -msse4.1