Recommended Intel Compiler Options

Article ID: 99
Last updated: 14 Jan, 2026

Intel compilers are recommended for building your applications on HECC systems with Intel x86-64 CPUs. There is no default compiler—you must load a specific module. To see what modules are available, run the module avail command:

pfe21% module avail

To load a specific version, replace version in the command below with the actual version number:

pfe21% module load comp-intel/version

Some important compiler flags to keep in mind are described in the following sections.

Note: Most of the flags described in this article apply to both the Intel classic compilers and the Intel LLVM-based compilers.

Turn On Optimization

If you do not specify an optimization level (-On, n=0,1,2,3), the default is -O2. If you want more aggressive optimizations, you can use -O3.

Note: Using -O3 may not improve performance for some programs.

Generate Optimized Code for a Processor Type

Intel compilers provide flags for generating optimized codes for various instruction sets used in specific processors or micro-architectures. If your goal is to achieve the best performance from a specific processor, we recommend that you build your application using the latest Intel compiler with the flag that corresponds with the processor you plan to use:

Processor Type System Flag
Cascade Lake Aitken/Endeavour -xCORE-AVX512
Skylake Electra
Broadwell Electra
Pleiades (Retired)
-xCORE-AVX2
Haswell Pleiades (Retired)
Ivy Bridge Pleiades (Retired) -xAVX
Sandy Bridge Pleiades (Retired)

Note: The instruction sets are upward compatible, therefore, applications compiled with:

  • -xAVX can run on Sandy Bridge, Ivy Bridge, Haswell, Broadwell, Skylake, and Cascade Lake processors.
  • -xCORE-AVX2 can run on Haswell, Broadwell, Skylake, and Cascade Lake processors.
  • -xCORE-AVX512 can run only on Skylake and Cascade Lake processors.
WARNING: Executables built with a flag that is not compatible with a processor will not run on that processor, and will result in an error with a message similar to the following:
Fatal Error: This program was not built to run in your system. Please verify that both the operating system and the processor support Intel(R) AVX2 

AMD processors: See Preparing to Run on Aitken Rome Nodes for information about compilers to use for Rome processors. See Preparing to Run on Aitken Milan Nodes for information about compilers to use for Milan processors.

Generate Code for Any Processor Type

If your goal is to create a portable executable file that can run on any processor type on Electra, Aitken, and Endeavour, you can choose one of the following approaches:

  • Use none of the above flags (which defaults to -mSSE2)
  • Use -O3 -axCORE-AVX512,CORE-AVX2 -xAVX (with the latest Intel compiler)

This allows a single executable that will run on any of the processor types, with suitable optimization to be determined at run time.

WARNING: Be careful if you plan to add the -Ofast flag, which sets -xHost (and other options) automatically during compilation. If you place Ofast after -axCORE-AVX512,CORE-AVX2 -xAVX, -xHost takes precedence over -axCORE-AVX512,CORE-AVX2 -xAVX, and the executable is generated for the compilation host processor.

Turn On Inlining

Use the -ip or -ipo flags.

Using -ip enables additional interprocedural (IP) optimizations for single-file compilation. One of these optimizations enables the compiler to perform inline function expansion for calls to functions defined within the current source file.

Using -ipo enables multi-file IP optimizations between files. When you specify this option, the compiler performs inline function expansion for calls to functions defined in separate files.

Use a Specific Memory Model

If you get a link time error relating to R_X86_64_PC32, add the compiler option -mcmodel=medium and the link option -shared-intel. This happens if a common block is more than 2 GB in size.

Turn Off All Warning Messages

Using the -w option disables all warnings, and -qopt-report=0 disables printing of optimization reports.

Parallelize Your Code

The -qopenmp option handles OMP directives and -parallel looks for loops to parallelize.

Note: The -parallel option is available in the Intel 2025 release of ifx, but not in the 2023 release of ifx.

For more compiler/linker options, see man ifort, man icc, man ifx, man icx.

Debugging Options

See Recommended Intel Compiler Debugging Options for descriptions of several more compiler flags.

Also read

Contact Us

General User Assistance

Security

  • Report security issues 24x7x365
  • Toll-free: 1-877-NASA-SEC (1-877-627-2732)
  • E-mail: soc@nasa.gov

User Documentation

High-End Computing Capability (HECC) Portfolio Office

NASA High-End Computing Program

Tell Us About It

Our goal is furnish all the information you need to efficiently and effectively use the HECC resources needed for your NASA computational projects.

We welcome your input on features and topics that you would like to see included on this website.

Please send us email with your wish list and other feedback.