Skip to Main Content United States    
PRODUCTS SUPPORT SOLUTIONS SERVICES
COMPAQ SOFTWARE
Compaq C++  README
February 2002

This is the README for Version cxx-6.5.9.6-2 of the Compaq C++ compiler for Linux Alpha.

Compaq Computer Corporation
Houston, Texas


© 2002 Compaq Computer Corporation

COMPAQ, the Compaq logo, and Alpha, DEC, Ladebug, OpenVMS, and VMS are registered in the U.S. Patent and Trademark Office. Tru64 is a trademark of Compaq Information Technologies Group, L.P. in the United States and other countries. UNIX is a trademark of The Open Group in the United States and other countries. All other product names mentioned herein may be trademarks of their respective companies.

Compaq shall not be liable for technical or editorial errors or omissions contained herein. The information in this document is provided as is without warranty of any kind and is subject to change without notice. The warranties for Compaq products are set forth in the express limited warranty statements accompanying such products. Nothing herein should be construed as constituting an additional warranty.

Confidential computer software. Valid license from Compaq required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license.

Contents

1 Introduction

cxx is the Compaq C++ compiler for Linux Alpha. It is a port of the same compiler that is available on the Compaq Tru64tm UNIX® and OpenVMS Alpha platforms. The compiler produces excellent optimized code for the Alpha architecture, particularly for floating-point intensive applications.

There are some specific limitations and differences relative to the C++ compiler for Tru64 UNIX, including:

  • No support for feedback-based optimization.
  • No support for precompiled headers.
  • No support for Tru64-based performance tools like cord , atom or om .
  • The wchar_t type on Linux is unsigned int ; on Tru64 UNIX it is signed .
  • The long double data type is the same as double (Tru64 UNIX Version 5.0 makes long double a 16-byte IEEE quad-precision type).
  • The -ieee command-line option on Linux Alpha has additional properties that are not present on Tru64 UNIX systems. See the cxx(1) reference page for more information.
  • Compiler-generated .s files cannot be assembled by the assembler.
  • The compiler and libraries are not multithread-safe.
  • There is no task library.
  • The order of static initialization is inverted. For more information, see Order of Static Object Initialization in Using Compaq C++ for Tru64 UNIX and Linux Alpha .

The C++ compiler accepts some gcc extensions, but is primarily a ISO standard C++ compiler. The following enhancements have been made for compatibility with the GNU C++ compiler:

  • #include_next
  • The __inline keyword is enabled and is equivalent to inline . On non-Linux platforms this keyword is available by specifing -std gnu .
  • The -std gnu option can provide additional compatibility. For details, see the cxx(1) reference page.

Caution

The Compaq C++ compiler is not link-compatible with the GNU C++ compiler. This means that object files or libraries produced with one compiler cannot be linked with object files or libraries produced with the other. The GCC documentation, "info gcc trouble Interoperation" states:
GNU C++ does not do name mangling in the same way as other C++ compilers. This means that object files compiled with one compiler cannot be used with another.

This effect is intentional, to protect you from more subtle problems. Compilers differ as to many internal details of C++ implementation, including: how class instances are laid out, how multiple inheritance is implemented, and how virtual function calls are handled. If the name encoding were made the same, your programs would link against libraries provided from other compilers--but the programs would then crash when run. Incompatible libraries are then detected at link time, rather than at run time.

2 Differences between Compaq C++ and the C++ International Standard

The following item, specified in the C++ International Standard, is not supported in Version 6.3 but will be supported in a future version:

  • The export keyword for templates (Standard §14, paragraph 6; Stroustrup §9.2.3)

3 Supported Linux Alpha Distributions

Compaq C++ has been tested primarily under the Red Hat 6.2 Linux distribution for Alpha. It should, however, work on all distributions with GNU libc 2.1.n and Linux kernel 2.2 or later.

4 Contents of the Compaq C++ CD-ROM

