Skip to content

Commit

Permalink
Using new libomp in homebrew
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Feb 28, 2018
1 parent eb23cc8 commit 0f6e5af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions PatchOpenMPApple.cmake
Expand Up @@ -2,15 +2,15 @@

option(APPLE_OMP_AUTOADD "Add OpenMP if using AppleClang" ON)

if("${APPLE_OMP_AUTOADD}" AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9")
if("${APPLE_OMP_AUTOADD}" AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "7")

message(STATUS "AppleClang >= 9.0 detected, adding OpenMP. Disable with -DAPPLE_OMP_AUTOADD=OFF")
message(STATUS "AppleClang >= 7.0 detected, adding OpenMP. Disable with -DAPPLE_OMP_AUTOADD=OFF")

find_program(BREW NAMES brew)
if(BREW)
execute_process(COMMAND ${BREW} ls libomp RESULT_VARIABLE BREW_RESULT_CODE OUTPUT_QUIET ERROR_QUIET)
if(BREW_RESULT_CODE)
message(STATUS "GooFit supports OpenMP on Mac through Brew. Please run \"brew install cliutils/apple/libomp\"")
message(STATUS "GooFit supports OpenMP on Mac through Brew. Please run \"brew install libomp\"")
else()
execute_process(COMMAND ${BREW} --prefix libomp OUTPUT_VARIABLE BREW_LIBOMP_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
set(OpenMP_CXX_FLAGS "-Xpreprocessor -fopenmp")
Expand Down

0 comments on commit 0f6e5af

Please sign in to comment.