Compiling programs

To compile a source program, use any of the available XL C/C++ or XL Fortran for Blue Gene compiler invocation commands. The compiler commands prefixed with blrts_ are for cross-compiling applications for use on Blue Gene. The compiler invocations that are not prefixed with blrts_ create executables targeted for the SLES9 platform, and are provided only for testing and debugging purposes. For the development of applications targeted for the SLES9 platform, IBM provides the XL C/C++ Advanced Edition for Linux and XL Fortran Advanced Edition for Linux products. As well, only the compiler options which are supported by the blrts_ invocations are supported when using these compiler invocations to create executables for the SLES9 platform.

These commands use the following syntax, where invocation can be replaced with any valid compiler invocation command:

Read syntax diagramSkip visual syntax diagram               .-------------------------------------------.
               V                                           |
>>-invocation----+----------------------+--+-------------+-+---><
                 '-command_line_options-'  '-input_files-'
 

The parameters of the compiler invocation command can be the names of input files, compiler options, and linkage-editor options. These commands accept essentially the same or XL Fortran language but use different default options. Read the appropriate vac.cfg or xlf.cfg configuration file to see which option defaults are used:

Compiler
Configuration file
/etc/opt/ibmcmp/vac/bg/8.0/vac.cfg
XL Fortran
/etc/opt/ibmcmp/xlf/bg/10.1/xlf.cfg

Different forms of the XL compiler invocation commands support various levels of the C, C++, and Fortran languages. These compiler invocation commands are summarized in Table 4 and Table 5.

Table 4. XL C/C++ cross-compiler invocations
Invocation Funtionality
blrts_xlC
blrts_xlc++
Source files are compiled as C++ language source code. If any of your source files are C++, you must use this invocation to link with the correct runtime libraries. Source files are compiled with -qalias=ansi set.

Files with .c suffixes, assuming you have not used the -+ or -qsourcetype compiler option.

blrts_xlc Invokes the compiler for C source files. The following compiler options are implied with this invocation:
  • -qlanglvl=extc89
  • -qalias=ansi
  • -qcpluscmt
  • -qkeyword=inline
blrts_cc Invokes the compiler for C source files. The following compiler options are implied with this invocation:
  • -qlanglvl=extended
  • -qnoro
  • -qnoroconst
blrts_c99 Invokes the compiler for C source files, with support for ISO C99 language features. Full ISO C99 (ISO/IEC 9899:1999) conformance requires the presence of C99-compliant header files and runtime libraries. The following compiler options are implied with this invocation:
  • -qlanglvl=extc89
  • -qalias=ansi
  • -qcpluscmt
  • -qkeyword=inline
blrts_c89 Invokes the compiler for C source files, with support for ISO C89 language features. The following options are implied with this invocation:
  • -qlanglvl=stdc89
  • -qalias=ansi
  • -qstrict_induction
  • -qnolonglong
  • -D_ANSI_C_SOURCE
  • -D__STRICT_ANSI__
Use this invocation for strict conformance to the ANSI standard (ISO/IEC 9899:1990).

Table 5. XL Fortran cross-compiler invocations
Invocation Funtionality
blrts_xlf
blrts_f77
blrts_fort77
Makes programs conform more closely to the FORTRAN 77 standard.
blrts_xlf90
blrts_f90
Makes programs conform more closely to the Fortran 90 standard.

For full conformance, compile with any of the following additional compiler options or suboptions:

-qnodirective -qnoescape -qextname -qfloat=nomaf:nofold -qnoswapomp
-qlanglvl=90std
blrts_xlf95
blrts_f95
Makes programs conform more closely to the Fortran 95 standard.

For full conformance, compile with any of the following additional compiler options or suboptions:

-qnodirective -qnoescape -qextname -qfloat=nomaf:nofold -qnoswapomp
-qlanglvl=95std