The Compaq C++ CD-ROM contains the following software components:

  • Compaq C++ compiler ( cxx ) command and associated tools
  • Compaq C compiler ( ccc ) command and associated tools
  • Compaq C++ Run-Time environment
  • Compaq C++ libraries
  • Compaq Ladebug debugger
  • Compaq Portable Math Library (CPML) routines (called by Compaq C++ intrinsic procedures)
  • Common Compiler Support Libraries (libots)
  • A version of GNU binutils that supports Compaq C++
  • A version of gdb that minimally supports Compaq C++

Each of the components listed above is installed using the supplied Red Hat Package Manager (RPMtm) files. Documentation files are also provided on the CD-ROM.

5 Downloading and Installing the Kits

The Compaq C++ installation kits are available on the CD-ROM distribution and from the Compaq C++ download site after you have completed the registration form .

5.1 Prerequisites

Compaq C++ requires the following GNU/Linux components:

  • The GNU compiler system
  • The GNU development tools (binutils)

The following are optional:

  • The GNU debugger (gdb)

When Compaq C++ was originally released, support for the Compaq C++ compiler was not included in the development tools provided by all current Linux distributions. Compaq provides replacement development tools for those distributions. Current Linux distributions should already include support for Compaq C++.

If your Linux distribution does not support Compaq C++ and Compaq does not provide suitable development tools for your distribution, you can obtain the latest version of the binutils sources that support Compaq C++ from ftp://ftp.varesearch.com/pub/support/hjl/binutils/ .

To install this version on your system, you must first build a source and binary RPM by entering a command in the following format:


rpm -ta binutils-version.tar.gz 

You can also download the latest version of gdb and build with the libiberty provided by the latest binutils to obtain a debugger that supports Compaq C++.

5.2 Installation Requirements

Compaq C++ requires the following components:

  • The libots Run-Time library
  • The Compaq Portable Math Libraries (CPML)
  • The Compaq C compiler

The following are optional:

  • The Compaq Ladebug debugger

The versioning for libots, CPML, and Ladebug is consistent across Compaq C, C++, and Fortran compiler products. If you have already installed these packages and the packages on the download page or the distribution compact disc are not newer, there is no need to install them again. The Ladebug debugger shipped with the initial releases of Compaq C and Fortran did not support C++.

For better performance of math library routines, you should link against the cpml library instead of libm . Specifying -lm on the command line causes the cxx driver to pass -lcpml -lm to the linker. The cpml library comes in two different packages, only one of which can be installed on a given system:

  • cpml_ev5-version.alpha.rpm
    This package has code that runs best on Alpha chips prior to the EV6 (21264) processor. The code also runs on EV6 machines, but the EV6 version of the package provides code that runs significantly faster on EV6 processors.
  • cpml_ev6-version.alpha.rpm
    This package provides a library that is highly tuned for the EV6 processor, but it will not run on earlier processors (it might produce "Illegal instruction" traps).

The Tru64 UNIX Ladebug debugger has been ported to Linux Alpha. Ladebug is the recommended debugger for Compaq compilers. The GNU debugger (gdb) does not support Compaq C++. Compaq provides a replacement version that has minimal support for Compaq C++. You need this version only if you plan to debug Compaq C++ programs from gdb.

Note

If you encounter problems with the Ladebug debugger, try using the -gall option.

5.3 Installation Instructions

The installation is straightforward with rpm -i if this is the first time the package is being installed, or with rpm -U if the package is being upgraded. The libots package should be installed before either of the cpml packages - the nature of the dependency between them is not handled by rpm 's installation-order dependency checks. You can install the other packages in any order. If you have previously installed a pre-release version of the compiler with a different package name, you should erase that package (using rpm -e ) before installing the cxx package. If you are installing a Beta kit and RPM complains about the package being older, add -oldpackage to the command line.

For example, to install on an EV6 system running RedHat 6.1, on which you have not previously installed a Compaq compiler, begin by installing updated binutils (and optionally gdb), because RedHat 6.1 did not support the Compaq C++ Compiler:


rpm -U compaq_rh61_binutils-2.9.1.0.23-12.alpha.rpm 
rpm -U compaq_rh61_gdb-4.18-6.alpha.rpm 

