Toolchain: Hardcode cp2k.org in download helper

This commit is contained in:
Ole Schütt 2022-10-01 19:46:53 +02:00 committed by Ole Schütt
parent d6c4295397
commit 68e7d5f921
28 changed files with 32 additions and 97 deletions

View file

@ -13,9 +13,6 @@ SETUPFILE=${SETUPFILE:-"${INSTALLDIR}/setup"}
ARCH_FILE_TEMPLATE=${ARCH_FILE_TEMPLATE:-"${SCRIPTDIR}/arch_base.tmpl"}
VERSION_FILE=${VERSION_FILE:-"${SCRIPTDIR}/VERSION"}
# downloader flags, used for downloading tarballs, see download_pkg macro in tool_kit.sh
DOWNLOADER_FLAGS="${DOWNLOADER_FLAGS:-}"
# system arch gotten from OpenBLAS prebuild
OPENBLAS_ARCH=${OPENBLAS_ARCH:-"x86_64"}
OPENBLAS_LIBCORE=${OPENBLAS_LIBCORE:-''}

View file

@ -38,8 +38,7 @@ if ! [ "$openblas_dir" ]; then
if [ -f ${openblas_pkg} ]; then
echo "${openblas_pkg} is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${openblas_sha256} \
https://www.cp2k.org/static/downloads/${openblas_pkg}
download_pkg_from_cp2k_org "${openblas_sha256}" "${openblas_pkg}"
fi
tar -xzf ${openblas_pkg}
openblas_dir="$(find_openblas_dir)"

View file

@ -40,8 +40,7 @@ case "${with_cmake}" in
if [ -f cmake-${cmake_ver}-${cmake_arch}.sh ]; then
echo "cmake-${cmake_ver}-${cmake_arch}.sh is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${cmake_sha256} \
https://github.com/Kitware/CMake/releases/download/v${cmake_ver}/cmake-${cmake_ver}-${cmake_arch}.sh
download_pkg_from_cp2k_org "${cmake_sha256}" "cmake-${cmake_ver}-${cmake_arch}.sh"
fi
echo "Installing from scratch into ${pkg_install_dir}"
mkdir -p ${pkg_install_dir}

View file

@ -34,8 +34,7 @@ case "${with_gcc}" in
if [ -f gcc-${gcc_ver}.tar.gz ]; then
echo "gcc-${gcc_ver}.tar.gz is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${gcc_sha256} \
"https://www.cp2k.org/static/downloads/gcc-${gcc_ver}.tar.gz"
download_pkg_from_cp2k_org "${gcc_sha256}" "gcc-${gcc_ver}.tar.gz"
fi
[ -d gcc-${gcc_ver} ] && rm -rf gcc-${gcc_ver}
tar -xzf gcc-${gcc_ver}.tar.gz

View file

@ -36,8 +36,7 @@ case "${with_mpich}" in
if [ -f ${mpich_pkg} ]; then
echo "${mpich_pkg} is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${mpich_sha256} \
https://www.cp2k.org/static/downloads/${mpich_pkg}
download_pkg_from_cp2k_org "${mpich_sha256}" "${mpich_pkg}"
fi
echo "Installing from scratch into ${pkg_install_dir}"
[ -d mpich-${mpich_ver} ] && rm -rf mpich-${mpich_ver}

View file

@ -36,8 +36,7 @@ case "${with_openmpi}" in
if [ -f ${openmpi_pkg} ]; then
echo "${openmpi_pkg} is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${openmpi_sha256} \
"https://www.cp2k.org/static/downloads/${openmpi_pkg}"
download_pkg_from_cp2k_org "${openmpi_sha256}" "${openmpi_pkg}"
fi
echo "Installing from scratch into ${pkg_install_dir}"
[ -d openmpi-${openmpi_ver} ] && rm -rf openmpi-${openmpi_ver}

View file

@ -36,8 +36,7 @@ case "${with_openblas}" in
if [ -f ${openblas_pkg} ]; then
echo "${openblas_pkg} is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${openblas_sha256} \
https://www.cp2k.org/static/downloads/${openblas_pkg}
download_pkg_from_cp2k_org "${openblas_sha256}" "${openblas_pkg}"
fi
echo "Installing from scratch into ${pkg_install_dir}"

View file

