From ba02c6b70fd9746f4917c058edc0664d347ea83c Mon Sep 17 00:00:00 2001 From: mvlopri <77512923+mvlopri@users.noreply.github.com> Date: Wed, 20 Mar 2024 10:14:24 -0600 Subject: [PATCH] seacas: update the variants and tpls (#43195) Adds variants to turn off tests Add variants for some missing TPL options Add the variables required to build in ~shared * Add pamgen to Trilinos as a variant to support SEACAS This adds the ability to turn off and on pamgen as needed through the variant interface for the Trilinos package.py. Add changes for seacas package.py to build the appropriate Trilinos variants. Add zlib-api as depends_on instead of zlib directly for SEACAS package.py Co-authored-by: Massimiliano Culpo --- .../repos/builtin/packages/seacas/package.py | 21 +++++++++++++------ .../builtin/packages/trilinos/package.py | 3 ++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/var/spack/repos/builtin/packages/seacas/package.py b/var/spack/repos/builtin/packages/seacas/package.py index 0163bb4b7a..30aab746a3 100644 --- a/var/spack/repos/builtin/packages/seacas/package.py +++ b/var/spack/repos/builtin/packages/seacas/package.py @@ -135,7 +135,7 @@ class Seacas(CMakePackage): # meaningfully linked against as a shared library variant("shared", default=True, description="Enables the build of shared libraries") variant("mpi", default=True, description="Enables MPI parallelism.") - + variant("tests", default=True, description="Enable the SEACAS tests to build") variant( "thread_safe", default=False, description="Enable thread-safe exodus and IOSS libraries" ) @@ -146,19 +146,24 @@ class Seacas(CMakePackage): variant("faodel", default=False, description="Enable Faodel") variant("matio", default=True, description="Compile with matio (MatLab) support") variant("metis", default=False, description="Compile with METIS and ParMETIS") + variant("pamgen", default=False, description="Compile with pamgen") variant("x11", default=True, description="Compile with X11") - + variant("zlib", default=False, description="Compile with zlib") # ###################### Dependencies ########################## depends_on("cmake@3.22:", when="@2023-10-24:", type="build") depends_on("cmake@3.17:", when="@:2023-05-30", type="build") depends_on("mpi", when="+mpi") - + depends_on("zlib-api", when="+zlib") + depends_on("trilinos~exodus+mpi+pamgen", when="+mpi+pamgen") + depends_on("trilinos~exodus~mpi+pamgen", when="~mpi+pamgen") # Always depends on netcdf-c depends_on("netcdf-c@4.8.0:+mpi+parallel-netcdf", when="+mpi") depends_on("netcdf-c@4.8.0:~mpi", when="~mpi") depends_on("hdf5+hl~mpi", when="~mpi") + depends_on("hdf5+hl+mpi", when="+mpi") - depends_on("fmt@10.1.0", when="@2023-10-24:") + depends_on("fmt@10.2.1:", when="@2024-03-11:") + depends_on("fmt@10.1.0:", when="@2023-10-24:2023-11-27") depends_on("fmt@9.1.0", when="@2022-10-14:2023-05-30") depends_on("fmt@8.1.0:9", when="@2022-03-04:2022-05-16") @@ -215,7 +220,7 @@ def cmake_args(self): options.extend( [ - define(project_name_base + "_ENABLE_TESTS", True), + from_variant(project_name_base + "_ENABLE_TESTS", "tests"), define(project_name_base + "_ENABLE_CXX11", True), define(project_name_base + "_ENABLE_Kokkos", False), define(project_name_base + "_HIDE_DEPRECATED_CODE", False), @@ -233,7 +238,8 @@ def cmake_args(self): define(project_name_base + "_ENABLE_SEACAS", True), ] ) - + if "~shared" in self.spec: + options.append(self.define(f"{project_name_base}_EXTRA_LINK_FLAGS", "z;dl")) options.append(from_variant("TPL_ENABLE_MPI", "mpi")) if "+mpi" in spec and not is_windows: options.extend( @@ -361,6 +367,9 @@ def cmake_args(self): [define("TPL_ENABLE_METIS", False), define("TPL_ENABLE_ParMETIS", False)] ) + options.append(from_variant(f"{project_name_base}_ENABLE_Pamgen", "pamgen")) + options.append(from_variant("TPL_ENABLE_Pamgen", "pamgen")) + options.append(from_variant("TPL_ENABLE_Matio", "matio")) if "+matio" in spec: options.append(define("Matio_ROOT", spec["matio"].prefix)) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index ee016318b6..c6629d58f9 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -137,6 +137,7 @@ class Trilinos(CMakePackage, CudaPackage, ROCmPackage): variant("minitensor", default=False, description="Compile with MiniTensor") variant("muelu", default=True, description="Compile with Muelu") variant("nox", default=False, description="Compile with NOX") + variant("pamgen", default=False, description="Compile with Pamgen") variant("panzer", default=False, description="Compile with Panzer") variant("piro", default=False, description="Compile with Piro") variant("phalanx", default=False, description="Compile with Phalanx") @@ -673,7 +674,7 @@ def define_enable(suffix, value=None): define_trilinos_enable("ML"), define_trilinos_enable("MueLu"), define_trilinos_enable("NOX"), - define_trilinos_enable("Pamgen", False), + define_trilinos_enable("Pamgen"), define_trilinos_enable("Panzer"), define_trilinos_enable("Pike", False), define_trilinos_enable("Piro"),