Intel® C++ Compiler 16.0 User and Reference Guide
The Intel® C++ Compiler is compatible with most versions of the GNU Compiler Collection (gcc*). The release notes contains a list of compatible versions.
C language object files created with the Intel® C++ Compiler are binary compatible with gcc* and C/C++ language library. You can use the Intel ® C++ Compiler or the gcc* compiler to pass object files to the linker. To pass IPO mock object files or libraries of IPO mock object files produced by the Intel® C++ Compiler to the linker, use the linking tools provided with the Intel® C++ Compiler. Specifically:
On Linux*/OS X* (with EDG compiler) use icc, icpc, ifort, xild, and xiar.
On OS X* (with CLANG compiler) use icl, icl++, xild and xiar.
Link-time optimization using the -ffat-lto-objects compiler option is provided for gcc* compatibility. This implies that ld and ar can be used to link and archive object files, but by doing so you will lose cross-file optimizations. You can use the -fno-fat-lto-objects compiler option when linking using IPO mock object files, provided that you link the IPO mock object files with xild and archive them with xiar.
The Intel® C++ Compiler supports many of the language extensions provided by the GNU compilers. See http://www.gnu.org for more information.
Statement expressions are supported, except the following are prohibited inside them:
dynamically-initialized local static variables.
local non-POD class definitions.
try/catch.
variable length arrays.
The Intel® C++ Compiler supports gcc-style inline ASM if the assembler code uses AT&T* System V/386 syntax.
C++ compilers are interoperable if they can link object files and libraries generated by one compiler with object files and libraries generated by the second compiler, and the resulting executable runs successfully. The Intel® C++ Compiler is highly compatible with the GNU compilers.
The Intel® C++ Compiler and GNU gcc* compiler support the following predefined macros:
__GNUC__
__GNUG__
__GNUC_MINOR__
__GNUC_PATCHLEVEL__
You can specify the -no-gcc option to undefine these macros. If you need gcc* interoperability (-cxxlib), do not use the -no-gcc compiler option.
Not defining these macros results in different paths through system header files. These alternate paths may be poorly tested or otherwise incompatible.
The Intel compiler uses the GNU* tools on the system, such as the GNU header files, including stdio.h, and the GNU linker and libraries. So the Intel compiler has to be compatible with the version of gcc or g++ you have on your system. For example, if you have gcc version 4.6 on your system, icc behaves like gcc 4.6, with the compatible features and behaviors.
By default, the compiler determines which version of gcc or g++ you have installed from the PATH environment variable.
If you want use a version of gcc or g++ other than the default version on your system, you need to use either the -gcc-name or -gxx-name compiler option to specify the path to the version of gcc or g++ that you want to use. For example:
You want to build something that cannot be compiled by the default version of the system compiler, so you need to use a legacy version for compatibility, such as if you want to use third party libraries that are not compatible with the default version of the system compiler.
You want to use a later version of gcc or g++ than the default system compiler.
The Intel compiler driver uses the default version of gcc/g++, or the version you specify, to extract the location of the headers and libraries.
The cxxlib options are connected to linking in the GNU C++ library. These options are not directly related to -gcc-name or -gxx-name.
-cxxlib-nostd prevents the compiler from searching the C++ system include directories for the C++ standard library libstdc++. For example: If you specify -cxxlib-nostd, then #include <iostream> does not compile but #include <stdio.h> does. This option also prevents linking of libstdc++, because the driver leaves off the -lstdc++ option.
-no-cxxlib affects the linking of all C++ runtime libraries, not just libstdc++. So a program that only uses printf, for example, does not link if you specify -no-cxxlib, but it does link if you specify -cxxlib-nostd.
-cxxlib=dir modifies the top level location for binaries and libraries. For example, if you specify icc -gxx-name=/my/directory/g++ -cxxlib=/cxxlib/dir, the driver attempts to find g++ in /cxxlib/dir/my/directory
The Intel® C++ Compiler includes improved support for the following open source tools:
GNU Libtool – a script that allows package developers to provide generic shared library support.
Valgrind – a flexible system for debugging and profiling executables running on x86 processors.
GNU Automake – a tool for automatically generating Makefile.ins from files called Makefile.am.