Skip to content

Commit b3373a0

Browse files
Merge pull request #165 from adrn/conditional-openmp-mac
Add a conditional disable of passing openmp flags on mac with clang
2 parents 42ef746 + ba4d589 commit b3373a0

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

expui/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ if(ENABLE_UTILS)
115115
foreach(program ${bin_PROGRAMS})
116116
target_link_libraries(${program} expui exputil ${common_LINKLIB})
117117
target_include_directories(${program} PUBLIC ${common_INCLUDE})
118-
target_compile_options(${program} PUBLIC ${OpenMP_CXX_FLAGS})
118+
# temporary Apple clang fix
119+
if(NOT (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
120+
target_compile_options(${program} PUBLIC ${OpenMP_CXX_FLAGS})
121+
endif()
119122
install(TARGETS ${program} DESTINATION bin)
120123
endforeach()
121124

pyEXP/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ pybind11_add_module(pyEXP PyWrappers.cc CoefWrappers.cc
4040
ParticleReaderWrappers.cc MSSAWrappers.cc EDMDWrappers.cc)
4141
target_link_libraries(pyEXP PUBLIC expui exputil ${common_LINKLIB})
4242
target_include_directories(pyEXP PUBLIC ${common_INCLUDE})
43-
target_compile_options(pyEXP PUBLIC ${OpenMP_CXX_FLAGS})
43+
# TODO: Should find a proper solution for this, but for now, don't add OpenMP compile
44+
# options if compiling on macOS with Clang
45+
if(NOT (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
46+
target_compile_options(pyEXP PUBLIC ${OpenMP_CXX_FLAGS})
47+
endif()
4448
get_target_property(cxxflags pyEXP COMPILE_OPTIONS)
4549
message("The project has set the following flags: ${cxxflags}")
4650

0 commit comments

Comments
 (0)