-qoptfile

Category

Compiler customization

@PROCESS directive

None.

Purpose

Specifies a file containing a list of additional command line options to be used for the compilation.

Syntax

Read syntax diagramSkip visual syntax diagram
>>- -q--optfile--=--filename-----------------------------------><

Defaults

None.

Parameters

filename
Specifies the name of the file that contains a list of additional command line options. filename can contain a relative path or absolute path, or it can contain no path. It is a plain text file with one or more command line options per line.

Usage

The format of the option file follows these rules:
  • Specify the options you want to include in the file with the same syntax as on the command line. The option file is a whitespace-separated list of options. The following special characters indicate whitespace: \n, \v, \t. (All of these characters have the same effect.)
  • A character string between a pair of single or double quotation marks are passed to the compiler as one option.
  • You can include comments in the options file. Comment lines start with the # character and continue to the end of the line. The compiler ignores comments and empty lines.

When processed, the compiler removes the -qoptfile option from the command line, and sequentially inserts the options included in the file before the other subsequent options that you specify.

The -qoptfile option is also valid within an option file. The files that contain another option file are processed in a depth-first manner. The compiler avoids infinite loops by detecting and ignoring cycles in option file inclusion.

If -qoptfile and -qsaveopt are specified on the same command line, the original command line is used for -qsaveopt. A new line for each option file is included representing the contents of each option file. The options contained in the file are saved to the compiled object file.

Examples

This is an example of specifying an option file.
$ cat options.file
# To perform optimization at -O4 level, and high-order 
# loop analysis and transformations during optimization
-O4 -qhot
# To indicate that the input source program is in fixed source form
-qfixed

$ xlf95 -qlist -qoptfile=options.file -qipa test.f
The preceding example is equivalent to the following invocation:
$ xlf95 -qlist -O4 -qhot -qfixed -qipa test.f
This is an example of specifying an option file that contains -qoptfile with a cycle.
$ cat options.file2
# To perform optimization at -O4 level, and high-order 
# loop analysis and transformations during optimization
-O4 -qhot
# To include the -qoptfile option in the same option file
-qoptfile=options.file2
# To indicate that the input source program is in fixed source form
-qfixed
# To indicate that the source code is in free source form
-qfree

$ xlf95 -qlist -qoptfile=options.file2 -qipa test.f
The preceding example is equivalent to the following invocation:
$ xlf95 -qlist -O4 -qhot -qfixed -qfree -qipa test.f
This is an example of specifying an option file that contains -qoptfile without a cycle.
$ cat options.file1
-O4 -qhot
-qoptfile=options.file2
-qfixed

$ cat options.file2
-qfree

$ xlf95 -qoptfile=options.file1 test.f
The preceding example is equivalent to the following invocation:
$ xlf95 -O4 -qhot -qfree -qfixed test.f 
This is an example of specifying -qsaveopt and -qoptfile on the same command line.
$ cat options.file3
-O4
-qassert=contiguous

$ xlf95 -qsaveopt -qipa -qoptfile=options.file3 test.f -c

$ what test.o
test.o:
opt f xlf95 -qsaveopt -qipa -qoptfile=options.file3 test.f -c
optfile options.file3 -O4 -qassert=contiguous