From d1719dc2a523704b3607b4d3b37eb96225c5f486 Mon Sep 17 00:00:00 2001 From: storypku Date: Sun, 19 Jul 2020 22:11:44 -0700 Subject: [PATCH] Docker: remove hard-coded py3 version in boost installer --- docker/build/installers/install_boost.sh | 4 +++- docker/build/installers/installer_base.sh | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docker/build/installers/install_boost.sh b/docker/build/installers/install_boost.sh index fdc46da949..229c7877d1 100644 --- a/docker/build/installers/install_boost.sh +++ b/docker/build/installers/install_boost.sh @@ -46,11 +46,13 @@ download_if_not_cached "${PKG_NAME}" "${CHECKSUM}" "${DOWNLOAD_LINK}" tar xjf "${PKG_NAME}" +py3_ver="$(py3_version)" + # Ref: https://www.boost.org/doc/libs/1_73_0/doc/html/mpi/getting_started.html pushd "boost_${VERSION}" echo "using mpi : ${SYSROOT_DIR}/bin/mpicc ;" > user-config.jam ./bootstrap.sh \ - --with-python-version=3.6 \ + --with-python-version=${py3_ver} \ --prefix="${SYSROOT_DIR}" \ --without-icu diff --git a/docker/build/installers/installer_base.sh b/docker/build/installers/installer_base.sh index f4bc20a807..cce6d89987 100755 --- a/docker/build/installers/installer_base.sh +++ b/docker/build/installers/installer_base.sh @@ -36,6 +36,13 @@ export LOCAL_HTTP_ADDR="http://172.17.0.1:8388" export SUPPORTED_NVIDIA_SMS="6.0 6.1 7.0 7.2 7.5" +function py3_version() { + local version + # major.minor.rev (e.g. 3.6.9) expected + version="$(python3 --version | awk '{print $2}')" + echo "${version%.*}" +} + # Ref: https://reproducible-builds.org/docs/source-date-epoch function source_date_epoch_setup() { DATE_FMT="+%Y-%m-%d" -- GitLab