-I

Category

Input control

@PROCESS

None.

Purpose

Adds a directory to the search path for include files, .mod files, and .smod files.

Syntax

Read syntax diagramSkip visual syntax diagram
>>- -I--path_name----------------------------------------------><

Defaults

Not applicable.

Parameters

path_name
A valid path name (for example, /home/dir, /tmp, or ./subdir).

Usage

If XL Fortran calls cpp, this option adds a directory to the search path for #include files. Before checking the default directories for include, .mod, and .smod files, the compiler checks each directory in the search path. For include files, this path is only used if the file name in an INCLUDE line is not provided with an absolute path. For #include files, refer to the cpp documentation for the details of the -I option.

Rules

The compiler appends a / to path_name and then concatenates that with the file name before making a search. If you specify more than one -I option on the command line, files are searched in the order of the path_name names as they appear on the command line.

The following directories are searched, in this order, after any paths that are specified by -I options:
  1. The current directory (from which the compiler is executed)
  2. The directory where the source file is (if different from 1.)
  3. /usr/include

Also, the compiler will search /opt/ibm/xlf/15.1.0/include where include and .mod files shipped with the compiler are located.

Related information