Intel Compilers

Intel's compilers are installed in /software/intel (older versions) and /software/apps/intel. We do not recommend that you source the normal compiler initialization scripts named or similar. Instead, just load the corresponding compiler module, and everything gets set up correctly.

module load intel/

The compilers for different programming languages are named as follows:

Language Command
C icc
C++ icpc
Fortran90+ ifort (.f90 files)
Fortran77 ifort (.f files)

How to use

Suppose you have a file myprogram.f90 that you want to compile. Do like this:

ifort -o myprogram.exe myprogram.f90

That will produce the executable myprogram.exe with optimization level -O2 (see more below). If your program uses BLAS, LAPACK, or FFTW, we recommend using the subroutines included in Intel's Math Kernel Library:

ifort -o myprogram.exe -Nmkl -mkl=sequential myprogram.f90

The -Nmkl flag is specific to NSC and links your program permanently against the currently loaded Intel MKL module, the other flag -mkl=sequential is specific to Intel's compilers and assembles the right combination of libraries necessary for single-threaded MKL linking. More information about using MKL and the other math libraries at NSC is available in the math libraries page.

Code optimization flags

Intel's compiler have many options and compiler flags for optimization. Some of them are very aggressive and can lead instability and/or crashes when applied on fragile code. We have often seen that high optimization can uncover silent bugs in the code, often as a result of the program relying on undefined Fortran or C behavior. We recommend trying these compiler flags as a start:

System Flags
Bi/Frost -O2 -ip -xCORE-AVX2
Triolith -O2 -ip -xavx
Gamma -O2 -ip -xavx

If you experience crashes, it is always worth trying to recompile with lower optimization (-O1) or no optimization at all (-O0). That will tell you whether you hit a bug related to aggressive compiler optimization. Please note that the default optimization level is -O2, unlike other compilers such as GCC, so you have to explicitly state that you want lower optimization.

C++ 11/14/17 support

C++ standard library support: Intel C/C++ relies on GCC's libstdc++, which is provided by the Linux system software. On most of our systems, that is libstdc++ corresponding to GCC 4.4, which is rather old. It is possible, however, to instruct the compiler to use a more recent version of libstd++. For example, to use the version supplied with GCC 4.9.0, you can call the compiler like this:

icpc -o myprogram -std=c++11 -cxxlib=/software/apps/gcc/4.9.0/build01/ -gxx-name=g++.orig myprogram.cpp

This will link the C++ program with the standard library from GCC 4.9.0.

Please check the following documents for the current status for different compiler versions:

Online documentation

(much more is available on the Intel web site)

Fortran compiler:

C/C++ compiler:

It is strongly recommended for people who are heavy users of the compilers to check the release notes regularly. There are also a lists of bug fixes and issues for each version:

User Area

User support

Guides, documentation and FAQ.

Getting access

Applying for projects and login accounts.

System status

Everything OK!

No reported problems


NSC Express