From 6ee7ae137cfa2fd75c63b18722a2f176d6ec35a8 Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan <583379+adrn@users.noreply.github.com> Date: Tue, 14 Oct 2025 11:09:52 -0400 Subject: [PATCH] add a conditional disable of passing openmp flags on mac with clang --- expui/CMakeLists.txt | 6 +++++- pyEXP/CMakeLists.txt | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/expui/CMakeLists.txt b/expui/CMakeLists.txt index 25f438d0a..0ccf07d9b 100644 --- a/expui/CMakeLists.txt +++ b/expui/CMakeLists.txt @@ -58,6 +58,10 @@ add_executable(testread testread.cc) foreach(program ${bin_PROGRAMS}) target_link_libraries(${program} expui exputil ${common_LINKLIB}) target_include_directories(${program} PUBLIC ${common_INCLUDE}) - target_compile_options(${program} PUBLIC ${OpenMP_CXX_FLAGS}) + # TODO: Should find a proper solution for this, but for now, don't add OpenMP compile + # options if compiling on macOS with Clang + if(NOT (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")) + target_compile_options(${program} PUBLIC ${OpenMP_CXX_FLAGS}) + endif() install(TARGETS ${program} DESTINATION bin) endforeach() diff --git a/pyEXP/CMakeLists.txt b/pyEXP/CMakeLists.txt index dc8cebf0e..8d8f24d1f 100644 --- a/pyEXP/CMakeLists.txt +++ b/pyEXP/CMakeLists.txt @@ -40,7 +40,11 @@ pybind11_add_module(pyEXP PyWrappers.cc CoefWrappers.cc ParticleReaderWrappers.cc MSSAWrappers.cc EDMDWrappers.cc) target_link_libraries(pyEXP PUBLIC expui exputil ${common_LINKLIB}) target_include_directories(pyEXP PUBLIC ${common_INCLUDE}) -target_compile_options(pyEXP PUBLIC ${OpenMP_CXX_FLAGS}) +# TODO: Should find a proper solution for this, but for now, don't add OpenMP compile +# options if compiling on macOS with Clang +if(NOT (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")) + target_compile_options(pyEXP PUBLIC ${OpenMP_CXX_FLAGS}) +endif() get_target_property(cxxflags pyEXP COMPILE_OPTIONS) message("The project has set the following flags: ${cxxflags}")