Set Up the Batch Compilation Environment

Before you compile your C or C++ programs, you must set up the environment variables and the configuration file for your application.

Set Environment Variables to Select 64- or 32-bit Modes (AIX 4.3 Only)
You can set the OBJECT_MODE environment variable to specify a default compilation mode. Permissible values for the OBJECT_MODE environment variable are:

(unset) Compiler programs generate and/or use 32-bit objects.
32 Compiler programs generate and/or use 32-bit objects.
64 Compiler programs generate and/or use 64-bit objects.
32_64 Set the compiler programs to accept both 32- and 64-bit objects. The compiler never functions in this mode, and using this choice may generate an error message, depending on other compilation options set at compile-time.

See Specify Compiler Options for Architecture-Specific, 32- or 64-bit Compilation for more information.

 

Set Parallel Processing Run-time Options (C Only)

The XLSMPOPTS environment variable sets options for programs using loop parallelization. For example, to have a program run-time create 4 threads and use dynamic scheduling with chunk size of 5, you would set the XLSMPOPTS environment variable as shown below:

XLSMPOPTS=PARTHDS=4:SCHEDULE=DYNAMIC=5

Additional environment variables set options for program parallelization using OpenMP-compliant directives.

See IBM Run-time Options for Parallel Processing and OpenMP Run-time Options for Parallel Processing for more information.

Set Environment Variables for the Message and Help Files
Before using the compiler, you must install the message catalogs and help files and set the following two environment variables:

LANG Specifies the national language for message and help files.
NLSPATH Specifies the path name of the message and help files.

The LANG environment variable can be set to any of the locales provided on the system. See the description of locales in AIX General Programming Concepts for IBM RISC System/6000 for more information.

The national language code for United States English is en_US. If the appropriate message catalogs have been installed on your system, any other valid national language code can be substituted for en_US.

To determine the current setting of the national language on your system, use the both of the following echo commands:

echo $LANG
echo $NLSPATH

The LANG and NLSPATH environment variables are initialized when the operating system is installed, and might differ from the ones you want to use.

You use different commands to set the environment variables depending on whether you are using the Bourne shell (bsh or sh), Korn shell (ksh), or C shell (csh). To determine the current shell, use the echo command:

echo $SHELL

The Bourne-shell path is /bin/bsh or /bin/sh. The Korn shell path is /bin/ksh. The C-shell path is /bin/csh.

For more information about the NLSPATH and LANG environment variables, see AIX Version 4 System User's Guide: Operating System and Devices. The AIX international language facilities are described in the AIX General Programming Concepts for IBM RISC System/6000.

Set Environment Variables in bsh, ksh, or sh Shells
To set the environment variables from the Bourne shell or Korn shell, use the following commands:

LANG=en_US
NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/L/%N
export LANG NLSPATH

To set the variables so that all users have access to them, add the commands to the file /etc/profile. To set them for a specific user only, add the commands to the file .profile in the user's home directory. The environment variables are set each time the user logs in.

 

Set Environment Variables in csh Shell
To set the environment variables from the C shell, use the following commands:

setenv LANG en_US
setenv NLSPATH /usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/L/%N

In the C shell, you cannot set the environment variables so that all users have access to them. To set them for a specific user only, add the commands to the file .cshrc in the user's home directory. The environment variables are set each time the user logs in.



Specify Compiler Options for 64-bit Compilation


IBM Run-time Options for Parallel Processing
OpenMP Run-time Options for Parallel Processing