mirror of
https://github.com/TREX-CoE/trexio.git
synced 2024-11-03 12:43:55 +01:00
add Docker files and bash scripts to build HDF5 1.12 in manylinux containers
This commit is contained in:
parent
11dadaab36
commit
66cf305a40
15
docker/hdf5-on-docker/Dockerfile_2010_x86_64
Normal file
15
docker/hdf5-on-docker/Dockerfile_2010_x86_64
Normal file
@ -0,0 +1,15 @@
|
||||
# ===========================================================================
|
||||
# Script from the hdf5-manylinux repo:
|
||||
# https://github.com/h5py/hdf5-manylinux/blob/master/Dockerfile_x86_64
|
||||
# ===========================================================================
|
||||
|
||||
FROM quay.io/pypa/manylinux2010_x86_64
|
||||
|
||||
ENV HDF5_DIR /usr/local
|
||||
ENV HDF5_VERSION 1.12.1
|
||||
|
||||
COPY install_libaec.sh /tmp/install_libaec.sh
|
||||
RUN bash /tmp/install_libaec.sh
|
||||
COPY install_hdf5_centos.sh /tmp/install_hdf5.sh
|
||||
RUN bash /tmp/install_hdf5.sh
|
||||
|
15
docker/hdf5-on-docker/Dockerfile_2014_aarch64
Normal file
15
docker/hdf5-on-docker/Dockerfile_2014_aarch64
Normal file
@ -0,0 +1,15 @@
|
||||
# ===========================================================================
|
||||
# Script from the hdf5-manylinux repo:
|
||||
# https://github.com/h5py/hdf5-manylinux/blob/master/Dockerfile_aarch64
|
||||
# ===========================================================================
|
||||
|
||||
FROM quay.io/pypa/manylinux2014_aarch64
|
||||
|
||||
ENV HDF5_DIR /usr/local
|
||||
ENV HDF5_VERSION 1.12.1
|
||||
|
||||
COPY install_libaec.sh /tmp/install_libaec.sh
|
||||
RUN bash /tmp/install_libaec.sh
|
||||
COPY install_hdf5_centos.sh /tmp/install_hdf5.sh
|
||||
RUN bash /tmp/install_hdf5.sh
|
||||
|
10
docker/hdf5-on-docker/Dockerfile_2014_x86_64
Normal file
10
docker/hdf5-on-docker/Dockerfile_2014_x86_64
Normal file
@ -0,0 +1,10 @@
|
||||
FROM quay.io/pypa/manylinux2014_x86_64
|
||||
|
||||
ENV HDF5_DIR /usr/local
|
||||
ENV HDF5_VERSION 1.12.1
|
||||
|
||||
COPY install_libaec.sh /tmp/install_libaec.sh
|
||||
RUN bash /tmp/install_libaec.sh
|
||||
COPY install_hdf5_centos.sh /tmp/install_hdf5.sh
|
||||
RUN bash /tmp/install_hdf5.sh
|
||||
|
10
docker/hdf5-on-docker/Dockerfile_2_24_aarch64
Normal file
10
docker/hdf5-on-docker/Dockerfile_2_24_aarch64
Normal file
@ -0,0 +1,10 @@
|
||||
FROM quay.io/pypa/manylinux_2_24_aarch64
|
||||
|
||||
ENV HDF5_DIR /usr/local
|
||||
ENV HDF5_VERSION 1.12.1
|
||||
|
||||
COPY install_libaec.sh /tmp/install_libaec.sh
|
||||
RUN bash /tmp/install_libaec.sh
|
||||
COPY install_hdf5_debian.sh /tmp/install_hdf5.sh
|
||||
RUN bash /tmp/install_hdf5.sh
|
||||
|
10
docker/hdf5-on-docker/Dockerfile_2_24_x86_64
Normal file
10
docker/hdf5-on-docker/Dockerfile_2_24_x86_64
Normal file
@ -0,0 +1,10 @@
|
||||
FROM quay.io/pypa/manylinux_2_24_x86_64
|
||||
|
||||
ENV HDF5_DIR /usr/local
|
||||
ENV HDF5_VERSION 1.12.1
|
||||
|
||||
COPY install_libaec.sh /tmp/install_libaec.sh
|
||||
RUN bash /tmp/install_libaec.sh
|
||||
COPY install_hdf5_debian.sh /tmp/install_hdf5.sh
|
||||
RUN bash /tmp/install_hdf5.sh
|
||||
|
16
docker/hdf5-on-docker/build_images.sh
Executable file
16
docker/hdf5-on-docker/build_images.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
# currently cannot build ARM64 images on the AMD64 platform due to the error:
|
||||
# standard_init_linux.go:219: exec user process caused: exec format error
|
||||
#for tag in 2010_x86_64 2014_x86_64 2_24_x86_64 2014_aarch64 2_24_aarch64
|
||||
|
||||
# build only x86_64 images
|
||||
for tag in 2010_x86_64 2014_x86_64 2_24_x86_64
|
||||
do
|
||||
echo "Building image on ${tag} platform"
|
||||
docker build -t hdf5_1_12_on_${tag} . -f Dockerfile_${tag}
|
||||
done
|
||||
|
34
docker/hdf5-on-docker/install_hdf5_centos.sh
Normal file
34
docker/hdf5-on-docker/install_hdf5_centos.sh
Normal file
@ -0,0 +1,34 @@
|
||||
# ===========================================================================
|
||||
# Script from the hdf5-manylinux repo:
|
||||
# https://github.com/h5py/hdf5-manylinux/blob/master/install_hdf5.sh
|
||||
# ===========================================================================
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "Installing zlib with yum"
|
||||
yum -y install zlib-devel
|
||||
|
||||
pushd /tmp
|
||||
|
||||
# This seems to be needed to find libsz.so.2
|
||||
ldconfig
|
||||
|
||||
echo "Downloading & unpacking HDF5 ${HDF5_VERSION}"
|
||||
# Remove trailing .*, to get e.g. '1.12' ↓
|
||||
curl -fsSLO "https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-${HDF5_VERSION%.*}/hdf5-$HDF5_VERSION/src/hdf5-$HDF5_VERSION.tar.gz"
|
||||
tar -xzvf hdf5-$HDF5_VERSION.tar.gz
|
||||
pushd hdf5-$HDF5_VERSION
|
||||
chmod u+x autogen.sh
|
||||
|
||||
echo "Configuring, building & installing HDF5 ${HDF5_VERSION} to ${HDF5_DIR}"
|
||||
./configure --prefix $HDF5_DIR --enable-build-mode=production --with-szlib
|
||||
make -j $(nproc)
|
||||
make install
|
||||
popd
|
||||
|
||||
# Clean up to limit the size of the Docker image
|
||||
echo "Cleaning up unnecessary files"
|
||||
rm -r hdf5-$HDF5_VERSION
|
||||
rm hdf5-$HDF5_VERSION.tar.gz
|
||||
|
||||
yum -y erase zlib-devel
|
32
docker/hdf5-on-docker/install_hdf5_debian.sh
Normal file
32
docker/hdf5-on-docker/install_hdf5_debian.sh
Normal file
@ -0,0 +1,32 @@
|
||||
# ===========================================================================
|
||||
# Debian-adapted script from the hdf5-manylinux repo:
|
||||
# https://github.com/h5py/hdf5-manylinux/blob/master/install_hdf5.sh
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
pushd /tmp
|
||||
|
||||
# This seems to be needed to find libsz.so.2
|
||||
ldconfig
|
||||
|
||||
echo "Downloading & unpacking HDF5 ${HDF5_VERSION}"
|
||||
# Remove trailing .*, to get e.g. '1.12' ↓
|
||||
curl -fsSLO "https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-${HDF5_VERSION%.*}/hdf5-$HDF5_VERSION/src/hdf5-$HDF5_VERSION.tar.gz"
|
||||
tar -xzvf hdf5-$HDF5_VERSION.tar.gz
|
||||
pushd hdf5-$HDF5_VERSION
|
||||
chmod u+x autogen.sh
|
||||
|
||||
echo "Configuring, building & installing HDF5 ${HDF5_VERSION} to ${HDF5_DIR}"
|
||||
./configure --prefix $HDF5_DIR --enable-build-mode=production --with-szlib
|
||||
make -j $(nproc)
|
||||
make install
|
||||
popd
|
||||
|
||||
# Clean up to limit the size of the Docker image
|
||||
echo "Cleaning up unnecessary files"
|
||||
rm -r hdf5-$HDF5_VERSION
|
||||
rm hdf5-$HDF5_VERSION.tar.gz
|
||||
|
||||
apt-get -y remove zlib1g-dev
|
28
docker/hdf5-on-docker/install_libaec.sh
Normal file
28
docker/hdf5-on-docker/install_libaec.sh
Normal file
@ -0,0 +1,28 @@
|
||||
# ===========================================================================
|
||||
# Script from the hdf5-manylinux repo:
|
||||
# https://github.com/h5py/hdf5-manylinux/blob/master/install_libaec.sh
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
# libaec implements szip compression, so the optional szip filter can be built
|
||||
# in HDF5.
|
||||
set -euo pipefail
|
||||
|
||||
pushd /tmp
|
||||
|
||||
aec_version="1.0.4"
|
||||
|
||||
echo "Downloading libaec"
|
||||
# The URL includes a hash, so it needs to change if the version does
|
||||
curl -fsSLO https://gitlab.dkrz.de/k202009/libaec/uploads/ea0b7d197a950b0c110da8dfdecbb71f/libaec-${aec_version}.tar.gz
|
||||
tar zxf libaec-$aec_version.tar.gz
|
||||
|
||||
echo "Building & installing libaec"
|
||||
pushd libaec-$aec_version
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
# Clean up the files from the build
|
||||
popd
|
||||
rm -r libaec-$aec_version libaec-$aec_version.tar.gz
|
Loading…
Reference in New Issue
Block a user