Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion expui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ if(ENABLE_UTILS)
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})
# temporary Apple clang fix
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()

Expand Down
6 changes: 5 additions & 1 deletion pyEXP/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider checking if OpenMP was actually found before applying flags. The condition should verify OpenMP_CXX_FOUND to ensure OpenMP is available on the system. This prevents attempting to use undefined ${OpenMP_CXX_FLAGS} on systems without OpenMP support.

Suggested change
if(NOT (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
if(OpenMP_CXX_FOUND AND NOT (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our flag is OpenMP_FOUND as far as I can tell; this could be a possible change but I'm not sure if we need to.

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}")

Expand Down