Skip to content

Commit

Permalink
cleanup various little cmake things that were causing problems
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahm-LANL committed Sep 26, 2024
1 parent da8727f commit 11f23b7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
30 changes: 19 additions & 11 deletions cmake/SetupDeps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,32 @@ else()
message(status "CUDA::toolkit provided by parent package")
endif()

#=======================================
# Setup Kokkos
# - provides Kokkos::kokkos
#=======================================
if (SINGULARITY_USE_KOKKOS)
if (NOT TARGET Kokkos::kokkos)
message(status "Kokkos::kokkos must be found")
if (SINGULARITY_KOKKOS_IN_TREE)
message(status "Using in-tree Kokkos")
add_subdirectory(utils/kokkos)
else()
message(status "Using system Kokkos if available")
find_package(Kokkos REQUIRED)
endif()
else()
message(status "Kokkos::kokkos provided by parent package")
endif()
endif()

#=======================================
# Setup ports of call
# - provides PortsofCall::PortsofCall
#=======================================
find_package(PortsofCall REQUIRED)
target_link_libraries(singularity-opac::flags INTERFACE PortsofCall::PortsofCall)

#=======================================
# Setup Kokkos
# - provides Kokkos::kokkos
#=======================================
if (NOT TARGET Kokkos::kokkos)
add_subdirectory(utils/kokkos)
find_package(Kokkos QUIET)
else()
message(status "Kokkos::kokkos provided by parent package")
endif()

#=======================================
# Find HDF5
# - [email protected]+ provides HDF5::HDF5, but
Expand Down
6 changes: 4 additions & 2 deletions cmake/SetupOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ option (SINGULARITY_USE_FMATH "Enable fast-math logarithms" ON)
# Dependency options
#=======================================
# check for using in-tree third-party dependencies
option (SINULARITY_KOKKOS_IN_TREE "Use in-tree dependencies" OFF)

option (SINGULARITY_USE_KOKKOS "Use Kokkos for portability" OFF)
option (SINGULARITY_USE_CUDA "Enable cuda support" OFF)
option (SINGULARITY_USE_HDF5 "Pull in hdf5" OFF)
cmake_dependent_option(SINULARITY_KOKKOS_IN_TREE
"Use in-tree dependencies" OFF
${SINGULARITY_USE_KOKKOS} OFF)


# If the conditional is TRUE, it's the first default, else it's the
# second.
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ PRIVATE
# Ensure code works with C++11 and earlier
# TODO(MM): Remove this later when it's not needed.
set_target_properties(${PROJECT_NAME}_unit_tests
PROPERTIES CXX_STANDARD 14
PROPERTIES CXX_STANDARD 17
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO)

Expand Down

0 comments on commit 11f23b7

Please sign in to comment.