Skip to content

Commit

Permalink
[HDF5] Update to v1.12.1
Browse files Browse the repository at this point in the history
Simplify recipe: use Anaconda builds for all non-Windows platforms.  Also, add
some more comments in sources, to hopefully simplify future updates.
  • Loading branch information
giordano committed Jan 10, 2022
1 parent 3e5f5e6 commit 54c3b73
Showing 1 changed file with 17 additions and 58 deletions.
75 changes: 17 additions & 58 deletions H/HDF5/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@ using BinaryBuilder

# Collection of sources required to build HDF5
name = "HDF5"
version = v"1.12.0"
version = v"1.12.1"

sources = [
FileSource("https://files.pythonhosted.org/packages/d5/f9/676c6a5c13806289da6177c538ce772e3e5b04ea10d76e6e72e9f0d042de/h5py-3.1.0-cp39-cp39-macosx_10_9_x86_64.whl", "cb74df83709d6d03d11e60b9480812f58da34f194beafa8c8314dbbeeedfe0a6"),

FileSource("https://files.pythonhosted.org/packages/40/1b/dd36e8aa1b7c9d82a1f0aaabece4393797ded0ff613437dfb8c0780b33a9/h5py-3.1.0-cp39-cp39-manylinux1_x86_64.whl", "80c623be10479e81b64fa713b7ed4c0bbe9f02e8e7d2a2e5382336087b615ce4"),

ArchiveSource("http://repo.msys2.org/mingw/i686/mingw-w64-i686-hdf5-1.12.0-2-any.pkg.tar.zst", "d9ade0d0fddfdeca3ea9de00b066e330e1573c547609a12b81c6a080b2c19f3e", unpack_target = "i686-w64-mingw32"),
ArchiveSource("http://repo.msys2.org/mingw/i686/mingw-w64-i686-szip-2.1.1-2-any.pkg.tar.xz", "58b5efe1420a2bfd6e92cf94112d29b03ec588f54f4a995a1b26034076f0d369", unpack_target = "i686-w64-mingw32"),
ArchiveSource("http://repo.msys2.org/mingw/i686/mingw-w64-i686-zlib-1.2.11-7-any.pkg.tar.xz", "addf6c52134027407640f1cbdf4efc5b64430f3a286cb4e4c4f5dbb44ce55a42", unpack_target = "i686-w64-mingw32"),
# 32-bit Windows from https://packages.msys2.org/package/mingw-w64-i686-hdf5
ArchiveSource("https://mirror.msys2.org/mingw/mingw32/mingw-w64-i686-hdf5-1.12.1-2-any.pkg.tar.zst", "ab7e4568c99e2a7a9b96ad06867ef9e829d286539e0735a93b9295ad8778a818"; unpack_target="i686-w64-mingw32"),
ArchiveSource("https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-libaec-1.0.6-1-any.pkg.tar.zst", "43ef1aee2be7cc192d14c6641627ed0a1eca50c21234eba3405fce77302517a8"; unpack_target="i686-w64-mingw32"),
ArchiveSource("https://mirror.msys2.org/mingw/mingw32/mingw-w64-i686-zlib-1.2.11-9-any.pkg.tar.zst", "8d594fc14497d41a66415bfdd200d7d1d56a6ecd3fe81b9190bec0c4841a5eff"; unpack_target="i686-w64-mingw32"),
# We need some special compiler support libraries from mingw for i686
ArchiveSource("http://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-libs-10.2.0-5-any.pkg.tar.zst", "e03a63b24695951a1e80def754d6bd128744eaf1e562308ded31e989636e7651", unpack_target = "i686-w64-mingw32"),

ArchiveSource("http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-hdf5-1.12.0-2-any.pkg.tar.zst", "549462ad99a079ff725ac4bd1f662d3594515320ea324a7263a647578b258d86", unpack_target = "x86_64-w64-mingw32"),
ArchiveSource("http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-szip-2.1.1-2-any.pkg.tar.xz", "ec8fe26370b0673c4b91f5ccf3404907dc7c24cb9d75c7b8830aa93a7c13ace7", unpack_target = "x86_64-w64-mingw32"),
ArchiveSource("http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-zlib-1.2.11-7-any.pkg.tar.xz", "1decf05b8ae6ab10ddc9035929014837c18dd76da825329023da835aec53cec2", unpack_target = "x86_64-w64-mingw32"),

# Can't use conda-forge on other platforms since it links too many libraries, but apparently on aarch64 is fine
ArchiveSource("https://anaconda.org/conda-forge/hdf5/1.12.0/download/linux-aarch64/hdf5-1.12.0-nompi_h1022a3e_102.tar.bz2", "605aff906fd0fca9a52da6ad9b48607fab5cb26e2615d3827a1f318d6e103c4a", unpack_target = "aarch64-linux-gnu"),
ArchiveSource("https://anaconda.org/conda-forge/hdf5/1.12.0/download/osx-arm64/hdf5-1.12.0-nompi_had0e5e0_107.tar.bz2", "79bde5381be9a6bc9696173e1be7dfb7c2675e1d4efee5105b8d66cb7cb93a16", unpack_target = "aarch64-apple-darwin20"),
ArchiveSource("https://mirror.msys2.org/mingw/mingw32/mingw-w64-i686-gcc-libs-11.2.0-6-any.pkg.tar.zst", "bdc359047f61c8e96401ba25b17c80f5f8039c25a063c622e3680123bb0de9d1"; unpack_target="i686-w64-mingw32"),

# 64-bit Windows from https://packages.msys2.org/package/mingw-w64-x86_64-hdf5
ArchiveSource("https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-hdf5-1.12.1-2-any.pkg.tar.zst", "540d8b9fd71d0d848e28723f531948dea497c7cb8f95c53e1a3b06f750f12c40"; unpack_target="x86_64-w64-mingw32"),
ArchiveSource("https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-libaec-1.0.6-1-any.pkg.tar.zst", "43ef1aee2be7cc192d14c6641627ed0a1eca50c21234eba3405fce77302517a8"; unpack_target="x86_64-w64-mingw32"),
ArchiveSource("https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-zlib-1.2.11-9-any.pkg.tar.zst", "9da9ebafaef832dba2f442ad44d9ae8759784b86478dcbe326500195f8ea6339"; unpack_target="x86_64-w64-mingw32"),

# x86_64 and aarch64 for Linux and macOS from https://anaconda.org/conda-forge/hdf5/files
ArchiveSource("https://anaconda.org/conda-forge/hdf5/1.12.1/download/linux-64/hdf5-1.12.1-nompi_h7f166f4_103.tar.bz2", "a17c23e1c0992e7af96245da4d122dea09a16cb880af0bc6bdd768e561c1ae75"; unpack_target="x86_64-linux-gnu"),
ArchiveSource("https://anaconda.org/conda-forge/hdf5/1.12.1/download/linux-aarch64/hdf5-1.12.1-nompi_he09bf5b_103.tar.bz2", "b5a923cf26b76b341e09c194a638e4840ffa5e99a67a99d1a8836554e094cec6"; unpack_target="aarch64-linux-gnu"),
ArchiveSource("https://anaconda.org/conda-forge/hdf5/1.12.1/download/osx-64/hdf5-1.12.1-nompi_h2f0ef1a_103.tar.bz2", "d628295cc8d8358dbfbe1037b31f2e181efc06f008ae6711da409413a3cb5695"; unpack_target="x86_64-apple-darwin14"),
ArchiveSource("https://anaconda.org/conda-forge/hdf5/1.12.1/download/osx-arm64/hdf5-1.12.1-nompi_had0e5e0_103.tar.bz2", "ef48b684b22c6b0077bc9836e0cc6d15abb88868d7a6c842226666ebb8bbd449"; unpack_target="aarch64-apple-darwin20"),
]

