Sun Studio 12: Fortran User's Guide

3.4.46 –Ipath

Add path to the INCLUDE file search path.

Insert the directory path path at the start of the INCLUDE file search path. No space is allowed between -I and path. Invalid directories are ignored with no warning message.

The include file search path is the list of directories searched for INCLUDE files—file names appearing on preprocessor #include directives, or Fortran INCLUDE statements.

Example: Search for INCLUDE files in /usr/app/include:

demo% f95 -I/usr/app/include growth.F

Multiple -Ipath options may appear on the command line. Each adds to the top of the search path list (first path searched).

The search order for relative paths on INCLUDE or #include is:

  1. The directory that contains the source file

  2. The directories that are named in the -I options

  3. The directories in the compiler’s internal default list

  4. /usr/include/

To invoke the preprocessor, you must be compiling source files with a .F, .F90, .F95, or .F03 suffix.