silo: resolve hdf5 develop-X.Y branch versions (#39344)

This commit is contained in:
William R Tobin 2024-10-27 05:44:20 -07:00 committed by GitHub
parent 12a475e648
commit fea2171672
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -142,8 +142,14 @@ def flag_handler(self, name, flags):
# presented with an HDF5 API consistent with the HDF5 version.
# Use the latest even-numbered API version, i.e. v1.13.1 uses
# API v1.12
maj_ver = int(spec["hdf5"].version[0])
min_ver = int(spec["hdf5"].version[1])
# hdf5 support branches have a `develop` prefix
if "develop" in str(spec["hdf5"].version):
maj_ver = int(spec["hdf5"].version[1])
min_ver = int(spec["hdf5"].version[2])
else:
maj_ver = int(spec["hdf5"].version[0])
min_ver = int(spec["hdf5"].version[1])
min_apiver = int(min_ver / 2) * 2
flags.append("-DH5_USE_{0}{1}_API".format(maj_ver, min_apiver))