Compiler Options for Interoperability

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

-gcc-name option

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

-gcc-version option

The -gcc-version=nnn option provides compatible behavior with gcc, where nnn indicates the gcc version. The -gcc-version option is ON by default, and the value of nnn depends on the version of gcc installed on your system. This option selects the version of gcc with which you achieve ABI interoperability.

Installed Version
of gcc

Default Value
of -gcc-version

older than
version 3.2

not set

3.2

320

3.3

330

3.4

340

4.0

400

4.1

410

4.2

420

4.3

430

-gxx-name option

The -gxx-name=dir option specifies that the g++ compiler should be used to set up the environment for C++ compilations.

-cxxlib option

The -cxxlib[=dir] option (ON by default) builds your applications using the C++ libraries and header files included with the gcc compiler. They include:

Use the optional argument, =dir, to specify the top-level location for the gcc binaries and libraries.

Note iconNote

The Intel C++ Compiler is compatible with gcc 3.2, 3.3, 3.4, 4.0, 4.1 and 4.2.

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

Note iconNote

gcc 3.2, 3.3, and 3.4 are not interoperable. gcc 4.0, 4.1, and 4.2 are interoperable. By default, the Intel compiler will generate code that is interoperable with the version of gcc it finds on your system.

By default, the Intel C++ Compiler uses headers and libraries included with the product, when the system includes a version of gcc less than 3.2.

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.

Caution iconCaution

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.

-fabi-version

The -fabi-version=n option directs the compiler to select a specific ABI implementation. By default, the Intel compiler uses the ABI implementation that corresponds to the installed version of gcc. Both gcc 3.2 and 3.3 are not fully ABI-compliant.

Value of n

Description

n=0

Select most recent ABI implementation

n=1

Select g++ 3.2 compatible ABI implementation

n=2

Select most conformant ABI implementation

See Also