Skip to content

Commit acadfa3

Browse files
find_package kokkoskernels in top-level cmakelists
1 parent 03ea452 commit acadfa3

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ if(NOT CMAKE_BUILD_TYPE)
66
set(CMAKE_BUILD_TYPE Release)
77
endif()
88

9+
# both the apps and the library depend on kokkos and kokkoskernels
10+
# find KokkosKernels also handles kokkos
11+
find_package(KokkosKernels REQUIRED)
912
add_compile_options(-Wall -Wextra -Wshadow)
1013
add_subdirectory(src)
1114
add_subdirectory(app)

app/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ target_compile_definitions(jet_export PUBLIC HOST EXP)
2525
target_compile_definitions(jet_serial PUBLIC SERIAL)
2626

2727
# link executables
28-
find_package(KokkosKernels REQUIRED)
2928
target_link_libraries(jet_import Kokkos::kokkos Kokkos::kokkoskernels)
3029
target_link_libraries(pstat Kokkos::kokkos Kokkos::kokkoskernels)
30+
# other executables get the kokkos dependencies via jet
3131
foreach(prog jet_ex jet4 jet2 jet_host jet_export jet_serial)
3232
target_link_libraries(${prog} jet)
3333
endforeach(prog)

src/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ endif()
2626

2727
# link libjet (for downstream library consumers)
2828
# no linking actually occurs for libjet itself
29-
find_package(KokkosKernels REQUIRED)
3029
target_link_libraries(jet PUBLIC Kokkos::kokkos Kokkos::kokkoskernels)
3130
target_link_libraries(jet PRIVATE ${LIBMETIS})
3231
if(LINK_GKLIB)

0 commit comments

Comments
 (0)