I have had some issues with icpc (18.0.0) and gcc version compatibility on osx. I have things working now, but the output warnings from the compiler is confusing and I'm not sure if I'm doing something the "wrong" way.
Specifically, I have some code that does not compile using icpc without additional flags on osx, but works fine on linux. I isolated the cause to be gcc compatibility, and the fact that a header-only template library I am using requires advanced features. Using icpc normally results in various errors when compiling the code. This is the version and gcc compatibility:
$ icpc -v -c icpc version 18.0.0 (gcc version 4.9.0 compatibility)
If I only select a different gcc-name, it makes no difference, and I still get errors when compiling my code:
$ icpc -v -gcc-name=gcc-7 -c icpc: command line warning #10006: ignoring unknown option '-gcc-name=gcc-7' icpc version 18.0.0 (gcc version 4.9.0 compatibility)
$ icpc -v -no-use-clang-env -gcc-name=gcc-7 -c icpc: command line warning #10006: ignoring unknown option '-no-use-clang-env' icpc: command line warning #10006: ignoring unknown option '-gcc-name=gcc-7' icpc: warning #10376: '-stdlib=libc++' is only supported in the Clang environment (-use-clang-env) icpc version 18.0.0 (gcc version 7.2.0 compatibility)
This is quite confusing since it says it is ignoring unknown options but they are not completely ignored. In fact, my code compiles with these flags but the linker then fails to find various variables, as one might expect from warning #10376. In order to get the linker to work I must also link with the flags
where you can see that my gcc-7.2.0 is from homebrew. It is possible to avoid icpc warning #10376 by using the flag -stdlib=libstdc++ when compiling, but the line above is still required to link properly.
Is this the right way to go about things?
On a different but related note, on linux when using the flag '-gcc-name=gcc-7' there is no warning but the output is a little confusing:
$ icpc -v -gcc-name=gcc-7 -c icpc version 18.0.0 (gcc version 7.0.0 compatibility)
even though my gcc-7 is version 7.2.0. Everything seems to work just fine, however.