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 (Linux* and Mac OS*) or /D (Windows*) option to define the symbol names to be used during preprocessing. This option performs the same function as the #define preprocessor directive.

Preprocessing replaces every occurrence of the defined symbol name with the specified value.

For more information, see the following topic:

You can use the -U (Linux and Mac OS) or /U (Windows) 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.

For more information, see the following topic:

Windows Systems:

The following information applies to Windows systems.

In addition to specifying preprocessor symbols on the command line, you can also specify them in the Visual Studio* integrated development environment (IDE). To do this, select Project>Properties and use the Preprocessor Definitions item in the General Options or Preprocessor Options category.

The following preprocessor symbols are available:

Predefined Symbol Name and Value Conditions When this Symbol is Defined

__INTEL_COMPILER=910

Identifies the Intel Fortran compiler

__INTEL_COMPILER_BUILD_DATE=YYYYMMDD

Identifies the Intel Fortran compiler build date

_DLL=1

Only if /libs:dll, /MDs, /MD, /dll, or /LD is specified, but not when /libs:static is specified

_MT=1

Only if /threads or /MT is specified

_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)

_M_IA64=64n00

Only for IA-64 architecture based systems; n is the number specified for /G (for example, _M_IA64=64100 for /G1)

_M_X64

Only for systems based on Intel® 64 architecture. For use in conditionalizing applications for the Intel® 64 platform.

_M_AMD64

Only for systems based on Intel® 64 architecture. This symbol is set by default.

_OPENMP=200505

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.

_PGO_INSTRUMENT

Defined if /Qprof_gen is specified

_WIN32

Always defined

_WIN64

Only for systems based on Intel® 64 architecture and systems based on IA-64 architecture

_VF_VER=910

Valid when Compaq* Visual Fortran-compatible compile commands (df or f90) are used

When using the non-native IA-64 architecture based compiler, platform-specific symbols are set for the target platform of the executable, not for the system in use.

Linux and Mac OS systems:

The following information applies to Linux and Mac OS systems.

Symbol Name Default Architecture (IA-32, Intel® 64, IA-64) Description

__INTEL_COMPILER=n

On, n=910

All

Identifies the Intel Fortran Compiler

__INTEL_COMPILER_BUILD_DATE
=
YYYYMMDD

 

All

Identifies the Intel Fortran Compiler build date

__linux__ (Linux only)
__linux
(Linux only)
__gnu_linux__
(Linux only)
linux
(Linux only)
__unix__
(Linux only)
__unix
(Linux only)
unix
(Linux only)
__ELF__
(Linux only)

 

All

Defined at the start of compilation

__APPLE__ (Mac OS only
__MACH__ (Mac OS only)

 

IA-32

Defined at the start of compilation

__i386__
__i386
i386

 

IA-32

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

__ia64__ (Linux only)
__ia64
(Linux only)

 

IA-64

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

__x86_64
__x86_64__

 

Intel® 64

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

_OPENMP=n

n=200505

All

Takes the  form YYYYMM, where YYYY is the year and MM is the month of the OpenMP Fortran specification supported. This preprocessor symbol can be used in both fpp and the Fortran compiler conditional compilation. It is available only when -openmp is specified.

_PGO_INSTRUMENT

Off

All

Defined when -prof_gen is specified.

__PIC__
__pic__

Off (Linux),
On (Mac OS)

All

Set if the code was requested to be compiled as position independent code. On Mac OS systems, these symbols are always set.