Specifying compiler options for architecture-specific, 32-bit or 64-bit compilation

You can use XL C/C++ compiler options to optimize compiler output for use on specific processor architectures. You can also instruct the compiler to compile in either 32-bit or 64-bit mode.

The compiler evaluates compiler options in the following order, with the last allowable one found determining the compiler mode:

  1. Internal default (32-bit mode)
  2. OBJECT_MODE environment variable setting, as follows:
    OBJECT_MODE Setting User-selected compilation-mode behavior, unless overridden by configuration file or command-line options
    not set 32-bit compiler mode.
    32 32-bit compiler mode.
    64 64-bit compiler mode.
    32_64 Fatal error and stop with following message, 1501-254 OBJECT_MODE=32_64 is not a valid setting for the compiler unless an explicit configuration file or command-line compiler-mode setting exists.
    any other Fatal error and stop with following message, 1501-255 OBJECT_MODE setting is not recognized and is not a valid setting for the compiler unless an explicit configuration file or command-line compiler-mode setting exists.
  3. Configuration file settings
  4. Command line compiler options (-q32, -q64, -qarch, -qtune)
  5. Source file statements (#pragma options tune=suboption)

The compilation mode actually used by the compiler depends on a combination of the settings of the -q32, -q64, -qarch and -qtune compiler options, subject to the following conditions:

Allowable combinations of these options are found in Acceptable compiler mode and process or architecture combinations.

Possible option conflicts and compiler resolution of these conflicts are described below:

Related information