Then enter the following commands:


rpm -i libots-2.2.7-2.alpha.rpm 
rpm -i cpml_ev6-5.1.0-4.alpha.rpm 
rpm -i ladebug-4.0.65-19.alpha.rpm 
rpm -i ccc-6.4.9.005-1.alpha.rpm 
rpm -i cxx-6.5.9.3-4.alpha.rpm 

Packages other than libots contain documentation files that you can list by entering a command in the following format after the package is installed:


rpm -qd package-name

To list the files before the package is installed, enter a command in the following format:


rpm -qdp package-name

6 Invoking the Compiler

The command line for invoking the compiler and linker is mostly compatible with both the gcc compiler and the Tru64 UNIX compiler. Where possible, command-line options for gcc are translated to near-equivalents for the compiler. Options that do not have Tru64 UNIX equivalents are silently ignored by default. Overall, there is a reasonable probability that a makefile that works on Linux Alpha using the g++ compiler can be used to build the same application with the cxx compiler by changing only the compiler invocation command from g++ to cxx . This change causes cxx to compile .cxx and .cpp files and ccc to compile .c files.

6.1 Simple Optimization

Having successfully built your application with cxx , you might want to try making it run faster.

Specifying the -fast option at the end of your compiler options is a good first step. By default, the -fast option tells the compiler to generate the fastest code for the machine on which the compiler is running. If you compile on an advanced processor like EV6 (for example, a DS10 machine), the code might produce "Illegal instruction" traps if you try to run it on an older machine. If you want to try some quick tuning but want to make sure the result will run on any Alpha machine, specify -fast -arch generic . You might also want to try adding -O4 to enable optimizations that could further improve performance. Be aware however, that under some conditions, these optimizations could degrade performance.

The cxx(1) reference page and Using Compaq C++ for Tru64 UNIX and Linux Alpha contain more information about optimization controls and tuning. See the documentation section for the location and status of the documentation in this kit.

6.2 Using GNU Development Tools with Compaq C++

In binutils, some tools demangle by default; others require that you specify the --demangle option. To use the Compaq demangler, you must also specify the --style=compaq option. The --style option was added in binutils version 2.9.5 or later and has been ported to version 2.9.1 in the released kits.

Affected tools are: ld , objdump , gprof , nm , and addr2line .

To use the Compaq demangler in gdb, specify the command set demangle-style compaq .

7 Documentation

The following documentation is provided in HTML format on the installed system under the directory /usr/doc/cxx-6.5.9.3 .

The cxx(1) reference page is derived from the cxx(1) reference page for Tru64 UNIX. It has been edited significantly to reflect differences between Tru64 UNIX and Linux Alpha behaviors.

8 Redistributing Run-Time Libraries with Applications

Users with a valid license are permitted to redistribute the libots and cpml Run-Time library packages included in the product, as follows.

If the application is linked with the -non_shared option ( -static in gcc terms), or is linked against the archive library ( .a ) form of these libraries, no redistribution is necessary (although it is permitted).

If the application is linked -call_shared ( -dynamic in gcc terms) and depends on libots.so and/or libcpml.so , then it is necessary for you to provide these libraries along with your application. The libraries should be redistributed in the form of the original RPMs (or updated versions of them) as provided by Compaq, and the users of the application should be advised to install them on the systems that will run the application.

If you redistribute cpml_ev6 , you need to caution your users that it should only be installed on an EV6 or newer version of the Alpha processor. The cpml_ev5 package can be installed on any version of the Alpha processor, but will not provide maximum performance on EV6 or newer processors.

9 Release Notes

The following sections contain information about the current release.

9.1 Enahancements, Changes, and Problems Corrected in Version V6.3A: V6.3-010

  • <cname> headers are now provided.
  • -xtaso is now support on systems with -taso support in ld.
  • Better locale support in the compiler.
  • New backend code generator.
  • Pre-2.1.n libc systems are no longer supported. This includes Red Hat 5.2.
  • Pre-2.2 kernels are no longer supported.

