@file (-qoptfile)

Pragma equivalent

None.

Purpose

Specifies a response file that contains a list of additional command line options to be used for the compilation. Response files typically have the .rsp suffix.

Syntax

Read syntax diagramSkip visual syntax diagram
>>- @--filename------------------------------------------------><

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

Defaults

None.

Parameters

filename
Specifies the name of the response 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 response file follows these rules:
  • Specify the options you want to include in the file with the same syntax as on the command line. The response 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 response 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 @file (-qoptfile) option from the command line, and sequentially inserts the options included in the file before the other subsequent options that you specify.

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

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

Predefined macros

None.

Example 1

This is an example of specifying a response file.

$ cat options.file
# To perform optimization at -O3 level, and high-order 
# loop analysis and transformations during optimization
-O3 -qhot
# To generate position-independent code
-fPIC

$ xlC -qlist @options.file -qipa test.c
The preceding example is equivalent to the following invocation:
$ xlC -qlist -O3 -qhot -fPIC -qipa test.c

Example 2

This is an example of specifying a response file that contains @file (-qoptfile) with a cycle.

$ cat options.file1
# To perform optimization at -O3 level, and high-order 
# loop analysis and transformations during optimization
-O3 -qhot
# To include the -qoptfile option in the same response file
@options.file1
# To generate position-independent code
-fPIC
# To produce a compiler listing file
-qlist

$ xlC -qlist @options.file1 -qipa test.c
The preceding example is equivalent to the following invocation:
$ xlC -qlist -O3 -qhot -fPIC -qlist -qipa test.c

Example 3

This is an example of specifying a response file that contains @file (-qoptfile) without a cycle.

$ cat options.file1
-O3 -qhot
@options.file2
-qalias=ansi

$ cat options.file2
-qchars=signed

$ xlC @options.file1 test.c
The preceding example is equivalent to the following invocation:
$ xlC -O3 -qhot -qalias=ansi -qchars=signed test.c

Example 4

This is an example of specifying -qsaveopt and @file (-qoptfile) on the same command line.

$ cat options.file3
-O3
-qhot

$ xlC -qsaveopt -qipa @options.file3 test.c -c

$ what test.o
test.o:
opt f xlC -qsaveopt -qipa @options.file3 test.c -c
optfile options.file3 -O3 -qhot


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us