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
78 changes: 41 additions & 37 deletions scripts/spack/packages/serac/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,16 @@ class Serac(CachedCMakePackage, CudaPackage, ROCmPackage):
depends_on('[email protected]', when="+enzyme")

# Devtool dependencies these need to match serac_devtools/package.py
depends_on("cppcheck", when="+devtools")
depends_on("doxygen", when="+devtools")
depends_on("llvm@19+clang", when="+devtools")
depends_on("python", when="+devtools")
depends_on("py-sphinx", when="+devtools")
with when("+devtools"):
depends_on("cppcheck")
depends_on("doxygen")
depends_on("llvm@19+clang")
depends_on("python")
depends_on("py-sphinx")

with when("+sundials"):
# Going to sundials@7: causes 80%+ test failures
depends_on("sundials@:6.999", when="+sundials")
depends_on("sundials@:6.999")
# MFEM is deprecating the monitoring support with sundials v6.0 and later
# NOTE: Sundials must be built static to prevent the following runtime error:
# "error while loading shared libraries: libsundials_nvecserial.so.6:
Expand All @@ -126,20 +127,22 @@ class Serac(CachedCMakePackage, CudaPackage, ROCmPackage):

depends_on("[email protected]:~superlu-dist+mpi")

depends_on("petsc", when="+petsc")
depends_on("petsc+strumpack", when="+petsc+strumpack")
depends_on("petsc~strumpack", when="+petsc~strumpack")
depends_on("petsc+openmp", when="+petsc+openmp")
depends_on("petsc~openmp", when="+petsc~openmp")
depends_on("slepc+arpack", when="+slepc")

depends_on("tribol", when="+tribol")
depends_on("tribol+raja", when="+raja")
depends_on("tribol~raja", when="~raja")
depends_on("tribol+umpire", when="+umpire")
depends_on("tribol~umpire", when="~umpire")
depends_on("tribol+enzyme", when="+enzyme")
depends_on("tribol~enzyme", when="~enzyme")
with when("+petsc"):
depends_on("petsc")
depends_on("petsc+strumpack", when="+strumpack")
depends_on("petsc~strumpack", when="~strumpack")
depends_on("petsc+openmp", when="+openmp")
depends_on("petsc~openmp", when="~openmp")
depends_on("slepc+arpack", when="+slepc")

with when("+tribol"):
depends_on("tribol")
depends_on("tribol+raja", when="+raja")
depends_on("tribol~raja", when="~raja")
depends_on("tribol+umpire", when="+umpire")
depends_on("tribol~umpire", when="~umpire")
depends_on("tribol+enzyme", when="+enzyme")
depends_on("tribol~enzyme", when="~enzyme")

# Needs to be first due to a bug with the Spack concretizer
# Note: Certain combinations of CMake and Conduit do not like +mpi
Expand All @@ -149,15 +152,17 @@ class Serac(CachedCMakePackage, CudaPackage, ROCmPackage):

depends_on("[email protected]:")

depends_on("[email protected]:~examples~exercises", when="+raja")
depends_on("raja~openmp", when="+raja~openmp")
depends_on("raja+openmp", when="+raja+openmp")
with when("+raja"):
depends_on("[email protected]:~examples~exercises")
depends_on("raja+openmp", when="+openmp")
depends_on("raja~openmp", when="~openmp")

depends_on("[email protected]:~examples~device_alloc", when="+umpire")
depends_on("umpire~openmp", when="+umpire~openmp")
depends_on("umpire+openmp", when="+umpire+openmp")
with when("+umpire"):
depends_on("[email protected]:~examples~device_alloc")
depends_on("umpire+openmp", when="+openmp")
depends_on("umpire~openmp", when="~openmp")

depends_on("axom@0.9:~fortran~tools~examples+mfem+lua")
depends_on("axom@0.10:~fortran~tools~examples+mfem+lua")
depends_on("axom+raja", when="+raja")
depends_on("axom~raja", when="~raja")
depends_on("axom+umpire", when="+umpire")
Expand All @@ -170,15 +175,17 @@ class Serac(CachedCMakePackage, CudaPackage, ROCmPackage):

depends_on("conduit~python~test")

depends_on("adiak+mpi", when="+profiling")
depends_on("caliper+mpi+adiak~papi", when="+profiling")
with when("+profiling"):
depends_on("adiak+mpi")
depends_on("caliper+mpi+adiak~papi")

depends_on("[email protected]")

# The optional slate dependency is not handled in the MFEM spack package
depends_on("strumpack~slate~butterflypack~zfp", when="+strumpack")
depends_on("strumpack+openmp", when="+strumpack+openmp")
depends_on("strumpack~openmp", when="+strumpack~openmp")
with when("+strumpack"):
depends_on("strumpack~slate~butterflypack~zfp")
depends_on("strumpack+openmp", when="+openmp")
depends_on("strumpack~openmp", when="~openmp")

#
# Forward variants
Expand Down Expand Up @@ -242,8 +249,8 @@ class Serac(CachedCMakePackage, CudaPackage, ROCmPackage):
depends_on("{0}~shared".format(dep), when="~shared")

# MFEM has a static variant
depends_on("{0}+static".format("mfem"), when="~shared")
depends_on("{0}~static".format("mfem"), when="+shared")
depends_on("mfem+static", when="~shared")
depends_on("mfem~static", when="+shared")

#
# Conflicts
Expand All @@ -261,9 +268,6 @@ class Serac(CachedCMakePackage, CudaPackage, ROCmPackage):

conflicts("~petsc", when="+slepc", msg="PETSc must be built when building with SLEPc!")

conflicts("sundials@:6.0.0", when="+sundials",
msg="Sundials needs to be greater than 6.0.0")

conflicts("sundials+shared", when="+sundials",
msg="Sundials causes runtime errors if shared!")

Expand Down
16 changes: 12 additions & 4 deletions src/serac/infrastructure/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@
#
# SPDX-License-Identifier: (BSD-3-Clause)

set(infrastructure_test_depends serac_physics gtest)
set(infrastructure_test_depends serac_infrastructure gtest)

set(infrastructure_test_sources
application_manager.cpp
debug_print.cpp
error_handling.cpp
input.cpp
profiling.cpp)
input.cpp)

serac_add_tests( SOURCES ${infrastructure_test_sources}
DEPENDS_ON ${infrastructure_test_depends})


# Infrastructure tests that require more than just infrastructure

serac_add_tests( SOURCES error_handling.cpp
DEPENDS_ON serac_physics ${infrastructure_test_depends})

serac_add_tests( SOURCES profiling.cpp
DEPENDS_ON serac_mesh_utils ${infrastructure_test_depends})
30 changes: 30 additions & 0 deletions src/serac/infrastructure/tests/application_manager.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright (c) Lawrence Livermore National Security, LLC and
// other Serac Project Developers. See the top-level LICENSE file for
// details.
//
// SPDX-License-Identifier: (BSD-3-Clause)

#include "gtest/gtest.h"

#include "serac/serac_config.hpp"
#include "serac/infrastructure/application_manager.hpp"

namespace {
// Stash copies that tests can read (after gtest strips its flags)
int g_argc = 0;
char** g_argv = nullptr;
} // namespace

namespace serac {

TEST(ApplicationManager, Lifetime) { serac::ApplicationManager applicationManager(g_argc, g_argv); }

} // namespace serac

int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv); // removes --gtest_* flags
g_argc = argc; // store leftovers for tests
g_argv = argv;
return RUN_ALL_TESTS();
}