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.
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
For users building C++11 codes on Hopper or 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 the 'gcc' compiler module in order to make these available. Loading the current default version of the gcc module (gcc/4.9.2) should suffice.
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 firstname.lastname@example.org.
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.