Fortran User's Guide

-Idir

Add dir to the INCLUDE file search path.

    SPARC: 77/90 x86:77

Insert the directory dir at the start of the INCLUDE file search path. No space is allowed between -I and dir. 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% f77 -I/usr/app/include growth.F

Multiple -Idir 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 path on INCLUDE or #include is:

  1. The directory that contains the source file

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

  3. The directories in the default list

The default list for -Idir depends on the installation directory for the compiler. In a standard install, compiler software packages reside in the /opt directory; however, systems administrators may decide to install packages in other locations. If an environment variable, INSTALL_HOME say, points at the installation path (e.g. /opt, or /some/place), the default search paths for INCLUDE files are: