From 42c230dfbe15c71c98ae918cf99a3260e2765558 Mon Sep 17 00:00:00 2001 From: "Seth R. Johnson" Date: Mon, 16 Aug 2021 07:34:03 -0400 Subject: trilinos: simplify variants (#25359) --- var/spack/repos/builtin/packages/albany/package.py | 2 +- .../repos/builtin/packages/camellia/package.py | 2 +- var/spack/repos/builtin/packages/dealii/package.py | 7 +- .../repos/builtin/packages/nalu-wind/package.py | 2 +- var/spack/repos/builtin/packages/nalu/package.py | 4 +- .../repos/builtin/packages/percept/package.py | 2 +- var/spack/repos/builtin/packages/quinoa/package.py | 2 +- .../repos/builtin/packages/trilinos/package.py | 77 ++++++---------------- 8 files changed, 30 insertions(+), 68 deletions(-) diff --git a/var/spack/repos/builtin/packages/albany/package.py b/var/spack/repos/builtin/packages/albany/package.py index 3f2f9094ef..32acd3c832 100644 --- a/var/spack/repos/builtin/packages/albany/package.py +++ b/var/spack/repos/builtin/packages/albany/package.py @@ -54,7 +54,7 @@ class Albany(CMakePackage): # Add dependencies depends_on('mpi') - depends_on('trilinos~superlu-dist+isorropia+tempus+rythmos+teko+intrepid+intrepid2+minitensor+phalanx+pnetcdf+nox+piro+rol+shards+stk+superlu@master,develop') + depends_on('trilinos~superlu-dist+isorropia+tempus+rythmos+teko+intrepid+intrepid2+minitensor+phalanx+nox+piro+rol+shards+stk+superlu@master') def cmake_args(self): spec = self.spec diff --git a/var/spack/repos/builtin/packages/camellia/package.py b/var/spack/repos/builtin/packages/camellia/package.py index 654c3a8dfb..241c0add79 100644 --- a/var/spack/repos/builtin/packages/camellia/package.py +++ b/var/spack/repos/builtin/packages/camellia/package.py @@ -20,7 +20,7 @@ class Camellia(CMakePackage): variant('moab', default=True, description='Compile with MOAB to include support for reading standard mesh formats') - depends_on('trilinos+amesos+amesos2+belos+epetra+epetraext+exodus+ifpack+ifpack2+intrepid+intrepid2+kokkos+ml+muelu+sacado+shards+tpetra+zoltan+mumps+superlu-dist+hdf5+zlib+mpi+netcdf+pnetcdf@master,12.12.1:') + depends_on('trilinos+amesos+amesos2+belos+epetra+epetraext+exodus+ifpack+ifpack2+intrepid+intrepid2+kokkos+ml+muelu+sacado+shards+tpetra+zoltan+mumps+superlu-dist+hdf5+zlib+mpi@master,12.12.1:') depends_on('moab@:4', when='+moab') # Cameilla needs hdf5 but the description "hdf5@:1.8" is diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index 7c34fc1d1a..f0b8b51a66 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -197,7 +197,7 @@ class Dealii(CMakePackage, CudaPackage): # depends_on('taskflow', when='@9.3:+taskflow') depends_on('trilinos gotype=int', when='+trilinos@12.18.1:') # TODO: next line fixes concretization with trilinos and adol-c - depends_on('trilinos~exodus~netcdf', when='@9.0:+adol-c+trilinos') + depends_on('trilinos~exodus', when='@9.0:+adol-c+trilinos') # Both Trilinos and SymEngine bundle the Teuchos RCP library. # This leads to conflicts between macros defined in the included # headers when they are not compiled in the same mode. @@ -296,12 +296,9 @@ class Dealii(CMakePackage, CudaPackage): conflicts('+adol-c', when='^trilinos+chaco', msg='Symbol clash between the ADOL-C library and ' 'Trilinos SEACAS Chaco.') - conflicts('+adol-c', when='^trilinos+netcdf', + conflicts('+adol-c', when='^trilinos+exodus', msg='Symbol clash between the ADOL-C library and ' 'Trilinos Netcdf.') - conflicts('+adol-c', when='^trilinos+pnetcdf', - msg='Symbol clash between the ADOL-C library and ' - 'Trilinos parallel Netcdf.') conflicts('+slepc', when='~petsc', msg='It is not possible to enable slepc interfaces ' diff --git a/var/spack/repos/builtin/packages/nalu-wind/package.py b/var/spack/repos/builtin/packages/nalu-wind/package.py index 203d69b830..ab1a0c3c26 100644 --- a/var/spack/repos/builtin/packages/nalu-wind/package.py +++ b/var/spack/repos/builtin/packages/nalu-wind/package.py @@ -56,7 +56,7 @@ class NaluWind(CMakePackage, CudaPackage): depends_on('tioga@master,develop', when='+tioga') depends_on('hypre@develop,2.18.2: +int64+mpi~superlu-dist', when='+hypre') depends_on('kokkos-nvcc-wrapper', type='build', when='+cuda') - depends_on('trilinos@master,develop +exodus+tpetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist~superlu+hdf5+zlib+pnetcdf+shards~hypre cxxstd=14') + depends_on('trilinos@master +exodus+tpetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist~superlu+hdf5+zlib+shards~hypre cxxstd=14') # Cannot build Trilinos as a shared library with STK on Darwin # https://github.com/trilinos/Trilinos/issues/2994 depends_on('trilinos~shared', when=(sys.platform == 'darwin')) diff --git a/var/spack/repos/builtin/packages/nalu/package.py b/var/spack/repos/builtin/packages/nalu/package.py index acda4934e6..f6973b8610 100644 --- a/var/spack/repos/builtin/packages/nalu/package.py +++ b/var/spack/repos/builtin/packages/nalu/package.py @@ -35,8 +35,8 @@ class Nalu(CMakePackage): # Cannot build Trilinos as a shared library with STK on Darwin # which is why we have a 'shared' variant for Nalu # https://github.com/trilinos/Trilinos/issues/2994 - depends_on('trilinos+mpi+netcdf+exodus+tpetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist+superlu+hdf5+zlib+pnetcdf+shards~hypre@master,develop', when='+shared') - depends_on('trilinos~shared+exodus+tpetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist+superlu+hdf5+zlib+pnetcdf+shards~hypre@master,develop', when='~shared') + depends_on('trilinos+mpi+exodus+tpetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist+superlu+hdf5+zlib+shards~hypre@master') + depends_on('trilinos~shared', when='~shared') # Optional dependencies depends_on('tioga', when='+tioga+shared') depends_on('tioga~shared', when='+tioga~shared') diff --git a/var/spack/repos/builtin/packages/percept/package.py b/var/spack/repos/builtin/packages/percept/package.py index 99e204a7d2..13c4e1a667 100644 --- a/var/spack/repos/builtin/packages/percept/package.py +++ b/var/spack/repos/builtin/packages/percept/package.py @@ -25,7 +25,7 @@ class Percept(CMakePackage): depends_on('opennurbs@percept') depends_on('boost+graph+mpi') depends_on('yaml-cpp+pic~shared@0.5.3:') - depends_on('trilinos~shared+exodus+netcdf+mpi+tpetra+epetra+epetraext+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist+superlu+hdf5+zlib+pnetcdf+aztec+sacado~openmp+shards+intrepid+cgns@master,12.14.1:') + depends_on('trilinos~shared+exodus+mpi+tpetra+epetra+epetraext+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist+superlu+hdf5+zlib+aztec+sacado~openmp+shards+intrepid@master,12.14.1:') def cmake_args(self): spec = self.spec diff --git a/var/spack/repos/builtin/packages/quinoa/package.py b/var/spack/repos/builtin/packages/quinoa/package.py index aabda89fac..0fb326c7b5 100644 --- a/var/spack/repos/builtin/packages/quinoa/package.py +++ b/var/spack/repos/builtin/packages/quinoa/package.py @@ -21,7 +21,7 @@ class Quinoa(CMakePackage): depends_on('hdf5+mpi') depends_on("charmpp backend=mpi") - depends_on("trilinos+exodus+mpi+netcdf") + depends_on("trilinos+exodus+mpi") depends_on("boost") depends_on("hypre~internal-superlu") depends_on("random123") diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 656dad4aab..b951779d54 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -89,24 +89,16 @@ class Trilinos(CMakePackage, CudaPackage): # TPLs (alphabet order) variant('boost', default=False, description='Compile with Boost') - variant('cgns', default=False, - description='Enable CGNS') variant('adios2', default=False, description='Enable ADIOS2') variant('hdf5', default=False, description='Compile with HDF5') variant('hypre', default=False, description='Compile with Hypre preconditioner') - variant('matio', default=False, - description='Compile with Matio') variant('mpi', default=True, description='Compile with MPI parallelism') variant('mumps', default=False, description='Compile with support for MUMPS solvers') - variant('netcdf', default=False, - description='Compile with netcdf') - variant('pnetcdf', default=False, - description='Compile with parallel-netcdf') variant('suite-sparse', default=False, description='Compile with SuiteSparse solvers') variant('superlu-dist', default=False, @@ -138,7 +130,6 @@ class Trilinos(CMakePackage, CudaPackage): description='Compile with Epetra') variant('epetraext', default=True, description='Compile with EpetraExt') - # Disable Exodus by default as it requires netcdf variant('exodus', default=False, description='Compile with Exodus from SEACAS') variant('ifpack', default=True, @@ -285,7 +276,6 @@ class Trilinos(CMakePackage, CudaPackage): conflicts('+zoltan2') conflicts('+basker', when='~amesos2') - conflicts('+exodus', when='~netcdf') conflicts('+ifpack2', when='~belos') conflicts('+intrepid', when='~sacado') conflicts('+intrepid', when='~shards') @@ -300,7 +290,7 @@ class Trilinos(CMakePackage, CudaPackage): # Only allow DTK with Trilinos 12 conflicts('+dtk', when='~boost') conflicts('+dtk', when='~intrepid2') - conflicts('+dtk', when='@:12.12.99,develop,master') + conflicts('+dtk', when='@:12.12.99,master') # Only allow Mesquite with Trilinos 12.12 and up, and master conflicts('+mesquite', when='@:12.10.99,master') @@ -318,16 +308,12 @@ class Trilinos(CMakePackage, CudaPackage): # https://trilinos.org/pipermail/trilinos-users/2015-March/004802.html conflicts('+superlu-dist', when='+complex+amesos2') conflicts('+strumpack', when='@:13.0.99') - # PnetCDF was only added after v12.10.1 - conflicts('+pnetcdf', when='@0:12.10.1') # https://github.com/trilinos/Trilinos/issues/2994 conflicts( '+shared', when='+stk platform=darwin', msg='Cannot build Trilinos with STK as a shared library on Darwin.' ) conflicts('+adios2', when='@:12.14.1') - conflicts('+pnetcdf', when='~netcdf') - conflicts('+pnetcdf', when='~mpi') conflicts('+cuda_rdc', when='~cuda') conflicts('+wrapper', when='~cuda') conflicts('+wrapper', when='%clang') @@ -361,16 +347,12 @@ class Trilinos(CMakePackage, CudaPackage): depends_on('adios2', when='+adios2') depends_on('blas') depends_on('boost', when='+boost') - depends_on('cgns', when='+cgns') + depends_on('cgns', when='+exodus') depends_on('hdf5+hl', when='+hdf5') depends_on('hdf5~mpi', when='+hdf5~mpi') depends_on('hdf5+mpi', when="+hdf5+mpi") depends_on('lapack') - depends_on('matio', when='+matio') depends_on('mpi', when='+mpi') - depends_on('netcdf-c+mpi+parallel-netcdf', when="+netcdf+pnetcdf@master,12.12.1:") - depends_on('netcdf-c+mpi', when="+netcdf~pnetcdf+mpi") - depends_on('netcdf-c', when="+netcdf") depends_on('suite-sparse', when='+suite-sparse') depends_on('zlib', when="+zlib") @@ -407,18 +389,19 @@ class Trilinos(CMakePackage, CudaPackage): # Variant requirements from packages depends_on('metis', when='+zoltan') depends_on('libx11', when='+exodus') + depends_on('matio', when='+exodus') + depends_on('netcdf-c', when="+exodus") + depends_on('netcdf-c+mpi+parallel-netcdf', when="+exodus+mpi@12.12.1:") + depends_on('parallel-netcdf', when='+exodus+mpi') depends_on('parmetis', when='+mpi +zoltan') depends_on('parmetis', when='+scorec') # ###################### Patches ########################## patch('umfpack_from_suitesparse.patch', when='@11.14.1:12.8.1') - patch('xlf_seacas.patch', when='@12.10.1:12.12.1 %xl') - patch('xlf_seacas.patch', when='@12.10.1:12.12.1 %xl_r') - patch('xlf_seacas.patch', when='@12.10.1:12.12.1 %clang') - patch('xlf_tpetra.patch', when='@12.12.1%xl') - patch('xlf_tpetra.patch', when='@12.12.1%xl_r') - patch('xlf_tpetra.patch', when='@12.12.1%clang') + for _compiler in ['xl', 'xl_r', 'clang']: + patch('xlf_seacas.patch', when='@12.10.1:12.12.1 %' + _compiler) + patch('xlf_tpetra.patch', when='@12.12.1 %' + _compiler) patch('fix_clang_errors_12_18_1.patch', when='@12.18.1%clang') patch('cray_secas_12_12_1.patch', when='@12.12.1%cce') patch('cray_secas.patch', when='@12.14.1:%cce') @@ -620,13 +603,19 @@ class Trilinos(CMakePackage, CudaPackage): ('Matio', 'matio'), ('METIS', 'metis'), ('Netcdf', 'netcdf-c'), - ('STRUMPACK', 'strumpack'), ('SuperLU', 'superlu'), + ('SuperLUDist', 'superlu-dist'), ('X11', 'libx11'), ('Zlib', 'zlib'), ] + if spec.satisfies('@12.12.1:'): + tpl_dep_map.append(('Pnetcdf', 'parallel-netcdf')) if spec.satisfies('@13:'): - tpl_dep_map.append(('HWLOC', 'hwloc')) + tpl_dep_map.extend([ + ('HWLOC', 'hwloc'), + ('STRUMPACK', 'strumpack'), + ]) + for tpl_name, dep_name in tpl_dep_map: have_dep = (dep_name in spec) options.append(define('TPL_ENABLE_' + tpl_name, have_dep)) @@ -665,18 +654,7 @@ class Trilinos(CMakePackage, CudaPackage): define('TPL_ENABLE_UMFPACK', False), ]) - # METIS and ParMETIS mostly depend on transitive dependencies - # STRUMPACK and SuperLU-dist, so don't provide a separate variant for - # them. - have_metis = 'metis' in spec - options.append(define('TPL_ENABLE_METIS', have_metis)) - if have_metis: - options.extend([ - define('METIS_LIBRARY_DIRS', spec['metis'].prefix.lib), - define('METIS_LIBRARY_NAMES', 'metis'), - define('TPL_METIS_INCLUDE_DIRS', spec['metis'].prefix.include), - ]) - + # ParMETIS dependencies have to be transitive explicitly have_parmetis = 'parmetis' in spec options.append(define('TPL_ENABLE_ParMETIS', have_parmetis)) if have_parmetis: @@ -710,26 +688,15 @@ class Trilinos(CMakePackage, CudaPackage): '-DMUMPS_5_0' ]) - options.append(define_tpl_enable('SuperLUDist', 'superlu-dist')) - if '+superlu-dist' in spec: + if spec.satisfies('^superlu-dist@4.0:'): options.extend([ - define('KokkosTSQR_ENABLE_Complex', False), - define('TPL_ENABLE_SuperLUDist', True), - define('SuperLUDist_LIBRARY_DIRS', - spec['superlu-dist'].prefix.lib), - define('SuperLUDist_INCLUDE_DIRS', - spec['superlu-dist'].prefix.include), + define('HAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG', True), ]) - if spec.satisfies('^superlu-dist@4.0:'): - options.extend([ - define('HAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG', True), - ]) if '+strumpack' in spec: options.append(define('Amesos2_ENABLE_STRUMPACK', True)) - options.append(define_tpl_enable('Pnetcdf')) - if '+pnetcdf' in spec: + if spec.satisfies('^parallel-netcdf'): options.extend([ define('TPL_Netcdf_Enables_Netcdf4', True), define('TPL_Netcdf_PARALLEL', True), @@ -784,8 +751,6 @@ class Trilinos(CMakePackage, CudaPackage): )) # Explicit Template Instantiation (ETI) in Tpetra - # NOTE: Trilinos will soon move to fixed std::uint64_t for GO and - # std::int32_t or std::int64_t for local. options.append(define_from_variant( 'Trilinos_ENABLE_EXPLICIT_INSTANTIATION', 'explicit_template_instantiation')) -- cgit v1.2.3-70-g09d2