From 9ccd1185d85628fa3f1533ff234d71e4daacef47 Mon Sep 17 00:00:00 2001 From: Bryan Weber Date: Tue, 16 Jul 2024 10:33:22 -0400 Subject: [PATCH] Install header-only Boost in the image Refactor the Dockerfile so we have one file for both arches. --- Dockerfile | 18 ++++++++++++++++++ Dockerfile_aarch64 | 9 --------- Dockerfile_x86_64 | 9 --------- install_boost.sh | 14 ++++++++++++++ 4 files changed, 32 insertions(+), 18 deletions(-) create mode 100644 Dockerfile delete mode 100644 Dockerfile_aarch64 delete mode 100644 Dockerfile_x86_64 create mode 100644 install_boost.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2dd714a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +# Note, TARGET_ARCH must be defined as a build-time arg, it is deliberately different +# from TARGETARCH which is defined by docker. The reason is because TARGETARCH=amd64 +# but we need TARGET_ARCH=x86_64 +ARG TARGET_ARCH +FROM quay.io/pypa/manylinux2014_${TARGET_ARCH}:latest + +ARG BOOST_VERSION=1.85.0 +ARG HDF5_VERSION=1.14.2 + +ENV HDF5_VERSION=${HDF5_VERSION} \ + HDF5_DIR=/usr/local \ + BOOST_DIR=/usr/local \ + BOOST_VERSION=${BOOST_VERSION} + +COPY install_libaec.sh install_hdf5.sh install_boost.sh /tmp/ +RUN bash /tmp/install_libaec.sh +RUN bash /tmp/install_hdf5.sh +RUN bash /tmp/install_boost.sh diff --git a/Dockerfile_aarch64 b/Dockerfile_aarch64 deleted file mode 100644 index 9f6ed9e..0000000 --- a/Dockerfile_aarch64 +++ /dev/null @@ -1,9 +0,0 @@ -FROM quay.io/pypa/manylinux2014_aarch64 - -ENV HDF5_VERSION 1.14.2 -ENV HDF5_DIR /usr/local - -COPY install_libaec.sh /tmp/install_libaec.sh -RUN bash /tmp/install_libaec.sh -COPY install_hdf5.sh /tmp/install_hdf5.sh -RUN bash /tmp/install_hdf5.sh diff --git a/Dockerfile_x86_64 b/Dockerfile_x86_64 deleted file mode 100644 index 56f2909..0000000 --- a/Dockerfile_x86_64 +++ /dev/null @@ -1,9 +0,0 @@ -FROM quay.io/pypa/manylinux2014_x86_64 - -ENV HDF5_VERSION 1.14.2 -ENV HDF5_DIR /usr/local - -COPY install_libaec.sh /tmp/install_libaec.sh -RUN bash /tmp/install_libaec.sh -COPY install_hdf5.sh /tmp/install_hdf5.sh -RUN bash /tmp/install_hdf5.sh diff --git a/install_boost.sh b/install_boost.sh new file mode 100644 index 0000000..f6b6589 --- /dev/null +++ b/install_boost.sh @@ -0,0 +1,14 @@ +set -euo pipefail + +BOOST_DOWNLOAD_FILE="boost-cmake.tar.xz" +curl -fsSL -o $BOOST_DOWNLOAD_FILE https://github.com/boostorg/boost/releases/download/boost-${BOOST_VERSION}/boost-${BOOST_VERSION}-cmake.tar.xz +tar -xvf $BOOST_DOWNLOAD_FILE +pushd boost-${BOOST_VERSION} + +./boostrap.sh --prefix=${BOOST_DIR} +# We have to explicitly include cmakedir here so that cmake files are installed +./b2 variant=release toolset=gcc --with-headers --cmakedir=${BOOST_DIR}/lib/cmake install + +popd + +rm -rf boost-${BOOST_VERSION} ${BOOST_DOWNLOAD_FILE}