Search code examples
c++macosclangopenmp

Is there a difference between Apple Clang and OpenMP-enabled Clang from Homebrew?


I want to know if there are any advantages in Apple's provided Clang compiler compared to the Clang compiler that comes with OpenMP available from Homebrew? Will there be any performance loss if switching to OpenMP Clang (regardless of the multi-threading ability)?

I also found this old question that has no good answer


Update

I compiled the OOFEM using Apple's Clang and mainstream Clang and ran the same problem,

Apple's Clang: Real time consumed: 000h:01m:26s

Mainstream Clang: Real time consumed: 000h:01m:24s

With multi-threading enabled also the performance is similar. One difference that I also noticed, is that Apple's Clang seems to ignore some CMake options e.g. -DOpenMP_CXX_FLAGS="-I/usr/local/opt/libomp/include" has no effect with Apple's Clang while works fine with the mainstream Clang.


Solution

  • Is there a difference?

    As stated that answers itself. They're two different compilers and we don't know what Apple have done inside theirs. We do know that they don't provide OpenMP support, so that is at least one difference.

    Will there be any performance loss if switching to OpenMP Clang (regardless of the multi-threading ability)?

    I doubt it, but since you're clearly measuring performance and playing with both compilers, you seem in a good position to tell us :-)