@ -37,8 +37,7 @@ case "$with_fftw" in
if [ -f ${fftw_pkg} ]; then
echo "${fftw_pkg} is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${fftw_sha256} \
"https://www.cp2k.org/static/downloads/${fftw_pkg}"
download_pkg_from_cp2k_org "${fftw_sha256}" "${fftw_pkg}"
fi
echo "Installing from scratch into ${pkg_install_dir}"
[ -d fftw-${fftw_ver} ] && rm -rf fftw-${fftw_ver}

View file

@ -53,8 +53,7 @@ case "$with_libint" in
if [ -f ${libint_pkg} ]; then
echo "${libint_pkg} is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${libint_sha256} \
"https://www.cp2k.org/static/downloads/${libint_pkg}"
download_pkg_from_cp2k_org "${libint_sha256}" "${libint_pkg}"
fi
[ -d libint-v${libint_ver}-cp2k-lmax-${LIBINT_LMAX} ] && rm -rf libint-v${libint_ver}-cp2k-lmax-${LIBINT_LMAX}

View file

@ -33,8 +33,7 @@ case "$with_libxc" in
if [ -f libxc-${libxc_ver}.tar.gz ]; then
echo "libxc-${libxc_ver}.tar.gz is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${libxc_sha256} \
https://www.cp2k.org/static/downloads/libxc-${libxc_ver}.tar.gz
download_pkg_from_cp2k_org "${libxc_sha256}" "libxc-${libxc_ver}.tar.gz"
fi
echo "Installing from scratch into ${pkg_install_dir}"
[ -d libxc-${libxc_ver} ] && rm -rf libxc-${libxc_ver}

View file

@ -34,8 +34,7 @@ case "$with_cosma" in
if [ -f COSMA-v${cosma_ver}.tar.gz ]; then
echo "COSMA-v${cosma_ver}.tar.gz is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${cosma_sha256} \
"https://www.cp2k.org/static/downloads/COSMA-v${cosma_ver}.tar.gz"
download_pkg_from_cp2k_org "${cosma_sha256}" "COSMA-v${cosma_ver}.tar.gz"
fi
echo "Installing from scratch into ${pkg_install_dir}"
[ -d COSMA-${cosma_ver} ] && rm -rf COSMA-${cosma_ver}

View file

@ -40,8 +40,7 @@ EOF
if [ -f libxsmm-${libxsmm_ver}.tar.gz ]; then
echo "libxsmm-${libxsmm_ver}.tar.gz is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${libxsmm_sha256} \
https://www.cp2k.org/static/downloads/libxsmm-${libxsmm_ver}.tar.gz
download_pkg_from_cp2k_org "${libxsmm_sha256}" "libxsmm-${libxsmm_ver}.tar.gz"
fi
[ -d libxsmm-${libxsmm_ver} ] && rm -rf libxsmm-${libxsmm_ver}
tar -xzf libxsmm-${libxsmm_ver}.tar.gz

View file

@ -39,8 +39,7 @@ case "$with_scalapack" in
if [ -f ${scalapack_pkg} ]; then
echo "${scalapack_pkg} is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${scalapack_sha256} \
https://www.cp2k.org/static/downloads/${scalapack_pkg}
download_pkg_from_cp2k_org "${scalapack_sha256}" "${scalapack_pkg}"
fi
echo "Installing from scratch into ${pkg_install_dir}"
[ -d scalapack-${scalapack_ver} ] && rm -rf scalapack-${scalapack_ver}

View file

@ -62,8 +62,7 @@ case "$with_elpa" in
if [ -f elpa-${elpa_ver}.tar.gz ]; then
echo "elpa-${elpa_ver}.tar.gz is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${elpa_sha256} \
https://www.cp2k.org/static/downloads/elpa-${elpa_ver}.tar.gz
download_pkg_from_cp2k_org "${elpa_sha256}" "elpa-${elpa_ver}.tar.gz"
fi
[ -d elpa-${elpa_ver} ] && rm -rf elpa-${elpa_ver}
tar -xzf elpa-${elpa_ver}.tar.gz

View file

@ -38,8 +38,7 @@ case "$with_pexsi" in
if [ -f pexsi_v${pexsi_ver}.tar.gz ]; then
echo "pexsi_v${pexsi_ver}.tar.gz is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${pexsi_sha256} \
https://www.cp2k.org/static/downloads/pexsi_v${pexsi_ver}.tar.gz
download_pkg_from_cp2k_org "${pexsi_sha256}" "pexsi_v${pexsi_ver}.tar.gz"
fi
echo "Installing from scratch into ${pkg_install_dir}"
[ -d pexsi_v${pexsi_ver} ] && rm -rf pexsi_v${pexsi_ver}

