Skip to content

Commit

Permalink
h5hut: fix to work with latest hdf5 (H5_USE_110_API) (spack#42607)
Browse files Browse the repository at this point in the history
  • Loading branch information
biddisco authored Feb 12, 2024
1 parent 742e2fc commit c33a8dc
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion var/spack/repos/builtin/packages/h5hut/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,22 @@ class H5hut(AutotoolsPackage):

homepage = "https://amas.psi.ch/H5hut/"
url = "https://amas.web.psi.ch/Downloads/H5hut/H5hut-2.0.0rc3.tar.gz"
git = "https://gitlab.psi.ch/H5hut/src.git"

version("2.0.0rc3", sha256="1ca9a9478a99e1811ecbca3c02cc49258050d339ffb1a170006eab4ab2a01790")

version("master", branch="master")

variant("fortran", default=True, description="Enable Fortran support")
variant("mpi", default=True, description="Enable MPI support")

depends_on("autoconf", type="build", when="build_system=autotools")
depends_on("automake", type="build", when="build_system=autotools")
depends_on("libtool", type="build", when="build_system=autotools")

depends_on("mpi", when="+mpi")
# h5hut +mpi uses the obsolete function H5Pset_fapl_mpiposix:
depends_on("hdf5@1.8:1.8.12+mpi", when="+mpi")
depends_on("hdf5@1.8:+mpi", when="+mpi")
depends_on("hdf5@1.8:", when="~mpi")

# If built in parallel, the following error message occurs:
Expand All @@ -35,6 +42,15 @@ def validate(self):
if "+fortran" in self.spec and not self.compiler.fc:
raise RuntimeError("Cannot build Fortran variant without a Fortran compiler.")

def flag_handler(self, name, flags):
build_system_flags = []
if name == "cflags" and self.spec["hdf5"].satisfies("@1.12:"):
build_system_flags = ["-DH5_USE_110_API"]
return flags, None, build_system_flags

def autoreconf(self, spec, prefix):
which("bash")("autogen.sh")

def configure_args(self):
spec = self.spec
config_args = ["--enable-shared"]
Expand Down

0 comments on commit c33a8dc

Please sign in to comment.