Skip to content

Commit 01fe80a

Browse files
committed
hint OpenMP directory for cmake on MacOS
1 parent 5875e80 commit 01fe80a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ target_sources(MCsquare
116116

117117
set_property(TARGET MCsquare PROPERTY C_STANDARD 99)
118118

119+
# Find MKL for static linking
119120
set(MKL_LINK "static" CACHE STRING "MKL Link Type")
120121
find_package(MKL CONFIG)
121122
if (MKL_FOUND)
@@ -129,7 +130,12 @@ if (MKL_FOUND AND USE_MKL_LIB)
129130
endif(MKL_FOUND AND USE_MKL_LIB)
130131

131132
#Find OpenMP package and determine version... not working well at the moment (Version not read)
132-
find_package(OpenMP)
133+
set(OpenMP_HINTS "")
134+
if(APPLE)
135+
list(APPEND OpenMP_HINTS "/opt/homebrew/opt/libomp/")
136+
endif()
137+
138+
find_package(OpenMP REQUIRED HINTS OpenMP_HINTS)
133139
if (OpenMP_C_FOUND)
134140
# Enable appropriate OpenMP flags based on compiler
135141
if(MSVC)

0 commit comments

Comments
 (0)