Skip to content

Commit

Permalink
Install header-only Boost in the image
Browse files Browse the repository at this point in the history
Refactor the Dockerfile so we have one file for both arches.
  • Loading branch information
bryanwweber committed Jul 16, 2024
1 parent c042c21 commit 9ccd118
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 18 deletions.
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
9 changes: 0 additions & 9 deletions Dockerfile_aarch64

This file was deleted.

9 changes: 0 additions & 9 deletions Dockerfile_x86_64

This file was deleted.

14 changes: 14 additions & 0 deletions install_boost.sh
Original file line number Diff line number Diff line change
@@ -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}

0 comments on commit 9ccd118

Please sign in to comment.