The Intel® C++ Compiler options that affect gcc* interoperability include:
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.
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 |
The -cxxlib[=dir] option lets you to build 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
The Intel C++ Compiler is compatible with gcc 3.2, 3.3, 3.4, 4.0, 4.1 and 4.2. The -cxxlib option is ON by default if you are using gcc 3.2, 3.3, 3.4, 4.0, 4.1, or 4.2.
When you compile and link your application using the -cxxlib option, 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.
The -cxxlib option can only be used on Linux distributions that include gcc 3.2 or higher. This is required for C++ ABI conformance.
Note
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.
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 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.
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 |