Intel Compilers

Version
2021.2.0

Intel Compilers

The HPC and Spear provide the Intel C/C++ and Fortran Compilers. These are the compilers that most applications will wish to use.

Before using the Intel compilers or running batch jobs compiled with the Intel compiler, the intel module must be loaded. Use the following command:

$ module load intel

Supported Languages

Below are the compiler commands for C, C++, and Fortran, respectively:

C

$ icc

C++

$ icpc

Fortran

$ ifort

Intel Compiler Tips

  • To generate highly optimized code, try compiling with the -03 or -fast flags.
  • Add the -w flag to disable all warnings; use the -Wall flag to enable all warnings.
  • Add the -openmp flag to generate code based on OpenMP directives.
  • Add the -static flag to prevent linking with shared libraries (everything will be statically linked).

Debugging

The Intel compilers include a debugger:

$ gdb-ia

    More Information

    For a quick reference of how to use the Intel compiler, add the --help flag to any compiler command. For example:

    $ icc --help
    

    More detailed information is available on the compilers' respective manual pages. To access these pages, use the man command. For example:

    $ man icpc
    

    For a comprehensive guide to using the Intel compilers, please refer to the official documentation.