# Bash recipe for building across all platforms
Expand All @@ -45,47 +45,6 @@ elif [[ ${target} == aarch64-* ]]; then
mv include/* ${includedir}
install_license info/licenses/COPYING
else
if [[ ${target} == x86_64-linux-gnu ]]; then
WHL_FILE="*h5py-*manylinux1_x86_64*.whl"
LIBSDIR=h5py.libs
elif [[ ${target} == x86_64-apple-darwin* ]]; then
WHL_FILE="*h5py-*macosx*.whl"
LIBSDIR=h5py/.dylibs
else
echo "ERROR: Unsupported platform ${target}" >&2
exit 1
fi
unzip ${WHL_FILE}
mv ${LIBSDIR}/* ${libdir}
# Use headers and license from aarch64-linux-gnu with the hope that they'll be fine
mv aarch64-*/include/* ${includedir}
install_license aarch64-*/info/licenses/COPYING
fi
# We want to have the files with the simple name lib.extension, without
# soversion, to make linking to these libraries easier
if [[ ! ${target} == *-mingw* ]]; then
for lib in libhdf5 libhdf5_hl; do
# We also need to be able to access `libhdf5` and `libhdf5_hl` directly,
# so symlink it from the hashed filename from manylinux pypi
if [[ ${target} == *86*linux* ]]; then
name=$(basename ${libdir}/${lib}-*.${dlext}*)
base="${name%%.*}"
ext="${name#$base}"
ln -s "${name}" "${libdir}/${lib}${ext}"
fi
dest="${libdir}/${lib}.${dlext}"
if [[ ! -f "${dest}" ]]; then
link_target=$(find ${libdir} -name "${lib}.*.${dlext}" -or -name "${lib}.${dlext}.*")
ln -s $(basename "${link_target}") "${dest}"
fi
# Double check that the file links to an existing file
[ -f $(realpath "${dest}") ]
done
fi
"""

Expand Down

0 comments on commit 54c3b73

Please sign in to comment.