View file

@ -33,8 +33,7 @@ case "${with_ptscotch}" in
if [ -f scotch_${scotch_ver}.tar.gz ]; then
echo "scotch_${scotch_ver}.tar.gz is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${scotch_sha256} \
https://www.cp2k.org/static/downloads/scotch_${scotch_ver}.tar.gz
download_pkg_from_cp2k_org "${scotch_sha256}" "scotch_${scotch_ver}.tar.gz"
fi
echo "Installing from scratch into ${pkg_install_dir}"
[ -d scotch_${scotch_ver} ] && rm -rf scotch_${scotch_ver}

View file

@ -35,8 +35,7 @@ case "$with_superlu" in
if [ -f superlu_dist_${superlu_ver}.tar.gz ]; then
echo "superlu_dist_${superlu_ver}.tar.gz is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${superlu_sha256} \
https://www.cp2k.org/static/downloads/superlu_dist_${superlu_ver}.tar.gz
download_pkg_from_cp2k_org "${superlu_sha256}" "superlu_dist_${superlu_ver}.tar.gz"
fi
echo "Installing from scratch into ${pkg_install_dir}"
[ -d superlu_dist-${superlu_ver} ] && rm -rf superlu_dist-${superlu_ver}

View file

@ -30,8 +30,7 @@ case "$with_gsl" in
if [ -f gsl-${gsl_ver}.tar.gz ]; then
echo "gsl-${gsl_ver}.tar.gz is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${gls_sha256} \
"https://www.cp2k.org/static/downloads/gsl-${gsl_ver}.tar.gz"
download_pkg_from_cp2k_org "${gls_sha256}" "gsl-${gsl_ver}.tar.gz"
fi
echo "Installing from scratch into ${pkg_install_dir}"
[ -d gsl-${gsl_ver} ] && rm -rf gsl-${gsl_ver}

View file

@ -35,8 +35,7 @@ case "$with_plumed" in
if [ -f ${plumed_pkg} ]; then
echo "${plumed_pkg} is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${plumed_sha256} \
"https://www.cp2k.org/static/downloads/${plumed_pkg}"
download_pkg_from_cp2k_org "${plumed_sha256}" "${plumed_pkg}"
fi
[ -d plumed-${plumed_ver} ] && rm -rf plumed-${plumed_ver}

View file

@ -48,8 +48,7 @@ case "${with_quip}" in
if [ -f QUIP-${quip_ver}.tar.gz ]; then
echo "QUIP-${quip_ver}.tar.gz is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${quip_sha256} \
https://www.cp2k.org/static/downloads/QUIP-${quip_ver}.tar.gz
download_pkg_from_cp2k_org "${quip_sha256}" "QUIP-${quip_ver}.tar.gz"
fi
[ -d QUIP-${quip_ver} ] && rm -rf QUIP-${quip_ver}
echo "Installing from scratch into ${pkg_install_dir}"

View file

@ -31,8 +31,7 @@ case "$with_hdf5" in
if [ -f hdf5-${hdf5_ver}.tar.bz2 ]; then
echo "hdf5-${hdf5_ver}.tar.bz2 is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${hdf5_sha256} \
https://www.cp2k.org/static/downloads/hdf5-${hdf5_ver}.tar.bz2
download_pkg_from_cp2k_org "${hdf5_sha256}" "hdf5-${hdf5_ver}.tar.bz2"
fi
echo "Installing from scratch into ${pkg_install_dir}"
[ -d hdf5-${hdf5_ver} ] && rm -rf hdf5-${hdf5_ver}

View file

@ -38,29 +38,14 @@ case "$with_libvdwxc" in
if [ -f libvdwxc-${libvdwxc_ver}.tar.gz ]; then
echo "libvdwxc-${libvdwxc_ver}.tar.gz is found"
else
# do not remove this. They do not publish official version often
download_pkg ${DOWNLOADER_FLAGS} ${libvdwxc_sha256} \
"https://www.cp2k.org/static/downloads/libvdwxc-${libvdwxc_ver}.tar.gz"
download_pkg_from_cp2k_org "${libvdwxc_sha256}" "libvdwxc-${libvdwxc_ver}.tar.gz"
fi
for patch in "${patches[@]}"; do
fname="${patch##*/}"
if [ -f "${fname}" ]; then
echo "${fname} is found"
else
# parallel build patch
download_pkg ${DOWNLOADER_FLAGS} "${patch}"
fi
done
echo "Installing from scratch into ${pkg_install_dir}"
[ -d libvdwxc-${libvdwxc_ver} ] && rm -rf libvdwxc-${libvdwxc_ver}
tar -xzf libvdwxc-${libvdwxc_ver}.tar.gz
cd libvdwxc-${libvdwxc_ver}
for patch in "${patches[@]}"; do
patch -p1 < ../"${patch##*/}"
done
if [ "${MPI_MODE}" = "no" ]; then
# compile libvdwxc without mpi support since fftw (or mkl) do not have mpi support activated
./configure \

