Intel (Fortran, C, and C++)
The Intel® compiler suite offers C, C++ and Fortran compilers with optimization features and multithreading capabilities, highly optimized performance libraries, and error-checking, security, and profiling tools. NERSC Intel compiler bugs are listed at Intel bugs.
The Intel compiler suite is available on Edison, Carver, and Hopper. It is the default compiler on Edison.
Using the Intel Compilers on Edison
The Intel compiler suite is the default on Edison. When you use the Cray ftn, cc, and CC wrappers, they will call the Intel compilers.
You can (and should) have the Intel compiler emit information about vectorization when you compile. Use the "-vec-report3" compiler option to send the output to the terminal or add "-opt-report-file=filename" to send the output to a file.
One additional note for users building C++11 codes on Edison using the Intel compilers: Because the installed Intel compilers rely on the GNU header files for C++11 support, you will need to load one of the 4.8.x series gcc compiler modules in order to make these available - for example, gcc/4.8.2 (for now, avoid 4.9.x if using the default Intel 14.x series compilers).
Using the Intel Compilers on Carver
To use the Intel compilers you must swap both the compiler and the OpenMPI modulefiles. Do this in the following way:
% module unload pgi openmpi
% module load intel openmpi-intel
After doing this use the OpenMPI wrappers mpif90, mpicc, or mpiCC. To use the mkl math library with the intel compiler add the argument "-mkl=cluster" as the last argument on the link line.
Using the Intel Compilers on Hopper
To use the Intel compilers you must swap the PrgEnv-xxx modulefile:
% module swap PrgEnv-pgi PrgEnv-intel
After doing this use the Cray compiler wrappers ftn, cc, or CC. More information can be found in Intel Compilers on Hopper.
Tips for Building Applications
Edison and Hopper
Always use -no-ipo if you use -fast unless you are completely positive that your code would benefit from interprocedural analysis. In that case expect a much longer compilation time.
If you build a library always use -no-ipo if you use -fast, otherwise the build will fail. If you still have problems with the library with -fast -no-ipo, build it with the Intel default, no optimization options.
The -fast option does not work with MPI codes on Carver. They may appear to build successfully, but will fail at run time. NERSC recommends that codes should be compiled with no optimization arguments, as Intel provides a very high level of optimization by default.
For questions about using the Intel compilers at NERSC contact the consultants at email@example.com.
Man pages are available via man ifort (for Fortran) or man icc (for C/C++) when the intel module is loaded. There are User Guides, language Reference Manuals, and Quick-Reference Guides to Optimization available on the Intel web site.