Compile your AIX source

You can install one of the AIX® compiler products that support installation in i5/OS™ PASE to compile your programs in the i5/OS PASE environment.

When your program uses AIX interfaces only, you compile with any required AIX headers and link with AIX libraries to prepare binaries for i5/OS PASE. Keep in mind that i5/OS PASE does not support applications that are statically bound with AIX system-supplied shared libraries.

i5/OS PASE programs are structurally identical to AIX programs for PowerPC®.

i5/OS PASE (option 33 of the operating system) does not include a compiler. You use an AIX system to compile i5/OS PASE programs, or you can optionally install one of the AIX compiler products that support installation in i5/OS PASE to compile your programs in the i5/OS PASE environment.

Use AIX compilers on the pSeries® server

You can build i5/OS PASE programs using any AIX compiler and linker that generate output that is compatible with the AIX ABI for PowerPC. i5/OS PASE provides instruction emulation support for binaries that use POWER™ architecture instructions that do not exist in PowerPC (except for IBM® POWER instructions for cache management).

Use AIX compilers in i5/OS PASE

i5/OS PASE supports the installation of the following separately available AIX compilers in the i5/OS PASE environment:

Start of changeEnd of change

Using these products, you can develop, compile, build, and run your AIX applications entirely within the i5/OS PASE environment on your iSeries™ server.

Development tools

Many development tools that you use on AIX (for example, ld, ar, make, yacc) are included with i5/OS PASE. Many AIX tools from other sources (for instance, the open-source tool gcc) can also work in i5/OS PASE.

The iSeries Tools for Developers PRPQ (5799-PTL) also contains a wide array of tools to aid in the development, building, and porting of iSeries applications. For more information about this PRPQ, see the IBM Virtual Innovation Center for Hardware Web site.

Compiler notes for handling of pointers

Examples

The following examples are intended for use when you are compiling your i5/OS PASE programs on an AIX system. If you are using a compiler installed in i5/OS PASE to compile your programs, you do not need to specify compiler options for the locations of i5/OS system-unique header files or i5/OS system-unique exports because these files will be found in their default path locations of /usr/include/ and /usr/lib/ on an i5/OS system.

Example 1

The following command on an AIX system creates an i5/OS PASE program named testpgm that can use i5/OS system-unique interfaces exported by libc.a:

xlc -o testpgm -qldbl128 -qlonglong -qalign=natural
         -bI:/mydir/as400_libc.exp testpgm.c

This example assumes that the i5/OS system-unique header files are copied to the AIX directory /usr/include and that the i5/OS system-unique exports files are copied to the AIX directory /mydir.

Example 2

The following example assumes i5/OS system-unique headers and export files are in /pase/lib:

xlc -o as400_test -qldbl128 -qlonglong -qalign=natural -H16
          -l c128
          -I /pase/lib
          -bI:/pase/lib/as400_libc.exp as400_test.c

Example 3

The following example builds the same program as example 2 with the same options; however, the xlc_r command is used for a multithreaded program to ensure that the compiled application links with threadsafe runtime libraries:

xlc_r -o as400_test -qldbl128 -qlonglong -qalign=natural -H16
            -l c128
            -I /pase/lib
            -bI:/pase/lib/as400_libc.exp as400_test.c

In the examples, if you are using i5/OS PASE support for IBM DB2 Universal Database™ (UDB) for iSeries call level interfaces (CLI), you also need to specify -bI:/pase/include/libdb400.exp on your build command.

The -bI directive tells the compiler to pass the parameter to the ld command. The directive specifies an export file containing exported symbols from a library to be imported by the application.

Related concepts
What is i5/OS PASE?
Related information
i5/OS PASE shells and utilities