Preprocess Options

Describes the available preprocess options.

-D identifier=value

The -D identifier=value option defines variables used for source preprocessing as if they had been defined by a #define source preprocessing directive. If a value is specified, there can be no spaces on either side of the equal sign (+). If no value is specified, the default value of 1 is used.

The -U option undefines variables used for source preprocessing. If both -D and -U are used for the same identifier, in any order, the identifier is undefined.

This option is ignored unless one of the following conditions is true:
  • The Fortran input source file is specified as either file.F, file.F90, file.F95, file.F03, file.F08, or file.FTN.
  • The -eP or -eZ options have been specified.

    For more information about source preprocessing, see Source Preprocessing.

-I incldir

Directories for #include "file" are searched in the following order:
  1. Directory of the input file. Note that the input file is not always in the current working directory. The input file is searched, not the current working directory, if they differ. If the user wants the current working directory searched, the -I option should be added to the command line.
  2. Directories named in -I options, in command-line order.
  3. Site-specific and compiler release-specific include files directories.
Directories for #include <file> are searched in the following order:
  1. Directories named in -I options, in command-line order.
  2. Site-specific and compiler release-specific include files directories.

If the -I option specifies a directory name that does not begin with a slash (/), the directory is interpreted as relative to the current working directory and not relative to the directory of the input file, if different from the current working directory.

The -I incldir option specifies a directory to be searched for files named in INCLUDE lines in the Fortran source file and for files named in #include source preprocessing directives. Additionally, all user-specified -I incldir directories are searched for MODULE USE resolution after all user-specified -p paths are searched.

An -I option must be specified for each directory to be searched. Directories can be specified in incldir as full path names or as path names relative to the working directory. By default, only the directory of the file referencing the included file and system directories are searched. None of the system-specified -I incldir directories are searched during MODULE USE resolution.

The following example causes the compiler to search for files included within earth.f in the directories /usr/local/dir and ../moon:
% ftn -I /usr/local/dir -I ../moon earth.f

If the INCLUDE line or #include directive in the source file specifies an absolute name (that is, one that begins with a slash (/)), that name is used, and no other directory is searched. If a relative name is used (that is, one that does not begin with a slash (/)), the compiler searches for the file in the directory of the source file containing the INCLUDE line or #include directive. If this directory contains no file of that name, the compiler then searches the directories named by the -I options, as specified on the command line, from left to right.

-U identifier ,identifier...

The -U identifier ,identifier ... option undefines variables used for source preprocessing. This option removes the initial definition of a predefined macro or sets a user predefined macro to an undefined state.

The -D identifier =value option defines variables used for source preprocessing. If both -D and -U are used for the same identifier, in any order, the identifier is undefined.

This option is ignored unless one of the following conditions is true:
  • The Fortran input source file is specified as either file.F, file.F90, file.F95, file.F03, file.F08, or file.FTN.
  • The -e P or -e Z options have been specified.

For more information about source preprocessing, see Source Preprocessing.

-x dirlist

The -x dirlist option disables specified directives or specified classes of directives. If specifying a multiword directive, either enclose the directive name in quotation marks or remove the spaces between the words in the directive's name.

For dirlist, enter one of the following arguments:
dirlist
Item disabled
all
All compiler directives and OpenMP Fortran directives. For information about the OpenMP, see OpenMP Overview.
dir
All compiler directives.
directive
One or more compiler directives or OpenMP Fortran directives. If specifying more than one, separate them with commas; for example: -x INLINEALWAYS,"NO SIDE EFFECTS",BOUNDS.
omp
All OpenMP Fortran directives
acc
All OpenACC Fortran directives.
conditional_omp
All C$ and !$ conditional compilation lines.