Skip to content

Commit e8766b0

Browse files
committed
- mac fix
1 parent 45f1683 commit e8766b0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CMake/Common.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ endif()
7474

7575
option(USE_OpenMP "Use OpenMP" ON)
7676
if(USE_OpenMP)
77+
# Add the default openmp installation directory for apple systems
78+
if(APPLE)
79+
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH};/opt/homebrew/opt/libomp)
80+
endif()
7781
FIND_PACKAGE(OpenMP)
7882
if(OPENMP_FOUND)
7983
if (CMAKE_VERSION VERSION_GREATER "3.8")
@@ -82,6 +86,8 @@ if(USE_OpenMP)
8286
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
8387
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
8488
endif()
89+
else()
90+
message("OpenMP could not be found. On Apple devices, make sure to install it with `brew install libomp`.")
8591
endif()
8692
endif()
8793

0 commit comments

Comments
 (0)