User and Reference Guide for the Intel® Fortran Compiler 14.0

Using Include Files

Include files are brought into a program with the #include preprocessor directive or a Fortran INCLUDE statement.

Directories are searched for include files in this order:

  1. Directory of the source file that contains the include

  2. Current working directory

  3. Directories specified by the I option

  4. Directory specified by the -isystem option (Linux* OS and OS X* systems only)

  5. Directories specified with the CPATH (Linux OS and OS X) or INCLUDE (Windows OS) environment variable

  6. Standard system directories

The locations of directories to be searched are known as the include file path. More than one directory can be specified in the include file path.

Specifying and Removing an Include File Path

You can use the I compiler option to indicate the location of include files (and also module files).

To prevent the compiler from searching the default path specified by the CPATH or the INCLUDE environment variable, use the -X or /noinclude option.

You can specify these options in the configuration file, ifort.cfg, or on the command line.

For example, to direct the compiler to search a specified path instead of the default path, use the following command line:

ifort -X -I/alt/include newmain.f (Linux OS and OS X)
ifort /noinclude /IC:/Project2/include newmain.f (Windows OS)

See Also


Submit feedback on this help topic