Specifying Compiler Options for Architecture-Specific, 32- or 64-bit Compilation

You can use IBM C and C++ Compilers compiler options to optimize compiler output for use on specific processor architectures. You can also instruct the compiler to compile in either 32- 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-054 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-055 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 the Acceptable Compiler Mode and Processor Architecture Combinations table.

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



Specifying Compiler Options


Invoking the Compiler
Setting Up the Compilation Environment
Specifying Compiler Options in Your Source Program
Specifying Compiler Options in a Configuration File


Acceptable Compiler Mode and Processor Architecture Combinations
Resolving Conflicting Compiler Options
List of Compiler Options and Their Defaults