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 (188.8.131.52 on pc and 184.108.40.206 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?
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.
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.
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.
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.