stacpolly Compilers

The Intel compilers provide superior performance.

The GNU compilers maximize portability.

Intel Compilers

We have licenses for the intel compiler suite, V2013.1.117, for:

C compiler
C++ compiler
Fortran 77/90/95 compiler


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

source /home/ert/local/Intel/bin/compilervars.csh intel64
To use my Intel-compiled tools (HDF5, FFTW-2.15, OpenMPI, GSL), be aware of the following paths and set them where appropriate for runtime access, compilation includes, compilation linkage, and run-time linkage:

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.

Tunes for the host machine

Tunes for the Xeon E5430 CPU

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

Automatically parallelize code, when possible. Not the same thing as parallelizing with OpenMP or MPI. Generally not as powerful as it may suggest.

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

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

Recommended compiler flags

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

GNU Compilers

Version 4.7.2 of the GNU Compilers are available.

C compiler
C++ compiler
Fortran 77/90/95 compiler

Recommended compiler flags

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