Skip to content

Commit

Permalink
Adding OpenMP library when linking against Kokkos unit test with Open…
Browse files Browse the repository at this point in the history
…MP back end.
  • Loading branch information
khuck committed Mar 22, 2024
1 parent cd5913f commit b95e0db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/unit_tests/Kokkos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ foreach(example_program ${example_programs})
set(sources ${example_program}.cpp)
source_group("Source Files" FILES ${sources})
add_executable("${example_program}_kokkos" ${sources})
target_link_libraries ("${example_program}_kokkos" apex ${Kokkos_LIBRARY} ${LIBS})
if (OPENMP_FOUND)
set_target_properties("${example_program}_kokkos" PROPERTIES COMPILE_FLAGS ${OpenMP_CXX_FLAGS})
target_link_libraries ("${example_program}_kokkos" apex ${Kokkos_LIBRARY} ${LIBS} OpenMP::OpenMP_CXX)
else (OPENMP_FOUND)
target_link_libraries ("${example_program}_kokkos" apex ${Kokkos_LIBRARY} ${LIBS})
endif (OPENMP_FOUND)
add_dependencies ("${example_program}_kokkos" apex)
add_dependencies (tests "${example_program}_kokkos")
Expand Down

0 comments on commit b95e0db

Please sign in to comment.