Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 11/07/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Predefined Preprocessor Symbols

Preprocessor symbols (macros) let you substitute values in a program before it is compiled. The substitution is performed in the preprocessing phase.

The preprocessor symbols shown in the table below are predefined by the compiler system and are available to compiler directives and to fpp. If you want to use other symbol names, you need to specify them on the command line.

You can use the D compiler option to define the symbol names to be used during preprocessing. This option performs the same function as the #define preprocessor directive.

Preprocessing with fpp replaces every occurrence of the defined symbol name with the specified value. Preprocessing compiler directives only allow IF and IF DEFINED.

If you want to disable symbol replacement (also known as macro expansion) during the preprocessor step, you can specify the macro=no preprocessor option for fpp.

Disabling preprocessor symbol replacement is useful for running fpp to perform conditional compilation (using #ifdef, etc.) without replacement.

You can use the U preprocessor option to suppress an automatic definition of a preprocessor symbol. This option suppresses any symbol definition currently in effect for the specified name. This option also performs the same function as an #undef preprocessor directive.

The symbols in the following table can be used in both fpp and Fortran compiler conditional compilations. IA-32 is deprecated and will be removed in a future release.

Symbol OS Support Description

__amd64

__amd64__

Linux

Defined as 1.

__AVX512BW__

Linux

Windows

Defined as 1 for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Byte and Word Instructions (BWI).

__AVX512BW__ is also defined as 1 when option [Q]xCORE-AVX512 or higher processor-targeting options are specified.

__AVX512CD__

Linux

Windows

Defined as 1 for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Conflict Detection Instructions (CDI).

__AVX512CD__ is also defined as 1 when option [Q]xCORE-AVX512, [Q]xCOMMON-AVX512, or higher processor-targeting options are specified.

__AVX512DQ__

Linux

Windows

Defined as 1 for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Doubleword and Quadword Instructions (DQI).

__AVX512DQ__ is also defined as 1 when option [Q]xCORE-AVX512 or higher processor-targeting options are specified.

__AVX512ER__

Linux

Windows

Defined as 1 for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Exponential and Reciprocal Instructions.

__AVX512F__

Linux

Windows

Defined as 1 for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Foundation instructions.

__AVX512ER__ is also defined as 1 when option [Q]xCORE-AVX512, [Q]xCOMMON-AVX512, or higher processor-targeting options are specified.

__AVX512PF__

Linux

Windows

Defined as 1 for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) PreFetch Instructions (PFI).

__AVX512VL__

Linux

Windows

Defined as 1 for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Vector Length Extensions (VLE).

It is also defined as 1 when option [Q]xCORE-AVX512 or higher processor-targeting options are specified.

_DEBUG

Windows

Defined as 1 only if option dbglibs, MT[d], or MD[d] is specified.

_DLL

Windows

Defined as 1 only if one of the following options is specified or implied:

  • libs:dll

  • MD

  • MDd

  • MDs

__ELF__

Linux

Defined as 1 at the start of compilation.

__gnu_linux__

Linux

Defined as 1 at the start of compilation.

__i386__

__i386

i386

Linux

Defined as 1 for compilations targeting IA-32 architecture (C++ only).

This symbol is only available for ifort.

IA-32 is deprecated and will be removed in a future release.

__INTEL_COMPILER

Linux

Windows

ifx: The version of the compiler in the form VVVVMMUU, where VVVV is the major release version, MM is the minor release version, and UU is the update number. For example, Version 2023.1.2 is indicated by a value of 20230102. See also symbol __INTEL_LLVM_COMPILER.

ifort: The version of the compiler in the form VVVV, where VVVV is the major version. For example, Version 2021.1.2 is indicated by a value of 2021.

__INTEL_COMPILER_BUILD_DATE

Linux

Windows

The compiler build date. It takes the form YYYYMMDD, where YYYY is the year, MM is the month, and DD is the day.

__INTEL_COMPILER_UPDATE

Linux

Windows

The compiler update number within a version (example: 1 for Update 1). See also symbol __INTEL_COMPILER.

__INTEL_LLVM_COMPILER

Linux

Windows

The version of the compiler in the form VVVVMMUU 1, where VVVV is the major release version, MM is the minor release version, and UU is the update number. For example, the base release of 2023.1 is represented by the value 20230100.

This symbol is also recognized by CMake, and it is only available for ifx.

__INTEL_LLVM_COMPILER_UPDATE

Linux

Windows

The compiler update number within a version (example: 1 for Update 1).

This symbol is only available for ifx.

See also symbol __INTEL_LLVM_COMPILER.

__linux__

__linux

linux

Linux

Defined as 1 at the start of compilation.

_M_AMD64

Windows

Defined as 1.

_M_X64

Windows

Defined as 100.

_MT

Windows

Defined as 1 when option /threads or /MT is specified.

_OPENMP

Linux

Windows

Defined when OpenMP processing has been requested (that is, option [q or Q]openmp has been specified along with option fpp).

The default is 201811 when you specify option [q or Q]openmp.

The value takes the form YYYYMM, where YYYY is the year and MM is the month of the supported OpenMP Fortran specification.

The currently supported OpenMP API is 5.0 Version TR4, dated November 2016. Some OpenMP Version 5.1 features are also supported.

__PIC__

__pic__

Linux

Defined as 1 only if the code requested compilation as position-independent code.

unix

__unix

__unix__

Linux

Defined as 1.

_WIN32

Windows

Defined as 1.

_WIN64

Windows

Defined as 1.

__x86_64

__x86_64__

Linux

Defined as 1.

Footnotes:

1 The 2021.1 Intel® Fortran Compiler (ifx) produces the __INTEL_COMPILER format for this macro. Subsequent releases use the format as documented.

See Also