10 Known Problems and Restrictions for the Linux Alpha Operating System

This section describes known problems and restrictions for the Linux Alpha operating system.

10.1 Known Problems

Known problems are as follows:

  • Inputting a pointer to void argument using the standard iostreams insertion operator>>(void*&) does not work.

10.2 Restrictions

Restrictions are as follows;

  • On some Linux releases, the header file /use/include/wctype.h incorrectly defines wctrans_t as __const unsigned int * , while the Compaq C++ implementation expects __const int * . As a result, you might see an "incompatible parameter" error.
    This error is discretionary and can be disabled by specifying -msg_disable incompatibleprm on the command line or by enclosing your code within a #pragma, as shown in the following example:


    #include <wctype.h> 
     
    int main() { 
            wint_t w = L'a'; 
    #pragma message save 
    #pragma message disable incompatibleprm 
            towupper(w);  // This statement causes the error 
    #pragma message restore 
            return 0; 
    } 
    

  • On Linux, the linker command ld supports an option of the form -B<static/dynamic/symbolic> . This option conflicts with the Compaq C++ compiler -B option is not supported.
  • The Class Library iomanipulators lock() and unlock() are no-ops. In other words, you can use them, but they do nothing.
    Some undocumented Class Library iostream functions provided on Tru64 UNIX for backward compatibility only are not available on Linux Alpha; for example: streambuf::xsputn() and streambuf::xsgetn() . You should use the documented versions instead ( streabuf::sputn() and streambuf::sgetn() ).
    You cannot use the GNU library headers with Compaq C++ library executables, and you cannot use Compaq C++ headers with the GNU library executables, even if the names of the classes are the same.
    The Class Library, libcxx , is not distributed in shared form. You must use the archive version.
    Some of the Red Hat 5.2 locale files are bad. For example, trying to set locale to the ja_JP.EUC locale does not work. Even on Red Hat 6.0, you may get inconsistent results from Tru64 Unix. For example, the Hungarian thousands_sep() is a space on Tru64 Unix but a null character on Linux Alpha. The discrepancy is due to the differing locale information provided by the two operating systems.

11 Known Library Restrictions

The following are restrictions:

  • The Class Library task package is not supported on the Linux Alpha platform.
  • The Class and Standard Libraries are not multithread-safe.

12 Downloading Updates and Learning about Related Products

For information about downloading updates to Compaq C++, Compaq Ladebug, CPML, and related products for Linux Alpha systems, please see the following Web page:

http://www.compaq.com/linux/

For information about other third-party products for the Linux Alpha platform, please see the following Web page:

http://www.alphalinux.org/

13 Suggestion/Problem Reporting

Premium support is available in per-incident "call packs" from Compaq Services in the US and some other countries. For information in the US and Canada, call, toll-free, 1-800-344-4825. In other countries, please contact your local Compaq office to see whether support is available.

Free support is limited to bug reports that can be sent to compaq_cxx.bugs@compaq.com . Send a complete but short example reproducing the problem, including the following:

  • Compiler and operating system versions
  • All necessary sources (such as INCLUDE files and module sources)
  • Data files
  • Commands used to compile, link and run the program
  • Expected results and incorrect results obtained

Please try to reduce the problem to as small a source as possible, because we may be unable to diagnose large applications.

We answer most quickly those problem reports that include a small but complete reproducible example, along with descriptions of the compile and link options used and the exact text of any diagnostic messages or other incorrect results. Reports that include only program fragments or involve very large applications generally take longer to diagnose.

Please note that this is not a "programming consulting service" and you should have clear evidence of a product problem before contacting us. If you consulting services, please contact Compaq Services.

If your question is about how to use some aspect of the product, or how to program using Compaq C++, visit the newsgroup comp.os.linux.alpha, where you can post questions and share experiences with other Alpha Linux users.

Contents

Buy Online or Call 1.800.888.0220      privacy statement and legal notices 
STORES CONTACT US SEARCH PRODUCTS SOLUTIONS OPTIONS DEVELOPERS