Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
10 Views

Differences between icc on Mac & PC

Hi, I'm trying to port an existing code base from PC to Mac. We have Composer XE 2011 update 4 installed on both machines (12.0.4.196 on pc and 12.0.4.184 on mac). Our code compiles on pc, but not on mac. Most of the issues are to do with how icc handles templates, with the mac version apparently being a lot stricter, i.e. having to redeclare typedefs when deriving from template base classes, needing "using BaseClass::myVar" when using a member variable in a template base class etc. Can anyone explain why these inconsistancies exist? The only reason I can think of is that the mac version is actually behind on template support, or that there are some subtle compiler options that i need to set up. Any thoughts anyone?
0 Kudos
7 Replies
Highlighted
Employee
10 Views


On Windows we emulate the installedversion of the Microsoft compiler and on Mac we emulate the installed version ofGnu compiler. If we did not do this then we would not be source and binary compatible and the system headers would not necessarily work correctly.

On Mac you cantry the-fms-dialect option which might help.

Judy
0 Kudos
Highlighted
Employee
10 Views

Most differences between icc on different platforms result from our effort to be as compatible and consistent as possible with the leading compiler on each platform. On Windows, that's MSVC++, on Mac it's gcc. The releases are in synch across platforms, so I don't believe that there's any way in which one is ahead of another. If the problems you're seeing are warnings or numbered errors, you can control their presence or absence with command line options (-diag-disable on mac).
If you can list some specific compilable examples I might be able to help you out.
Dale
0 Kudos
Highlighted
Beginner
10 Views

Thank you for your answers. I've tried the -fms-dialect option which looks like it should do the job nicely, but I'm having a few more problems. Firstly Iget problems with xmmintrin.h which pulls in if _MSC_VER is defined. After resolving that, I get lots of problems with tbb not compiling (paths not set up etc) which I find odd being as tbb are internal libraries that come with icc. Is the intention of the dialect switch that we should build our project against the headers that ship with the microsoft compiler as it sounds a bit dubious legally. I'll keep plugging away at it for the time being. Thanks again.
0 Kudos
Highlighted
Employee
10 Views

Any chance you could post a small test case that illustrates the problem?
Thanks!
Dale
0 Kudos
Highlighted
Employee
10 Views

You could try undefining _MSC_VER like so:

-U_MSC_VER

Dale

0 Kudos
Highlighted
Beginner
10 Views

Fantastic. That all worked a treat. Sometimes the solution is just staring you in the face. Thank you very much :)
0 Kudos
Highlighted
Employee
10 Views


I submittedd a bug report about the problem with the xmmintrin.hheader file and the -fms-dialect option. So that should eventually be fixed. We will probably just disable the _MSC_VERmacro.Thanks for pointing out the problem.
0 Kudos