Skip to content

Commit

Permalink
toolchain: ensure pkg name consistency in blas & libint
Browse files Browse the repository at this point in the history
otherwise the packages get downloaded every time the script runs despite
already being present in build/
  • Loading branch information
dev-zero committed Aug 12, 2019
1 parent f4b239e commit 60fec48
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
10 changes: 6 additions & 4 deletions tools/toolchain/scripts/get_openblas_arch.sh
Expand Up @@ -5,6 +5,8 @@ SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")" && pwd -P)"

openblas_ver="0.3.6" # Keep in sync with install_openblas.sh.
openblas_sha256="e64c8fe083832ffbc1459ab6c72f71d53afd3b36e8497c922a15a06b72e9002f"
openblas_pkg="OpenBLAS-${openblas_ver}.tar.gz"

source "${SCRIPT_DIR}"/common_vars.sh
source "${SCRIPT_DIR}"/tool_kit.sh
source "${SCRIPT_DIR}"/signal_trap.sh
Expand All @@ -30,14 +32,14 @@ echo "==================== Getting proc arch info using OpenBLAS tools =========
openblas_dir="$(find_openblas_dir)"
# if cannot find openblas source dir, try download one
if ! [ "$openblas_dir" ] ; then
if [ -f openblas-${openblas_ver}.tar.gz ] ; then
echo "openblas-${openblas_ver}.tar.gz is found"
if [ -f ${openblas_pkg} ] ; then
echo "${openblas_pkg} is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${openblas_sha256} \
https://github.com/xianyi/OpenBLAS/archive/v${openblas_ver}.tar.gz \
-o OpenBLAS-${openblas_ver}.tar.gz
-o ${openblas_pkg}
fi
tar -xzf OpenBLAS-${openblas_ver}.tar.gz
tar -xzf ${openblas_pkg}
openblas_dir="$(find_openblas_dir)"
fi
openblas_conf="${openblas_dir}/Makefile.conf"
Expand Down
7 changes: 4 additions & 3 deletions tools/toolchain/scripts/install_libint.sh
Expand Up @@ -9,6 +9,7 @@ source "${INSTALLDIR}"/toolchain.conf
source "${INSTALLDIR}"/toolchain.env

libint_ver="2.5.0"
libint_pkg="libint-v${libint_ver}-cp2k-lmax-${LIBINT_LMAX}.tgz"

case "$LIBINT_LMAX" in
4)
Expand Down Expand Up @@ -45,15 +46,15 @@ case "$with_libint" in
if verify_checksums "${install_lock_file}" ; then
echo "libint-${libint_ver} is already installed, skipping it."
else
if [ -f libint_cp2k-${libint_ver}.tgz ] ; then
echo "libint_cp2k-${libint_ver}.tgz is found"
if [ -f ${libint_pkg} ] ; then
echo "${libint_pkg} is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${libint_sha256} \
https://github.com/cp2k/libint-cp2k/releases/download/v${libint_ver}/libint-v${libint_ver}-cp2k-lmax-${LIBINT_LMAX}.tgz
fi

[ -d libint-v${libint_ver}-cp2k-lmax-${LIBINT_LMAX} ] && rm -rf libint-v${libint_ver}-cp2k-lmax-${LIBINT_LMAX}
tar -xzf libint-v${libint_ver}-cp2k-lmax-${LIBINT_LMAX}.tgz
tar -xzf ${libint_pkg}

echo "Installing from scratch into ${pkg_install_dir}"
cd libint-v${libint_ver}-cp2k-lmax-${LIBINT_LMAX}
Expand Down
10 changes: 6 additions & 4 deletions tools/toolchain/scripts/install_openblas.sh
Expand Up @@ -4,6 +4,8 @@ SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")" && pwd -P)"

openblas_ver="0.3.6" # Keep in sync with get_openblas_arch.sh.
openblas_sha256="e64c8fe083832ffbc1459ab6c72f71d53afd3b36e8497c922a15a06b72e9002f"
openblas_pkg="OpenBLAS-${openblas_ver}.tar.gz"

source "${SCRIPT_DIR}"/common_vars.sh
source "${SCRIPT_DIR}"/tool_kit.sh
source "${SCRIPT_DIR}"/signal_trap.sh
Expand All @@ -29,17 +31,17 @@ case "$with_openblas" in
if verify_checksums "${install_lock_file}" ; then
echo "openblas-${openblas_ver} is already installed, skipping it."
else
if [ -f OpenBLAS-${openblas_ver}.tar.gz ] ; then
echo "OpenBLAS-${openblas_ver}.tar.gz is found"
if [ -f ${openblas_pkg} ] ; then
echo "${openblas_pkg} is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${openblas_sha256} \
https://github.com/xianyi/OpenBLAS/archive/v${openblas_ver}.tar.gz \
-o OpenBLAS-${openblas_ver}.tar.gz
-o ${openblas_pkg}
fi

echo "Installing from scratch into ${pkg_install_dir}"
[ -d OpenBLAS-${openblas_ver} ] && rm -rf OpenBLAS-${openblas_ver}
tar -zxf OpenBLAS-${openblas_ver}.tar.gz
tar -zxf ${openblas_pkg}
cd OpenBLAS-${openblas_ver}

for patch in "${PATCHES[@]}" ; do
Expand Down

0 comments on commit 60fec48

Please sign in to comment.