Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7953 Discussions

How portable is Intel C++ Compiler.

jose-maria-gomez-ver
536 Views
I would like to know if Intel C++ Compiler is exactly the same for all platform. I mean.. Should I expect different behaviors in my code when are compiled in different platforms?

I guess that the parameters that Intel C++ Compiler is the same for all platform. So.. could I take from Eclipse or Visual Studio the command line to run the compiler from the console in a easy way?

Thanks in advance.
0 Kudos
1 Solution
Brandon_H_Intel
Employee
536 Views
Tim is right. The Intel C++ Compiler aims mostly for compatibility with the Microsoft* compiler on Windows* and gcc* on Linux*. There are source and binary differences between the two. For example, you use __declspec on Windows* whereas you would use __attribute__ on Linux* for certain compiler extensions. From a binary perspective, there are differences in the ABI on the two operating systems that can affect how the compiler is required to generate code that can affect optimizations.

Where there are no such requirements, you can expect the Intel compiler to behave pretty similarly across platforms. PGO for example works exactly the same on both platforms, except for the slight option name changes Tim refers to.

View solution in original post

0 Kudos
2 Replies
TimP
Honored Contributor III
536 Views
Obviously, the command line options are spelled differently in the Windows compilers, but the options do have consistent meanings between the Intel compilers of the same version numbers:
/Qansi-alias vs. -ansi-alias
/arch:SSE3 vs. -msse3
/fp:source vs. -fp-model source (Microsoft /fp:fast)
.....
and the Visual Studio buildlog gives you a bunch of Microsoft specific spellings in addition to Intel ones.
0 Kudos
Brandon_H_Intel
Employee
537 Views
Tim is right. The Intel C++ Compiler aims mostly for compatibility with the Microsoft* compiler on Windows* and gcc* on Linux*. There are source and binary differences between the two. For example, you use __declspec on Windows* whereas you would use __attribute__ on Linux* for certain compiler extensions. From a binary perspective, there are differences in the ABI on the two operating systems that can affect how the compiler is required to generate code that can affect optimizations.

Where there are no such requirements, you can expect the Intel compiler to behave pretty similarly across platforms. PGO for example works exactly the same on both platforms, except for the slight option name changes Tim refers to.
0 Kudos
Reply