Visible to Intel only — GUID: GUID-E05572C2-8206-4605-AC90-5B65EEA09A99
Visible to Intel only — GUID: GUID-E05572C2-8206-4605-AC90-5B65EEA09A99
Use Include Files
Include files are brought into a program with the #include preprocessor directive or a Fortran INCLUDE statement.
The compiler searches for include files in this order:
In the directory of the source file that contains the include
In the current working directory
In the directories specified by compiler option I
In the directory specified by compiler option -isystem (Linux* and macOS only)
In the directories specified with environment variables CPATH (Linux* and macOS) or INCLUDE (Windows*)
In the 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.
Specify and Remove an Include File Path
You can use compiler option I 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 compiler option -X or /noinclude.
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:
Linux
ifort -X -I/alt/include newmain.f
Windows
ifort /noinclude /IC:\Project2\include newmain.f