Intel® C++ Compiler XE 13.1 User and Reference Guides
This section describes a basic approach to porting applications from GCC*'s C/C++ compilers to the Intel® C/C++ compilers. These compilers correspond to each other in the following ways:
|
Language |
Intel Compiler |
GCC* Compiler |
|---|---|---|
|
C |
icc |
gcc |
|
C++ |
icpc |
g++ |
It also contains information on how to use the -diag enable port-win option to issue warnings about general syntactical problems when porting from GNU gcc* to Microsoft* C++.
To simplify this discussion on porting applications, the term "gcc" , unless otherwise indicated, refers to both gcc and g++ compilers from the GNU Compiler Collection*.
In many cases, porting applications from gcc to the Intel compiler can be as easy as modifying your makefile to invoke the Intel compiler (icc) instead of gcc. Using the Intel compiler typically improves the performance of your application, especially for those that run on Intel processors. In many cases, your application's performance may also show improvement when running on non-Intel processors. When you compile your application with the Intel compiler, you have access to:
compiler options that optimize your code for the latest Intel processors.
advanced profiling tools (PGO) similar to gprof.
high-level optimizations (HLO).
interprocedural optimization (IPO).
Intel intrinsic functions that the compiler uses to inline instructions, including Intel® SSE, Intel® SSE2, Intel® SSE3, SSSE3, and Intel® SSE4.
highly-optimized Intel Math Library for improved accuracy.
Since the Intel compiler is compatible and interoperable with gcc, porting your gcc application to the Intel compiler includes the benefits of binary compatibility. As a result, you should not have to re-build libraries from your gcc applications. The Intel compiler also supports many of the same compiler options, macros, and environment variables you already use in your gcc work.
For many gcc applications, porting to the Intel compiler requires little more than modifying your makefile to account for differences that may exist between compiling with gcc and compiling with icc.
One challenge in porting applications from one compiler to another is making sure there is support for the compiler options you use to build your application. The Compiler Options reference lists compiler options that are supported by both the Intel® C++ Compiler and gcc.
Next Steps
|
Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice. Notice revision #20110804 |