Developer Forums | About Us | Site Map
Search  
HOME > TUTORIALS > SERVER SIDE CODING > ADMINISTRATION TUTORIALS > EMPOWERING THE LINUX DEVELOPER


Sponsors





Useful Lists

Web Host
site hosted by netplex

Online Manuals

EmPOWERing the Linux developer
By Matt Davis - 2004-05-05 Page:  1 2 3 4

Compilers and libraries

Linux on POWER is the union of two worlds: the best of open source development and enterprise-class hardware. It's only fitting to provide a choice of C, C++, and Fortran compilers that reflect this union.

GNU Compiler Collection (GCC)

GNU GCC is the most widely used compiler on Linux across all architectures and is the compiler used by both Red Hat and SUSE to compile the binaries distributed with their products. Capable of generating both 32- and 64-bit binaries, GCC 3.2 is offered on both RHEL3 and SLES8. The RHEL3 implementation utilizes a "biarch" style twin compiler, with which a compiler flag (-m64) is used to enable 64-bit compilation.

SLES8, alternatively, uses a separate toolchain for 64-bit GCC, stored by default in /opt/cross. In order to enable the 64-bit GCC compiler in SLES8, developers should ensure that their configure scripts and Makefiles are aware of this compiler. You can accomplish this by assigning the CC environment variable to the 64-bit GCC compiler's location.

Currently, the GNU Compiler Collection is undergoing a massive renovation regarding performance optimization for the POWER architecture. In the upcoming 3.3 and 3.4 releases, GCC will have improved scheduling and signal handling. In addition, architecture-specific optimizations (such as VMX/Altivec support on PPC970 chips featured in the IBM JS20 BladeCenter) will deliver a dramatic performance advantage to compiled code. However, both SLES8 and RHEL3 currently employ GCC 3.2 versions, and a review of performance optimization for these versions of GCC is provided here.

GCC 3.2 lacks architecture-specific optimizations for POWER processors. Therefore, it is not recommended to compile with architecture-specific flags, such as -mpower. These options are available, but often offer no performance advantage. In contrast to GCC implementations on x86, the -fPIC flag is not implied. In order to generate dynamically linked binaries, include -fPIC in all Makefiles. This is especially key if you are porting a codebase from Linux on Intel, since this flag may not be explicitly used in existing Makefiles.

In addition to awareness of flags not utilized by current releases of GCC for POWER architecture, you should be aware of common flags available to both x86 and POWER architecture. These include compile flags dealing with relocation, table of contents sizes, floating point options, bit alignment, and so on. For example, large TOC support (greater than 8K entry) requires multiple TOCs, specified with the -mminimal-toc compile flag. For a review of these, see standard GCC documentation packaged with the source.

IBM VisualAge Compiler Set

In addition to GCC, IBM has made available for both RHEL3 and SLES8 a release of the high-performance VisualAge Compiler Set. These compilers for C, C++, and Fortran, are pinnacles of performance optimization technology; they are also custom crafted to exploit the POWER architecture to the fullest extent. High Performance Computing developers often see upwards of 30 percent performance improvements just by recompiling their code with these compilers!

Optimization with VisualAge can be as easy as using the preset optimization levels, which will incorporate various categories of algorithm. In general, significant performance improvements are seen with a simple -O3 -qtune=auto and -qarch=auto. Third-level optimization will offer chip- (but not architecture-) independent optimization with autodetection of the chip model. Stepping up to the -O4 optimization flag will buy incremental performance derived from chip-specific optimizations, interprocedural analysis, and high-order transformation routines. High-performance code should first be optimized at -O3, and then attempted at -O4. Though -O4 will likely add performance, it is also more selective about the code structure and more restrictive to binary compatibility within the POWER microprocessor line.

To avoid nightmarish scenarios of library incompatibility, the VisualAge compilers for Linux on POWER have been designed to use the glibc packaged with each distribution respectively, and they even use the native Linux linker. Applications that are thirsty for performance have an obvious ally with this unique offering for Linux on POWER.

Extensive documentation on compile-time optimization is available for both the GCC and VisualAge compiler set for Linux on POWER. Freely available technical resources any Linux on POWER developer should have on the desktop are listed in Resources.

IBM SDK 1.4.1

IBM has poured development resources into the refinement of a customized SDK, available in both 32- and 64-bit for Linux on POWER. Both RHEL3 and SLES8 are packaged with the IBM SDK 1.4.1, and can be used in combination with the Eclipse Integrated Development Environment for Linux on POWER.

Development tools

Many Linux developers are happy with traditional development environments like vi or Emacs. Naturally, these are available, along with kernel-level debugging tools common to Linux such as gdb. However, in addition to these tools, Linux on POWER also features support for development tools like the Eclipse IDE. The VisualAge compilers have detailed code analysis options to assess endianness and 64-bit compatibility in source code, and the comfortable KDE and Gnome desktop environments make the graphically inclined developer feel right at home. High Performance Computing (HPC) and Life Science developers will benefit from the availability of common applications, for example NCBI applications. IBM's advanced mathematics and scientific libraries ESSL and P/ESSL are also available to aid HPC applications for Linux on POWER. Grid computing comes to life for Linux on POWER with respected solutions such as the Globus Toolkit combined with clustering tools like Cluster Systems Management (CSM).



View EmPOWERing the Linux developer Discussion

Page:  1 2 3 4 Next Page: Summary and Resources

First published by IBM developerWorks


Copyright 2004-2024 GrindingGears.com. All rights reserved.
Article copyright and all rights retained by the author.