|
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:
To load a specific version, replace version in the command below with the actual version number:
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 OptimizationIf 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 TypeIntel 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:
Note: The instruction sets are upward compatible, therefore, applications compiled with:
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 TypeIf 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:
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 InliningUse 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 ModelIf 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 MessagesUsing the -w option disables all warnings, and -qopt-report=0 disables printing of optimization reports. Parallelize Your CodeThe -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 OptionsSee Recommended Intel Compiler Debugging Options for descriptions of several more compiler flags.
Also read
|