Skip to content

Commit

Permalink
fix cray clang OpenMP linker issues
Browse files Browse the repository at this point in the history
CMake is not setting the linker flag `-fopenmp`  for the cray clang
compiler.
  • Loading branch information
psychocoderHPC committed Sep 23, 2024
1 parent 128d446 commit 3cacd23
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmake/alpakaCommon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,12 @@ if(alpaka_ACC_CPU_B_OMP2_T_SEQ_ENABLE OR alpaka_ACC_CPU_B_SEQ_T_OMP2_ENABLE)
else()
find_package(OpenMP REQUIRED COMPONENTS CXX)
target_link_libraries(alpaka INTERFACE OpenMP::OpenMP_CXX)
# shown with CMake 3.29 and cray clang 17
# workaround: cmake is missing to add '-fopenmp' to the linker flags
if(CMAKE_CXX_COMPILER_ID STREQUAL "CrayClang")
target_link_libraries(alpaka INTERFACE -fopenmp)
endif()
find_package(OpenMP COMPONENTS CXX)
endif()
endif()

Expand Down

0 comments on commit 3cacd23

Please sign in to comment.