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
19 changes: 10 additions & 9 deletions cmake/EkatConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,31 @@ endif()

if (@EKAT_ENABLE_KOKKOS@)
# Kokkos
if (@Kokkos_FOUND@)
find_dependency(Kokkos REQUIRED QUIET HINTS @Kokkos_DIR@)
else()
if (@EKAT_BUILDS_KOKKOS@)
# We're installing Kokkos alongside ekat
find_dependency(Kokkos REQUIRED QUIET HINTS @CMAKE_INSTALL_PREFIX@)
else()
find_dependency(Kokkos REQUIRED QUIET HINTS @Kokkos_DIR@)
endif()
endif()

# yaml-cpp
if (@EKAT_ENABLE_YAML_PARSER@)
if (@yaml-cpp_FOUND@)
find_dependency(yaml-cpp REQUIRED QUIET HINTS @yaml-cpp_DIR@)
else()
if (@EKAT_BUILDS_YAMLCPP@)
# We're installing yaml-cpp alongside ekat
find_dependency(yaml-cpp REQUIRED QUIET HINTS @CMAKE_INSTALL_PREFIX@)
else()
find_dependency(yaml-cpp REQUIRED QUIET HINTS @yaml-cpp_DIR@)
endif()
endif()

if (@EKAT_ENABLE_LOGGING@)
# spdlog
if (@spdlog_FOUND@)
find_dependency(spdlog REQUIRED QUIET HINTS @spdlog_DIR@)
else()
if (@EKAT_BUILDS_SPDLOG@)
# We're installing yaml-cpp alongside ekat
find_dependency(spdlog REQUIRED QUIET HINTS @CMAKE_INSTALL_PREFIX@)
else()
find_dependency(spdlog REQUIRED QUIET HINTS @spdlog_DIR@)
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion cmake/machine-files/kokkos/generic.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generic setting that are used regardless of Architecture or Kokkos backend

set(Kokkos_ENABLE_DEPRECATED_CODE FALSE CACHE BOOL "")
set(Kokkos_ENABLE_DEPRECATED_CODE_4 FALSE CACHE BOOL "")
set(Kokkos_ENABLE_EXPLICIT_INSTANTIATION FALSE CACHE BOOL "")
3 changes: 0 additions & 3 deletions cmake/tpls/EkatFindKokkos.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,18 @@ if (Kokkos_FOUND)
list (FIND Kokkos_DEVICES ${dev} index)
if (index EQUAL -1)
list (APPEND MISSING_DEVICES ${dev})
set (Kokkos_FOUND FALSE)
endif()
endforeach()
foreach (arch IN ITEMS ${EKAT_FIND_KOKKOS_ARCHS})
list (FIND Kokkos_ARCH ${arch} index)
if (index EQUAL -1)
list (APPEND MISSING_ARCHS ${arch})
set (Kokkos_FOUND FALSE)
endif()
endforeach()
foreach (opt IN ITEMS ${EKAT_FIND_KOKKOS_OPTIONS})
list (FIND Kokkos_OPTIONS ${opt} index)
if (index EQUAL -1)
list (APPEND MISSING_OPTIONS ${arch})
set (Kokkos_FOUND FALSE)
endif()
endforeach()

Expand Down
4 changes: 4 additions & 0 deletions src/kokkos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ if (EKAT_SKIP_FIND_KOKKOS)
# The user does not want to accidentally get an existing installation,
# and instead wants to force a build from the internal submodule
include (EkatBuildKokkos)
set (EKAT_BUILDS_KOKKOS ON CACHE BOOL "Whether Ekat builds kokkos" FORCE)
else()
# We first try to use find_package (unless told to skip this phase).
# If that doesn't work, build from submodule
include (EkatFindKokkos)
if (NOT Kokkos_FOUND)
include (EkatBuildKokkos)
set (EKAT_BUILDS_KOKKOS ON CACHE BOOL "Whether Ekat builds kokkos" FORCE)
else()
set (EKAT_BUILDS_KOKKOS OFF CACHE BOOL "Whether Ekat builds kokkos" FORCE)
endif()
endif()

Expand Down
3 changes: 3 additions & 0 deletions src/logging/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ if (EKAT_SKIP_FIND_SPDLOG)
# The user does not want to accidentally get an existing installation,
# and instead wants to force a build from the internal submodule
include (EkatBuildSpdlog)
set (EKAT_BUILDS_SPDLOG ON CACHE BOOL "Whether Ekat builds spdlog" FORCE)
else()
# We first try to use find_XYZ. If that doesn't work, build from submodule
message (STATUS "Looking for spdlog ...")
find_package(spdlog QUIET)
if (NOT spdlog_FOUND)
message (STATUS "Looking for spdlog ... NOT FOUND")
include(EkatBuildSpdlog)
set (EKAT_BUILDS_SPDLOG ON CACHE BOOL "Whether Ekat builds spdlog" FORCE)
else()
message (STATUS "Looking for spdlog ... FOUND")
message (STATUS " spdlog_DIR: ${spdlog_DIR}")
set (EKAT_BUILDS_SPDLOG OFF CACHE BOOL "Whether Ekat builds spdlog" FORCE)
endif()
endif()

Expand Down
3 changes: 3 additions & 0 deletions src/parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ if (EKAT_SKIP_FIND_YAML_CPP)
# The user does not want to accidentally get an existing installation,
# and instead wants to force a build from the internal submodule
include (EkatBuildYamlCpp)
set (EKAT_BUILDS_YAMLCPP ON CACHE BOOL "Whether Ekat builds yaml-cpp" FORCE)
else()
# I am having issues getting the env var YAML_CPP_ROOT being picked up
# by cmake. I suspect this has to do with the presence of the hyphen
Expand All @@ -21,7 +22,9 @@ else()
if (NOT yaml-cpp_FOUND)
message (STATUS "Looking for yaml-cpp ... NOT FOUND")
include(EkatBuildYamlCpp)
set (EKAT_BUILDS_YAMLCPP ON CACHE BOOL "Whether Ekat builds yaml-cpp" FORCE)
else()
set (EKAT_BUILDS_YAMLCPP OFF CACHE BOOL "Whether Ekat builds yaml-cpp" FORCE)
message (STATUS "Looking for yaml-cpp ... FOUND")
message (STATUS " yaml-cpp_DIR: ${yaml-cpp_DIR}")
# It is possible that the installation provides the yaml-cpp target, but not the yaml-cpp::yaml-cpp target. If so, define the alias target
Expand Down