Intel® Fortran Compiler 16.0 User and Reference Guide

Using 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 the fpp compiler option.

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 performs the same function as an #undef preprocessor directive.

The symbols in the following table can be used in both fpp and the Fortran compiler conditional compilations.

Symbol Description

__APPLE__

(OS X*)

Defined as '1'.

__AVX512BW__

(Windows, Linux, OS X)

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

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

__AVX512CD__

(Windows, Linux, OS X)

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

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

__AVX512DQ__

(Windows, Linux, OS X)

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

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

__AVX512ER__

(Windows, Linux, OS X)

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

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

__AVX512F__

(Windows, Linux, OS X)

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

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

__AVX512PF__

(Windows, Linux, OS X)

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

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

__AVX512VL__

(Windows, Linux, OS X)

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

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 options /dbglibs, /MT[d], or /MD[d] are 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.

__INTEL_COMPILER

(Windows, Linux, OS X)

The Intel compiler version in the form VVSS, where VV is the major version and SS is the minor version. For example, Version 16.0 is indicated by a value of 1600.

__INTEL_COMPILER_BUILD_DATE

(Windows, Linux, OS X)

The Intel 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

(Windows, Linux)

The Intel compiler update number within a version (such as 1 for Update 1, etc.). See also symbol __INTEL_COMPILER.

__INTEL_OFFLOAD

(Windows, Linux)

Defined as '1' while building code to run on the CPU and on the coprocessor.

It is defined by default. It is undefined when you specify the negative form of option [q or Q]offload, or option /Qmic (Windows*) or -mmic (Linux*).

You can use this symbol in conjunction with the negative form of option [q or Q]offload, or the /Qmic (Windows*) or -mmic (Linux*) option to protect code on the host that should only be executed for an offload build, such as calls to the omp_set_num_threads_target family of APIs in mic_lib.f90.

__KNC__

(Windows, Linux)

Defined as '1' while building code to run on the Intel® Xeon Phi™ coprocessor x100 product family (formerly code name Knights Corner).

It is also defined as '1' when you specify option /Qmic (Windows*) or -mmic (Linux*).

It is undefined when you use the negative form of option [q or Q]offload.

__linux__

__linux

linux

(Linux)

Defined as '1' at the start of compilation.

_M_AMD64

(Windows)

Defined as '1' while building code targeting Intel® 64 architecture.

_M_IX86=700

(Windows)

Defined as '1' while building code targeting IA-32 architecture.

_M_X64

(Windows)

Defined as '1' while building code targeting Intel® 64 architecture.

__MACH__

(OS X)

Defined as '1'.

__MIC__

(Windows, Linux)

Defined as '1' while building code to run on the Intel® MIC Architecture coprocessor. It is defined by default during the coprocessor compilation.

It is also defined as '1' when you specify option /Qmic (Windows*) or -mmic (Linux*) since that option tells the compiler to build an application that runs natively on Intel® MIC Architecture.

It is undefined when you use the negative form of option [q or Q]offload.

You can specify this symbol to protect code that should only be compiled for and executed on the coprocessor.

_MT

(Windows)

Defined as '1' only if option /threads or /MT is specified.

_OPENMP=201511

(Windows, Linux, OS X)

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

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 version 4.5, dated November-2015.

__PIC__

__pic__

(Linux)

Defined as '1' only if the code was requested to be compiled as position-independent code.

__TARGET_ARCH_MIC

(Windows, Linux)

Defined as '1' when building code to run on theIntel® Xeon Phi™ coprocessor (code name Knights Landing) during offload compilation. It is defined by default when you specify -qoffload-arch=mic-avx512 (Linux) or /Qoffload-arch=mic-avx512 (Windows*).

You can specify this symbol to protect code that should only be compiled for and executed on the Intel® Xeon Phi™ coprocessor (code name Knights Landing) during offloading.

_WIN32

(Windows)

Defined as '1' while building code targeting IA-32 or Intel® 64 architecture.

_WIN64

(Windows)

Defined as '1' while building code targeting Intel® 64 architecture.

__x86_64

__x86_64__

(Linux)

Defined as '1' while building code targeting Intel® 64 architecture.

See Also