-qsaveopt
Category
Pragma equivalent
None.
Purpose
Saves the command-line options used for compiling a source file, the user's configuration file name and the options specified in the configuration files, the version and level of each compiler component invoked during compilation, and other information to the corresponding object file.
Defaults
-qnosaveopt
Usage
This option has effect only when compiling to an object (.o) file (that is, using the -c option). Though each object might contain multiple compilation units, only one copy of the command-line options is saved. Compiler options specified with pragma directives are ignored.
>>-@(#)--opt--+-f-+--invocation--options----------------------->< +-c-+ '-C-'
>>-@(#)--cfg----config_file_options_list-----------------------><
>>-@(#)--env----env_var_definition-----------------------------><where:
- f
- Signifies a Fortran language compilation.
- c
- Signifies a C language compilation.
- C
- Signifies a C++ language compilation.
- invocation
- Shows the command used for the compilation, for example, xlc.
- options
- The list of command line options specified on the command line, with individual options separated by space.
- config_file_options_list
- The list of options specified by the options attribute in all configuration files that take effect in the compilation, separated by space.
- env_var_definition
- The environment variables that are used by the compiler. Currently
only XLC_USR_CONFIG is listed.Note: You can always use this option, but the corresponding information is only generated when the environment variable XLC_USR_CONFIG is set.
-
For more information about the environment variable XLC_USR_CONFIG, see Compile-time and link-time environment variables.
>>-@(#)---------------------------------------------------------> .-------------------------------------------------------------------------------------------------------------. V | >----version--+-Version-- : -VV.RR.MMMM.LLLL-------------------------------------------------------------------+-+->< '-component_name--Version--:--VV.RR--(--product_name--)--Level--:--YYMMDD--:--component_level_ID-'where:
- V
- Represents the version.
- R
- Represents the release.
- M
- Represents the modification.
- L
- Represents the level.
- component_name
- Specifies the components that were invoked for this compilation, such as the low-level optimizer.
- product_name
- Indicates the product to which the component belongs (for example, C/C++ or Fortran).
- YYMMDD
- Represents the year, month, and date of the installed update. If the update installed is at the base level, the level is displayed as BASE.
- component_level_ID
- Represents the ID associated with the level of the installed component.
If you want to simply output this information to standard output without writing it to the object file, use the --version (-qversion) option.
Predefined macros
None.
Examples
xlc t.c -c -qsaveopt -qhot
IBM XL C/C++ for Linux, Version 16.1.0
@(#)opt c /opt/ibm/xlC/16.1.0/bin/xlC \
-F/opt/ibm/xlC/16.1.0/etc/xlc.cfg.rhel.7.3.gcc.4.8.5 t.c -qhot -qsaveopt -c
@(#)cfg -qalias=ansi -qnostaticlink=libgcc -qthreaded -D_REENTRANT -D__VACPP_MULTI__
-Wl --no-toc-optimize -qtls -q64 -D_CALL_SYSV -D__null=0
-D__NO_MATH_INLINES -D_CALL_ELF=2 -Wno-parentheses -Wno-unused-value -qtls
@(#)version IBM XL C/C++ for Linux, V16.1.0 (5725-C73, 5765-J08)
@(#)version Version: 16.01.0000.0000
@(#)version Driver Version: 16.1.0(C/C++) Level: 151105 ID: _JbNFoYQ_EeWg_O7EssfHAg
@(#)version C/C++ Front End Version: 16.1.0(C/C++) Level: 151106 ID: _JX7IIIQ_EeWg_O7EssfHAg
@(#)version High-Level Optimizer Version: 16.1.0(C/C++) and 16.1.0(Fortran) Level: 151106
ID: _JfAAgYQ_EeWg_O7EssfHAg
@(#)version Low-Level Optimizer Version: 16.1.0(C/C++) and 16.1.0(Fortran) Level: 151030
ID: _sk208X8mEeWg_O7EssfHAg
In the first line, c identifies the source used as C, /opt/ibm/xlC/16.1.0/bin/xlc shows the invocation command used, and -qhot -qsaveopt shows the compilation options.
The remaining lines list each compiler component invoked during compilation, and its version and level. Components that are shared by multiple products may show more than one version number. Level numbers shown may change depending on the updates you have installed on your system.