From 51702a725bedf4235cc3516d65828e71bb5cb852 Mon Sep 17 00:00:00 2001 From: Alan Williams Date: Tue, 31 Jan 2023 13:42:43 -0700 Subject: Add trilinos-solvers variant to nalu-wind package. (#35267) * Add trilinos-solvers variant to nalu-wind package. This allows nalu-wind to be built against a trilinos installation which doesn't have amesos2, belos, ifpack2, or muelu enabled, if the nalu-wind user provides the spec 'nalu-wind@master~trilinos-solvers' Support for these solver-packages remains on by default. * Fixed a style issue reported by CI. * Incorporate change in wording suggested from review comments. ... to clarify that at least one, or both, of hypre and/or trilinos-solvers must be enabled. The error condition is if both are disabled. * That style checker is picky... * It really did want a trailing comma... --- var/spack/repos/builtin/packages/nalu-wind/package.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/nalu-wind/package.py b/var/spack/repos/builtin/packages/nalu-wind/package.py index 26957c57f2..00864e362d 100644 --- a/var/spack/repos/builtin/packages/nalu-wind/package.py +++ b/var/spack/repos/builtin/packages/nalu-wind/package.py @@ -42,7 +42,8 @@ class NaluWind(CMakePackage, CudaPackage): ) variant("openfast", default=False, description="Compile with OpenFAST support") variant("tioga", default=False, description="Compile with Tioga support") - variant("hypre", default=False, description="Compile with Hypre support") + variant("hypre", default=True, description="Compile with Hypre support") + variant("trilinos-solvers", default=True, description="Compile with Trilinos Solvers support") variant("catalyst", default=False, description="Compile with Catalyst support") variant("fftw", default=False, description="Compile with FFTW support") variant("boost", default=False, description="Enable Boost integration") @@ -52,7 +53,7 @@ class NaluWind(CMakePackage, CudaPackage): depends_on("yaml-cpp@0.5.3:") depends_on( "trilinos@13:" - "+exodus+tpetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost" + "+exodus+tpetra+zoltan+stk+boost" "~superlu-dist~superlu+hdf5+shards~hypre+gtest" ) depends_on("trilinos~cuda~wrapper", when="~cuda") @@ -62,6 +63,11 @@ class NaluWind(CMakePackage, CudaPackage): depends_on("openfast@2.6.0: +cxx", when="+openfast") depends_on("tioga@master:", when="+tioga") depends_on("hypre@2.18.2: ~int64+mpi~superlu-dist", when="+hypre") + depends_on("trilinos+muelu+belos+amesos2+ifpack2", when="+trilinos-solvers") + conflicts( + "~hypre~trilinos-solvers", + msg="nalu-wind: Must enable at least one of the linear-solvers: hypre or trilinos-solvers", + ) depends_on("kokkos-nvcc-wrapper", type="build", when="+cuda") for _arch in CudaPackage.cuda_arch_values: depends_on( @@ -105,6 +111,7 @@ class NaluWind(CMakePackage, CudaPackage): if "+hypre" in spec: args.append(self.define("HYPRE_DIR", spec["hypre"].prefix)) + args.append(self.define_from_variant("ENABLE_TRILINOS_SOLVERS", "trilinos-solvers")) args.append(self.define_from_variant("ENABLE_PARAVIEW_CATALYST", "catalyst")) if "+catalyst" in spec: args.append( -- cgit v1.2.3-60-g2f50