From 5bea24526f4ee27d94f5ce9d61d63babbc05bc38 Mon Sep 17 00:00:00 2001 From: "Seth R. Johnson" Date: Tue, 8 Mar 2022 13:15:10 -0500 Subject: Fix overconstrained HDF5 variants (#29132) * hdf5: mark +fortran+shared conflict for older version This version was only activated unintentionally by silo's conflict statement, but `@1.8.15+shared+fortran+cxx` errors out in configure: ``` CMake Error at CMakeLists.txt:814 (message): **** Shared FORTRAN libraries are unsupported **** ``` * silo: refine hdf5 conflicts to avoid building old version Before this, `silo+hdf5` concretized to 1.10.7 or sometimes 1.8.15. Now I've verified it works for the following configurations: ``` silo@4.10.2 patches=7b5a1dc,952d3c9 ^ hdf5@1.10.7 api=default silo@4.10.2 patches=7b5a1dc,952d3c9,eb2a3a0 ^ hdf5@1.10.8 api=v18 silo@4.10.2 patches=7b5a1dc,952d3c9,eb2a3a0 ^ hdf5@1.12.1 api=v110 silo@4.11-bsd patches=eb2a3a0 ^ hdf5@1.12.1 api=v110 silo@4.11-bsd patches=eb2a3a0 ^ hdf5@1.10.8 api=default silo@4.11-bsd patches=eb2a3a0 ^ hdf5@1.12.1 api=default ``` and verified that the following fail: ``` silo@4.10.2 ^hdf5@1.12.1 api=default silo@4.11 ^hdf5 api=v18 silo@4.11-bsd ^hdf5@1.13.0 api=v12 silo@4.11-bsd ^hdf5@1.13.0 api=default ``` and have updated the constraints to match. Hdf5 no longer has to be downgraded to work with Silo. * silo: fix dependency conflicts * py-h5py: shorten and add comments to py-h5py hdf5 dependencies * e4s: remove slightly outdated hdf5 requirement * e4s: remove excessive hdf5 variant constraints These I think are holdovers from the old concretizer. - `hdf5_compat` can be expressed as `+hdf5 ^hdf5@1.8` - The extra variants on hdf5 shouldn't break conduit - axom unnecessarily restricts hdf5 version * conduit: restore hdf5_compat flag --- var/spack/repos/builtin/packages/axom/package.py | 3 -- .../repos/builtin/packages/conduit/package.py | 26 ++++++++--------- var/spack/repos/builtin/packages/hdf5/package.py | 2 ++ var/spack/repos/builtin/packages/lbann/package.py | 9 ++++-- .../repos/builtin/packages/py-h5py/package.py | 33 +++++++++++----------- var/spack/repos/builtin/packages/silo/package.py | 12 ++++---- 6 files changed, 43 insertions(+), 42 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/axom/package.py b/var/spack/repos/builtin/packages/axom/package.py index dbd23dfe46..3719459be3 100644 --- a/var/spack/repos/builtin/packages/axom/package.py +++ b/var/spack/repos/builtin/packages/axom/package.py @@ -98,9 +98,6 @@ class Axom(CachedCMakePackage, CudaPackage): depends_on("conduit+hdf5", when="+hdf5") depends_on("conduit~hdf5", when="~hdf5") - # HDF5 needs to be the same as Conduit's - depends_on("hdf5@1.8.19:1.8~cxx~fortran", when="+hdf5") - depends_on("lua", when="+lua") depends_on("scr", when="+scr") diff --git a/var/spack/repos/builtin/packages/conduit/package.py b/var/spack/repos/builtin/packages/conduit/package.py index 320b03457e..0caf6c126f 100644 --- a/var/spack/repos/builtin/packages/conduit/package.py +++ b/var/spack/repos/builtin/packages/conduit/package.py @@ -77,6 +77,8 @@ class Conduit(CMakePackage): # set to false for systems that implicitly link mpi variant('blt_find_mpi', default=True, description='Use BLT CMake Find MPI logic') variant("hdf5", default=True, description="Build Conduit HDF5 support") + # TODO: remove 'compat' variant when VisIt starts distributing HDF5 + # binaries variant("hdf5_compat", default=True, when='+hdf5', description="Build Conduit with HDF5 1.8.x (compatibility mode)") variant("silo", default=False, description="Build Conduit Silo support") @@ -117,26 +119,18 @@ class Conduit(CMakePackage): ############### # HDF5 ############### - # Note: cxx variant is disabled due to build issue Cyrus - # experienced on BGQ. When on, the static build tries - # to link against shared libs. - # - # Use HDF5 1.8, for wider output compatibly - # variants reflect we are not using hdf5's mpi or fortran features. - depends_on("hdf5~cxx", when="+hdf5") - depends_on("hdf5~shared", when="+hdf5~shared") - depends_on("hdf5@1.8.19:1.8", when="+hdf5+hdf5_compat") - # we need to hand this to conduit so it can properly - # handle downstream linking of zlib reqed by hdf5 - depends_on("zlib", when="+hdf5") + depends_on("hdf5", when="+hdf5") + depends_on("hdf5~shared", when="+hdf5~shared") + # Require older HDF5 to ensure compatibility with VisIt: see #29132 + depends_on("hdf5@1.8.0:1.8", when="+hdf5+hdf5_compat") ############### # Silo ############### # we are not using silo's fortran features - depends_on("silo~fortran", when="+silo+shared") - depends_on("silo~shared~fortran", when="+silo~shared") + depends_on("silo+shared", when="+silo+shared") + depends_on("silo~shared", when="+silo~shared") ############### # ADIOS @@ -528,7 +522,9 @@ class Conduit(CMakePackage): if "+hdf5" in spec: cfg.write(cmake_cache_entry("HDF5_DIR", spec['hdf5'].prefix)) - cfg.write(cmake_cache_entry("ZLIB_DIR", spec['zlib'].prefix)) + if 'zlib' in spec: + # HDF5 depends on zlib + cfg.write(cmake_cache_entry("ZLIB_DIR", spec['zlib'].prefix)) else: cfg.write("# hdf5 not built by spack \n") diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index c177fbc3da..409e427345 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -108,6 +108,8 @@ class Hdf5(CMakePackage): conflicts('+java', when='@:1.9') # The Java wrappers cannot be built without shared libs. conflicts('+java', when='~shared') + # Fortran cannot be built with shared + conflicts('+fortran', when='+shared@:1.8') # There are several officially unsupported combinations of the features: # 1. Thread safety is not guaranteed via high-level C-API but in some cases diff --git a/var/spack/repos/builtin/packages/lbann/package.py b/var/spack/repos/builtin/packages/lbann/package.py index f14140dbdc..17002d679d 100644 --- a/var/spack/repos/builtin/packages/lbann/package.py +++ b/var/spack/repos/builtin/packages/lbann/package.py @@ -197,9 +197,12 @@ class Lbann(CMakePackage, CudaPackage, ROCmPackage): depends_on('cnpy', when='+numpy') depends_on('nccl', when='@0.94:0.98.2 +cuda') - depends_on('conduit@0.4.0: +hdf5~hdf5_compat ~python', when='@0.94:0 +conduit') - depends_on('conduit@0.5.0:0.6 +hdf5~hdf5_compat ~python', when='@0.100:0.101 +conduit') - depends_on('conduit@0.6.0: +hdf5~hdf5_compat~fortran~parmetis ~python', when='@:0.90,0.99:') + # Note that conduit defaults to +fortran +parmetis +python, none of which are + # necessary by LBANN: you may want to disable those options in your + # packages.yaml + depends_on('conduit@0.4.0: +hdf5', when='@0.94:0 +conduit') + depends_on('conduit@0.5.0:0.6 +hdf5', when='@0.100:0.101 +conduit') + depends_on('conduit@0.6.0: +hdf5', when='@:0.90,0.99:') # LBANN can use Python in two modes 1) as part of an extensible framework # and 2) to drive the front end model creation and launch diff --git a/var/spack/repos/builtin/packages/py-h5py/package.py b/var/spack/repos/builtin/packages/py-h5py/package.py index ef8957b858..0e71e29617 100644 --- a/var/spack/repos/builtin/packages/py-h5py/package.py +++ b/var/spack/repos/builtin/packages/py-h5py/package.py @@ -36,38 +36,39 @@ class PyH5py(PythonPackage): variant('mpi', default=True, description='Build with MPI support') # Python versions - depends_on('python@3.6:', type=('build', 'run'), when='@3.0.0:3.1') - depends_on('python@3.7:', type=('build', 'run'), when='@3.2.0:') + depends_on('python@3.6:', type=('build', 'run'), when='@3:3.1') + depends_on('python@3.7:', type=('build', 'run'), when='@3.2:') # Build dependencies depends_on('py-cython@0.23:', type='build', when='@:2') - depends_on('py-cython@0.29:', type=('build'), when='@3.0.0:^python@:3.7') - depends_on('py-cython@0.29.14:', type=('build'), when='@3.0.0:^python@3.8.0:3.8') - depends_on('py-cython@0.29.15:', type=('build'), when='@3.0.0:^python@3.9.0:') + depends_on('py-cython@0.29:', type=('build'), when='@3: ^python@:3.7') + depends_on('py-cython@0.29.14:', type=('build'), when='@3: ^python@3.8.0:3.8') + depends_on('py-cython@0.29.15:', type=('build'), when='@3: ^python@3.9.0:') depends_on('py-pkgconfig', type='build') depends_on('py-setuptools', type='build') - depends_on('py-wheel', type='build', when='@3.0.0:') + depends_on('py-wheel', type='build', when='@3:') # Build and runtime dependencies depends_on('py-cached-property@1.5:', type=('build', 'run'), when='^python@:3.7') depends_on('py-numpy@1.7:', type=('build', 'run'), when='@:2') - depends_on('py-numpy@1.12:', type=('build', 'run'), when='@3.0.0:^python@3.6.0:3.6') - depends_on('py-numpy@1.14.5:', type=('build', 'run'), when='@3.0.0:^python@3.7.0:3.7') - depends_on('py-numpy@1.17.5:', type=('build', 'run'), when='@3.0.0:^python@3.8.0:3.8') - depends_on('py-numpy@1.19.3:', type=('build', 'run'), when='@3.0.0:^python@3.9.0:') + depends_on('py-numpy@1.12:', type=('build', 'run'), when='@3: ^python@3.6.0:3.6') + depends_on('py-numpy@1.14.5:', type=('build', 'run'), when='@3: ^python@3.7.0:3.7') + depends_on('py-numpy@1.17.5:', type=('build', 'run'), when='@3: ^python@3.8.0:3.8') + depends_on('py-numpy@1.19.3:', type=('build', 'run'), when='@3: ^python@3.9.0:') depends_on('py-six', type=('build', 'run'), when='@:2') - # Link dependencies - depends_on('hdf5@1.8.4:1.11+hl', when='@:2') - depends_on('hdf5@1.8.4:+hl', when='@3.0.0:') + # Link dependencies (py-h5py v2 cannot build against HDF5 1.12 regardless + # of API setting) + depends_on('hdf5@1.8.4:1.11 +hl', when='@:2') + depends_on('hdf5@1.8.4: +hl', when='@3:') # MPI dependencies depends_on('hdf5+mpi', when='+mpi') depends_on('mpi', when='+mpi') depends_on('py-mpi4py', when='@:2 +mpi', type=('build', 'run')) - depends_on('py-mpi4py@3.0.0:', when='@3.0.0:3.2+mpi^python@3.0.0:3.7', type=('build', 'run')) - depends_on('py-mpi4py@3.0.2:', when='@3.3.0:+mpi^python@3.0.0:3.7', type=('build', 'run')) - depends_on('py-mpi4py@3.0.3:', when='@3.0.0:+mpi^python@3.8.0:', type=('build', 'run')) + depends_on('py-mpi4py@3:', when='@3:3.2+mpi^python@3:3.7', type=('build', 'run')) + depends_on('py-mpi4py@3.0.2:', when='@3.3.0:+mpi^python@3:3.7', type=('build', 'run')) + depends_on('py-mpi4py@3.0.3:', when='@3:+mpi^python@3.8.0:', type=('build', 'run')) def setup_build_environment(self, env): env.set('HDF5_DIR', self.spec['hdf5'].prefix) diff --git a/var/spack/repos/builtin/packages/silo/package.py b/var/spack/repos/builtin/packages/silo/package.py index 2982b56b67..2a2f490819 100644 --- a/var/spack/repos/builtin/packages/silo/package.py +++ b/var/spack/repos/builtin/packages/silo/package.py @@ -33,7 +33,7 @@ class Silo(AutotoolsPackage): variant('mpi', default=True, description='Compile with MPI Compatibility') variant('hdf5', default=True, - description='Use the HDF5 for database') + description='Support HDF5 for database I/O') variant('hzip', default=True, description='Enable hzip support') variant('fpzip', default=True, @@ -45,6 +45,7 @@ class Silo(AutotoolsPackage): depends_on('libtool', type='build', when='+shared') depends_on('mpi', when='+mpi') depends_on('hdf5', when='+hdf5') + depends_on('hdf5 api=v110', when='@:4.10 +hdf5 ^hdf5@1.12:') depends_on('qt+gui~framework@4.8:4.9', when='+silex') depends_on('libx11', when='+silex') # Xmu dependency is required on Ubuntu 18-20 @@ -55,11 +56,12 @@ class Silo(AutotoolsPackage): patch('remove-mpiposix.patch', when='@4.8:4.10.2') patch('H5FD_class_t-terminate.patch', when='@:4.10.2 ^hdf5@1.10.0:') # H5EPR_SEMI_COLON.patch should be applied only to silo@4.11 when building - # with hdf5@1.10.8 or later 1.10 or with hdf5@1.12.1 or later 1.12 - patch('H5EPR_SEMI_COLON.patch', when='@:4.11 ^hdf5@1.10.8:1.10,1.12.1:1.12') + # with hdf5@1.10.8 or later 1.10 or with hdf5@1.12.1 or later + patch('H5EPR_SEMI_COLON.patch', when='@:4.11 ^hdf5@1.10.8:1.10,1.12.1:') - conflicts('hdf5@1.10.8:', when="@:4.10.2") - conflicts('hdf5@1.13.0:', when="@:4.11") + conflicts('^hdf5 api=v18', when="@4.11: +hdf5") + conflicts('^hdf5 api=v112', when="@:4.10 +hdf5") + conflicts('^hdf5@1.13:', when="+hdf5") conflicts('+hzip', when="@4.11-bsd") conflicts('+fpzip', when="@4.11-bsd") conflicts('+hzip', when="@4.10.2-bsd") -- cgit v1.2.3-60-g2f50