Skip to content

Commit

Permalink
Fix OpenMP on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
cybaol committed Sep 20, 2024
1 parent 3b44145 commit 44d3154
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,13 @@ endif()
# OpenMP (optional)
option(WITH_OPENMP "Build with parallelization using OpenMP" TRUE)
if(WITH_OPENMP)
if(APPLE)
set(OpenMP_C_FLAGS "-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include")
set(OpenMP_C_LIB_NAMES "omp")
set(OpenMP_CXX_FLAGS "${OpenMP_C_FLAGS}")
set(OpenMP_CXX_LIB_NAMES "${OpenMP_C_LIB_NAMES}")
set(OpenMP_omp_LIBRARY "/usr/local/opt/libomp/lib/libomp.dylib")
endif()
find_package(OpenMP COMPONENTS C CXX)
endif()
if(OpenMP_FOUND)
Expand Down

0 comments on commit 44d3154

Please sign in to comment.