![gcc for mac 10.8 gcc for mac 10.8](https://www.cyberciti.biz/media/new/images/faq/2013/06/Mountain-Lion-10.8.x-install-gcc-xcode.png)
opt/local/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:291 (_FPHSA_FAILURE_MESSAGE) Performing Test OpenMP_FLAG_DETECTED - FailedĬMake Error at /opt/local/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (message):Ĭould NOT find OpenMP (missing: OpenMP_C_FLAGS OpenMP_CXX_FLAGS) When CMake tries to find OpenMP ( FIND_PACKAGE(OpenMP) ) I get the following output: - The compiler is /opt/local/bin/gcc-apple-4.2 Set(CMAKE_CXX_COMPILER "/opt/local/bin/gcc-apple-4.2")Īnd I also added two environments variables: export CXX=/opt/local/bin/gcc-apple-4.2 In the root CMakeLists.txt I added the following two lines: set(CMAKE_C_COMPILER "/opt/local/bin/gcc-apple-4.2") The problem now is that CMake keeps using the llvm compiler.
![gcc for mac 10.8 gcc for mac 10.8](https://i.stack.imgur.com/dcxxs.png)
#Gcc for mac 10.8 code
Yesterday I installed gcc 4.2 via macports, but - as of today - my code is still in source form because - for some strange reasons - I am not able to switch the compilation to gcc (same errors related to OpenMP). The building is based on CMake and make/gcc. I cannot believe many programs based on OpenMP will not run any more on OS X, so my question is: how can I enable OpenMP in Mountain Lion?Īfter reading the excellent answer of Hristo Iliev, I think I missing more than I initially thought. Unfortunately 'llvm' does not (yet?) support OpenMP. I am no longer able to build my (simple) parallel code that uses OpenMP.īy looking here and there I understood that Apple is no more using 'gcc' but 'llvm' - quite likely due to licence-related issues. I have just upgraded to OS X 10.8 "Mountain Lion" and I start regretting having done that.