Intel® Fortran Compiler 17.0 Developer Guide and Reference

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* and OS X* systems only).

  5. Directories specified with the CPATH (Linux* and OS X*) or INCLUDE (Windows*) 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:

Example

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

See Also