gcc* Interoperability

C++ compilers are interoperable if object files and libraries generated by one compiler can be linked with object files and libraries generated by the second compiler, and the resulting executable runs successfully. The Intel® C++ Compiler 8.0 has made significant improvements towards interoperability and compatibility with the GNU gcc* compiler. This section describes new interoperability options.

See gcc Compatibility for a detailed list of compatibility features.

Interoperability Compiler Options

The Intel® C++ Compiler options that affect gcc interoperability include:

-cxxlib-gcc option

The -cxxlib-gcc option lets you to build your applications using the C++ libraries and header files included with the gcc compiler. They include:

When you compile and link your application using the -cxxlib-gcc option, the resulting C++ object files, libraries, and executables can interoperate with C++ object files, libraries, and executables generated by gcc 3.2. This means that third-party C++ libraries built with gcc 3.2 will work with C++ code generated by the Intel Compiler 8.0.

The -cxxlib-gcc option can only be used on Linux distributions that include gcc 3.2. This is required for C++ ABI conformance.

By default, the Intel C++ Compiler uses headers and libraries included with the product. If you are linking with code compiled with g++, which was compiled against gnu C++ headers, then differences in the headers might cause incompatibilities that result in run-time errors.

If you build one shared library against the Intel C++ libraries, build a second shared library against the gnu C++ libraries, and use both libraries in a single application, you will have two C++ run-time libraries in use. Since the application might use symbols from both libraries, the following problems may occur:

The Intel C++ Compiler does not support more than one run-time library in one application.

Warning

If you successfully compile your application using more than one run-time library, the resulting program will likely be very unstable, especially when new code is linked against the shared libraries.

You should use the -cxxlib-gcc option if your application includes source files generated by g++ and source files generated by the Intel C++ Compiler. This option directs the Intel compiler to use the g++ header and library files to build one set of run-time libraries. As a result, your program should run correctly.

-gcc-name option

The -gcc-name=name  option, used with -cxxlib-gcc, lets you specify the location of g++* if the compiler cannot locate the gcc C++ libraries. Use this option when referencing a non-standard gcc installation.

-gcc-version

The -gcc-version=nnn  option provides compatible behavior with gcc, where nnn  indicates the gcc version. This version of the Intel compiler supports -gcc-version=320 (ON by default).

Default Libraries and Headers

The -cxxlib-icc option directs the Intel compiler to use the C++ run-time libraries and C++ header files included with the Intel compiler. They include:

The -cxxlib-icc option is ON by default and can be used with any supported Linux distribution. See Release Notes.

Summary of Corresponding Libraries and Headers

Intel Library/Header gcc Library/Header
libcprts libstdc++
libcxa/libunwind libgcc

gcc Predefined Macros

The Intel C++ Compiler 8.0 includes new predefined macros also supported  by gcc:

You can specify the -no-gcc option if you do not want these macros defined. If you need gcc interoperability (-cxxlib-gcc),  do not use the -no-gcc compiler option.

See also GNU Environment Variables.