User and Reference Guide for the Intel® Fortran Compiler 14.0

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.

Some preprocessor symbols are predefined by the compiler system and are available to compiler directives and to fpp. If you want to use others, 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.

Symbol Description OS Supported

_DLL=1

Defined only with the following options:

  • /libs:dll

  • /MDs

  • /MD

  • /dll (or /LD)

Not defined with the /libs:static option.

Windows OS

__ELF__

Defined at the start of compilation

Linux OS

__gnu_linux__

Defined at the start of compilation

Linux OS

__i386__

__i386

i386

Builds the code only for the IA-32 architecture.

Linux OS

__INTEL_COMPILER_BUILD_DATE

YYYYMMDD

Linux OS

Windows OS

__INTEL_COMPILER_UPDATE=n

Identifies the current update number

Linux OS

Windows OS

__INTEL_OFFLOAD

This symbol is defined by the compiler when building code to run on the CPU and on the coprocessor. (Windows*, Linux*)

You can use this symbol in conjunction with the negative form of the [Q]offload compiler option, or the Qmic (Windows*) or mmic (Linux*) compiler 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.

Defined by default. Builds code that runs on the CPU and the coprocessor. Undefined when you use the negative form of the [Q]offload compiler option, or the Qmic (Windows*) or mmic (Linux*) compiler option.

__KNC__

This symbol is similar to __MIC__, but it is defined by the compiler while building code to run on the variant of the Intel® MIC Architecture known as the Intel® Xeon Phi™ coprocessor. (Windows*, Linux*)

__MIC__

This symbol is defined by the compiler while building code to run on the coprocessor. (Windows*, Linux*)

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

Defined by default. Builds code that runs on the CPU and the coprocessor, but this symbol is only defined during the coprocessor compilation. Undefined when you use the negative form of the [Q]offload option.

To build code that runs only on the coprocessor, use the Qmic (Windows*) or mmic (Linux*) compiler option.

This symbol is defined when you use Qmic (Windows*) or mmic (Linux*).

__linux__

__linux

linux

Defined at the start of compilation

Linux OS

_MT=1

Defined only if /threads or /MT is specified

Windows OS

_M_IX86=n00

Only for systems based on IA-32 architecture; n is the number specified for /G (for example, _M_IX86=700 for /G7)

Windows OS

_M_X64

Conditionalize the code for the Intel® 64 architecture.

Windows OS

_M_AMD64

Builds the code only for the Intel® 64 architecture. Set by default

Windows OS

_OPENMP=201307

Valid when OpenMP processing has been requested (that is, when /Qopenmp is specified) Takes the form YYYYMM where YYYY is the year and MM is the month of the OpenMP Fortran specification supported. This symbol can be used in both fpp and the Fortran compiler conditional compilations.

Windows OS

_OPENMP=YYYYMM

Specifies the OpenMP specification supported where YYYY is the year and MM is the month. Use for both fpp and the Fortran compiler conditional compilation.

Default: 201307

Requires the -openmp option.

Linux OS

__PIC__

__pic__

Set if the code was requested to be compiled as position independent code.

Linux OS

_WIN64

Only for systems based on Intel® 64 architecture

Windows OS

__x86_64

__x86_64__

Identifies the architecture for the target hardware for which programs are being compiled.

Only for systems based on Intel® 64 architecture

Linux OS

See Also


Submit feedback on this help topic