View file

@ -33,9 +33,7 @@ case "${with_libvori:=__INSTALL__}" in
if [ -f libvori-${libvori_ver}.tar.gz ]; then
echo "libvori-${libvori_ver}.tar.gz is found"
else
# shellcheck disable=SC2086
download_pkg ${DOWNLOADER_FLAGS} ${libvori_sha256} \
"https://www.cp2k.org/static/downloads/libvori-${libvori_ver}.tar.gz"
download_pkg_from_cp2k_org "${libvori_sha256}" "libvori-${libvori_ver}.tar.gz"
fi
echo "Installing from scratch into ${pkg_install_dir}"

View file

@ -30,8 +30,7 @@ case "$with_spglib" in
if [ -f spglib-${spglib_ver}.tar.gz ]; then
echo "spglib-${spglib_ver}.tar.gz is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${spglib_sha256} \
"https://www.cp2k.org/static/downloads/v${spglib_ver}.tar.gz"
download_pkg_from_cp2k_org "${spglib_sha256}" "spglib-${spglib_ver}.tar.gz"
fi
echo "Installing from scratch into ${pkg_install_dir}"

View file

@ -95,8 +95,7 @@ case "$with_sirius" in
if [ -f SIRIUS-${sirius_ver}.tar.gz ]; then
echo "sirius_${sirius_ver}.tar.gz is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${sirius_sha256} \
"https://www.cp2k.org/static/downloads/SIRIUS-${sirius_ver}.tar.gz"
download_pkg_from_cp2k_org "${sirius_sha256}" "SIRIUS-${sirius_ver}.tar.gz"
fi
echo "Installing from scratch into ${pkg_install_dir}"

View file

@ -30,8 +30,7 @@ case "${with_spfft}" in
if [ -f SpFFT-${spfft_ver}.tar.gz ]; then
echo "SpFFT-${spfft_ver}.tar.gz is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${spfft_sha256} \
"https://www.cp2k.org/static/downloads/SpFFT-${spfft_ver}.tar.gz"
download_pkg_from_cp2k_org "${spfft_sha256}" "SpFFT-${spfft_ver}.tar.gz"
fi
if [ "${MATH_MODE}" = "mkl" ]; then

View file

@ -30,8 +30,7 @@ case "${with_spla}" in
if [ -f SpLA-${spla_ver}.tar.gz ]; then
echo "SpLA-${spla_ver}.tar.gz is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${spla_sha256} \
"https://www.cp2k.org/static/downloads/SpLA-${spla_ver}.tar.gz"
download_pkg_from_cp2k_org "${spla_sha256}" "SpLA-${spla_ver}.tar.gz"
fi
echo "Installing from scratch into ${pkg_install_dir}"

View file

@ -619,34 +619,13 @@ checksum() {
}
# downloader for the package tars, includes checksum
download_pkg() {
# usage: download_pkg [-n] [-o output_filename] sha256 url
local __wget_flags='--quiet'
local __filename=''
local __url=''
while [ $# -ge 2 ]; do
case "$1" in
-n)
__wget_flags="$__wget_flags --no-check-certificate"
;;
-o)
shift
__wget_flags="$__wget_flags -O $1"
__filename="$1"
;;
*)
__sha256="$1"
__url="$2"
shift
;;
esac
shift
done
if [ "$__filename" = "" ]; then
__filename="$(basename $__url)"
fi
download_pkg_from_cp2k_org() {
# usage: download_pkg_from_cp2k_org sha256 filename
local __sha256="$1"
local __filename="$2"
local __url="https://www.cp2k.org/static/downloads/$__filename"
# download
if ! wget $__wget_flags $__url; then
if ! wget --quiet $__url; then
report_error "failed to download $__url"
return 1
fi