XL C/C++ overview

XL C/C++ Advanced Edition is an optimizing, standards-based, command-line compiler for the Linux operating system running on PowerPC hardware with the PowerPC architecture. The compiler enables application developers to create and maintain optimized 32-bit and 64-bit applications. These applications can use automatic or explicit shared memory program parallelization to improve performance. Many of the optimizations and performance improvements made possible by the PowerPC architecture are controlled by compiler options, pragmas, and compiler invocation modes. The benefits of the hardware architecture can therefore be realized with a minimum amount of specialized hand coding.

This product is the follow-on release to IBM VisualAge C++ Version 6.0 for Linux. IBM has rebranded VisualAge C++ as XL C/C++.

Shared memory program parallelization

Significant gains in program performance lie in exploiting the shared memory program parallelization (SMP) that is possible on the PowerPC architecture. The compiler offers the following methods of implementing SMP:

OpenMP directives involve defining parallel regions of iterative and non-iterative code.

Source compatibility

The compiler supports the two ISO programming language specifications for C: ISO/IEC 9899:1990 (referred to as C89) and ISO/IEC 9899:1999 (C99). The compiler also supports both of the C++ standards: ISO/IEC 14882:2003 (referred to as Standard C++) and ISO/IEC 14882:1998, the first official specification of the language (referred to as C++98). In addition to the standardized language levels, the compilers support numerous language extensions, which include a subset of the GNU C and C++ language extensions.

Binary compatibility

XL C/C++ supports the C++ Abstract Binary Interface (ABI). The compiler produces binary or object files that are compatible with those created with the GNU C/C++ Version 3.2 or 3.3 compiler. The compiler also supports the OpenMP version 2.0 standard. OpenMP-compliant C and C++ object files are binary compatible with those created by IBM XL Fortran for Linux, thus allowing interlanguage calls between C or C++ and Fortran.

Coexistence with open source resources

To achieve binary compatibility with code compiled with a GNU C or C++ compiler, a program compiled with XL C/C++ includes the same headers as those used by a GNU compiler residing on the same system. The compiler optimizes the program while maintaining binary compatibility with objects produced by GNU C. Some noteworthy points about this relationship are:


Command-line C and C++ compiler

XL C/C++ provides a selection of base compiler invocation commands, which support various version levels of the C and C++ languages. Each invocation command automatically sets a compiler suboption for language level, options for other related language features, and any related predefined macros. In most cases, you should use the xlc command to compile C source files and the xlC command to compile C++ source files, or when you have both C and C++ source files. The invocation xlc++ is equivalent to xlC.

Variations of the base command are provided to support the requirements of special environments and file systems. A variation is formed by attaching a suffix to the base command. On the Linux platform, the _r suffix is provided for compiling thread-safe applications. These variations are also referred to as reentrant invocations.

In addition, the gxlc and gxlc++ utilities are specialized compiler invocations.

Related References


Libraries

XL C/C++ uses the GNU C and C++ headers, and the resulting application is linked with the C and C++ run-time libraries provided with the gcc level that is loaded with the operating system.XL C/C++ ships the SMP run-time library to support the automatic parallelization and OpenMP features of the XL C/C++ compilers.

High-performance mathematics libraries

Starting in Version 7, XL C/C++ ships the IBM Mathematics Acceleration Subsystem (MASS) libraries of tuned mathematical intrinsic functions. MASS libraries are thread-safe and offer improved performance over the corresponding libm routines. Moreover, the MASS libraries can be used without requiring code changes. The compiler supports 32-bit and 64-bit versions of the MASS vector library, libmassvp4.a and libmassvp4_64.a, respectively, which contain vector routines for single-precision and double-precision reciprocal and square root functions.


Utilities and commands

XL C/C++ Advanced Edition provides the following specialized commands to aid program development. For more information, refer to XL C/C++ Compiler Reference.

vac_configure Utility
A program that creates the configuration file vac.cfg, which specifies the location of the GNU compiler and other configuration information. The C and C++ compilers use the vac.cfg for its configuration.

gxlc and gxlc++ Utilities
Invocation methods that translate a GNU C or GNU C++ invocation command into a corresponding xlc or xlc++ command and invokes the XL C/C++ compiler. The purpose of these utilities is to minimize the number of changes to makefiles used for existing applications built with the GNU compilers and to facilitate the transition to XL C/C++.

cleanpdf Command
A command related to profile-directed feedback, used for managing the PDFDIR directory. Removes all profiling information from the specified directory, the PDFDIR directory, or the current directory.

mergepdf Command
A command related to profile-directed feedback (PDF) that provides the ability to weight the importance of two or more PDF records when combining them into a single record. The PDF records must be derived from the same executable.

resetpdf Command
The current behavior of the resetpdf command is the same as the cleanpdf command and is retained for compatibility with earlier releases on other platforms.

showpdf Command
A command to display the call and block counts for all procedures executed in a profile-directed feedback training run (compilation under the options -qpdf1 and -qshowpdf).

National language support

XL C/C++ provides support for the Unicode standard, multibyte characters, UTF-16 and UTF-32 string literals, multiple loaded locales, and bidirectionality. These features make possible or facilitate the creation of international applications.

Related References


Documentation and online help

XL C/C++ Advanced Edition provides product documentation in the following formats:

These items are located or accessed as follows:

Readme files The readme files are located in /opt/ibmcmp/vacpp/7.0 and in the root directory of the installation CD.
Man pages Man pages are provided for the compiler invocations and all command-line utilities provided with the product.
HTML-based help system A help system composed of HTML files is provided. The help system is also available online as part of the product Information Center.
PDF documents The PDF files are located in the /opt/ibmcmp/pdf directory. They are viewable and printable from the Adobe Acrobat Reader. If you do not have the Adobe Acrobat Reader installed, you can download it from http://www.adobe.com.

The complete library of XL C/C++ PDF documents consists of the following files:

install.pdf
XL C/C++ Installation Guide contains instructions for installing the compiler and enabling the man pages.

getstart.pdf
Getting Started with XL C/C++ contains an overview of XL C/C++ components, explanation of new features, how-to information on customizing the compilation environment and process, summary tables of the compiler options arranged by category, an introduction to performance optimization and tuning, and general advice for porting an application to the Linux platform.

language.pdf
XL C/C++ Language Reference contains information about the IBM implementations of the C and C++ programming languages, including the implementation-defined extensions for porting an application originally developed with GNU C and C++.

compiler.pdf
XL C/C++ Compiler Reference contains information about the various compiler options, pragmas, macros, and built-in functions, including those used for parallel processing.

proguide.pdf
XL C/C++ Programming Guide contains information about programming using XL C/C++ not covered in other publications.

license.pdf
IBM XL C/C++ Advanced Edition V7.0 for Linux License Information contains information about the product license.

Accessing additional information

For the latest information about XL C/C++, visit the product documentation and support pages at the following URLs. In addition, IBM Redbooks, developed by the IBM Technical Support Organization, contain technical information based on realistic scenarios from practical experience.

You might find the following Redbooks useful for application development with XL C/C++:

_ POWER4 Processor Introduction and Tuning Guide, SG24-7041-00.

_ Understanding IBM eServer pSeries Performance and Sizing, SG24-4810-01.

IBM Copyright 2003