From 7c2f6ef8bf22ed54efda4febb55cd73344fe603e Mon Sep 17 00:00:00 2001 From: JamesMisaka Date: Tue, 25 Mar 2025 12:12:06 +0800 Subject: [PATCH 1/7] implement pack-run function --- toolchain/install_abacus_toolchain.sh | 10 +++++++-- toolchain/scripts/stage0/install_amd.sh | 4 +++- toolchain/scripts/stage0/install_cmake.sh | 12 ++++++---- toolchain/scripts/stage0/install_gcc.sh | 4 ++++ toolchain/scripts/stage0/install_intel.sh | 3 +++ toolchain/scripts/stage1/install_intelmpi.sh | 4 +++- toolchain/scripts/stage1/install_mpich.sh | 8 +++++++ toolchain/scripts/stage1/install_openmpi.sh | 8 +++++++ toolchain/scripts/stage2/install_aocl.sh | 22 ++++++++++++------- toolchain/scripts/stage2/install_mkl.sh | 16 +++++++++----- toolchain/scripts/stage2/install_openblas.sh | 5 ++++- toolchain/scripts/stage3/install_elpa.sh | 4 ++++ toolchain/scripts/stage3/install_fftw.sh | 4 ++++ toolchain/scripts/stage3/install_libxc.sh | 4 ++++ toolchain/scripts/stage3/install_scalapack.sh | 4 ++++ toolchain/scripts/stage4/install_cereal.sh | 11 ++++------ toolchain/scripts/stage4/install_libcomm.sh | 11 ++++------ toolchain/scripts/stage4/install_libnpy.sh | 11 ++++------ toolchain/scripts/stage4/install_libri.sh | 11 ++++------ toolchain/scripts/stage4/install_libtorch.sh | 5 ++++- toolchain/scripts/stage4/install_rapidjson.sh | 11 ++++------ toolchain/scripts/tool_kit.sh | 8 +++++-- toolchain/toolchain_gnu.sh | 9 ++++---- 23 files changed, 125 insertions(+), 64 deletions(-) diff --git a/toolchain/install_abacus_toolchain.sh b/toolchain/install_abacus_toolchain.sh index b84ac0af1ab..6afba7607b5 100755 --- a/toolchain/install_abacus_toolchain.sh +++ b/toolchain/install_abacus_toolchain.sh @@ -115,13 +115,14 @@ OPTIONS: --target-cpu Compile for the specified target CPU (e.g. haswell or generic), i.e. do not optimize for the actual host system which is the default (native) --dry-run Write only config files, but don't actually build packages. +--pack-run Only check and install required packages without actually unpack and build packages The --enable-FEATURE options follow the rules: --enable-FEATURE=yes Enable this particular feature --enable-FEATURE=no Disable this particular feature --enable-FEATURE The option keyword alone is equivalent to --enable-FEATURE=yes - ===== NOTICE: THESE FEATURE AER NOT INCLUDED IN ABACUS ===== + ===== NOTICE: THESE GPU FEATURE IS ON TESTING ===== --enable-cuda Turn on GPU (CUDA) support (can be combined with --enable-opencl). Default = no @@ -329,6 +330,7 @@ export intel_classic="no" # but icx is recommended by intel compiler # option: --with-intel-classic can change it to yes/no # QuantumMisaka by 2023.08 +export pack_run="__FALSE__" export intelmpi_classic="no" export with_ifx="yes" # whether ifx is used in oneapi export with_flang="no" # whether flang is used in aocc @@ -461,6 +463,9 @@ while [ $# -ge 1 ]; do --dry-run) dry_run="__TRUE__" ;; + --pack-run) + pack_run="__TRUE__" + ;; --enable-tsan*) enable_tsan=$(read_enable $1) if [ "${enable_tsan}" = "__INVALID__" ]; then @@ -835,12 +840,12 @@ if [ "${dry_run}" = "__TRUE__" ]; then echo "Wrote only configuration files (--dry-run)." else echo "# Leak suppressions" > ${INSTALLDIR}/lsan.supp + echo "pack_run: ${pack_run}" ./scripts/stage0/install_stage0.sh ./scripts/stage1/install_stage1.sh ./scripts/stage2/install_stage2.sh ./scripts/stage3/install_stage3.sh ./scripts/stage4/install_stage4.sh -fi cat << EOF ========================== usage ========================= @@ -858,5 +863,6 @@ or you can modify the builder scripts to suit your needs. """ EOF +fi #EOF diff --git a/toolchain/scripts/stage0/install_amd.sh b/toolchain/scripts/stage0/install_amd.sh index c79aca5381a..260fd39e7fc 100755 --- a/toolchain/scripts/stage0/install_amd.sh +++ b/toolchain/scripts/stage0/install_amd.sh @@ -27,7 +27,9 @@ case "${with_amd}" in __INSTALL__) echo "==================== Installing the AMD compiler ======================" echo "__INSTALL__ is not supported; please install the AMD compiler manually" - exit 1 + if [ "${pack_run}" != "__TRUE__" ]; then + exit 1 + fi ;; __SYSTEM__) echo "==================== Finding AMD compiler from system paths ====================" diff --git a/toolchain/scripts/stage0/install_cmake.sh b/toolchain/scripts/stage0/install_cmake.sh index c0c16fc4a07..2e616b90713 100755 --- a/toolchain/scripts/stage0/install_cmake.sh +++ b/toolchain/scripts/stage0/install_cmake.sh @@ -45,10 +45,14 @@ case "${with_cmake}" in else download_pkg_from_ABACUS_org "${cmake_sha256}" "$cmake_pkg" fi - echo "Installing from scratch into ${pkg_install_dir}" - mkdir -p ${pkg_install_dir} - /bin/sh $cmake_pkg --prefix=${pkg_install_dir} --skip-license > install.log 2>&1 || tail -n ${LOG_LINES} install.log - write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage0/$(basename ${SCRIPT_NAME})" + if [ "${pack_run}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip installation" + else + echo "Installing from scratch into ${pkg_install_dir}" + mkdir -p ${pkg_install_dir} + /bin/sh $cmake_pkg --prefix=${pkg_install_dir} --skip-license > install.log 2>&1 || tail -n ${LOG_LINES} install.log + write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage0/$(basename ${SCRIPT_NAME})" + fi fi ;; __SYSTEM__) diff --git a/toolchain/scripts/stage0/install_gcc.sh b/toolchain/scripts/stage0/install_gcc.sh index dc8bb9e1d40..149025a6b40 100755 --- a/toolchain/scripts/stage0/install_gcc.sh +++ b/toolchain/scripts/stage0/install_gcc.sh @@ -42,6 +42,9 @@ case "${with_gcc}" in else download_pkg_from_ABACUS_org "${gcc_sha256}" "gcc-${gcc_ver}.tar.gz" fi + if [ "${pack_run}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip installation" + else [ -d gcc-${gcc_ver} ] && rm -rf gcc-${gcc_ver} tar -xzf gcc-${gcc_ver}.tar.gz @@ -115,6 +118,7 @@ case "${with_gcc}" in cd ../.. write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage0/$(basename ${SCRIPT_NAME})" fi + fi check_install ${pkg_install_dir}/bin/gcc "gcc" && CC="${pkg_install_dir}/bin/gcc" || exit 1 check_install ${pkg_install_dir}/bin/g++ "gcc" && CXX="${pkg_install_dir}/bin/g++" || exit 1 check_install ${pkg_install_dir}/bin/gfortran "gcc" && FC="${pkg_install_dir}/bin/gfortran" || exit 1 diff --git a/toolchain/scripts/stage0/install_intel.sh b/toolchain/scripts/stage0/install_intel.sh index 96b780c41db..c08fc162725 100755 --- a/toolchain/scripts/stage0/install_intel.sh +++ b/toolchain/scripts/stage0/install_intel.sh @@ -26,6 +26,9 @@ case "${with_intel}" in __INSTALL__) echo "==================== Installing the Intel compiler ====================" echo "__INSTALL__ is not supported; please install the Intel compiler manually" + if [ "${pack_run}" != "__TRUE__" ]; then + exit 1 + fi exit 1 ;; __SYSTEM__) diff --git a/toolchain/scripts/stage1/install_intelmpi.sh b/toolchain/scripts/stage1/install_intelmpi.sh index 0a5e7012c99..58165525ecc 100755 --- a/toolchain/scripts/stage1/install_intelmpi.sh +++ b/toolchain/scripts/stage1/install_intelmpi.sh @@ -27,7 +27,9 @@ case "${with_intelmpi}" in __INSTALL__) echo "==================== Installing Intel MPI ====================" echo '__INSTALL__ is not supported; please manually install Intel MPI' - exit 1 + if [ "${pack_run}" != "__TRUE__" ]; then + exit 1 + fi ;; __SYSTEM__) echo "==================== Finding Intel MPI from system paths ====================" diff --git a/toolchain/scripts/stage1/install_mpich.sh b/toolchain/scripts/stage1/install_mpich.sh index cd561519fbd..c89ae2bb8ca 100755 --- a/toolchain/scripts/stage1/install_mpich.sh +++ b/toolchain/scripts/stage1/install_mpich.sh @@ -47,6 +47,9 @@ case "${with_mpich}" in #download_pkg_from_ABACUS_org "${mpich_sha256}" "${mpich_pkg}" download_pkg_from_url "${mpich_sha256}" "${mpich_pkg}" "${url}" fi + if [ "${pack_run}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip installation" + else echo "Installing from scratch into ${pkg_install_dir} for MPICH device ${MPICH_DEVICE}" [ -d mpich-${mpich_ver} ] && rm -rf mpich-${mpich_ver} tar -xzf ${mpich_pkg} @@ -72,6 +75,10 @@ case "${with_mpich}" in cd .. write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage1/$(basename ${SCRIPT_NAME})" fi + fi + if [ "${pack_run}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip system check" + else check_dir "${pkg_install_dir}/bin" check_dir "${pkg_install_dir}/lib" check_dir "${pkg_install_dir}/include" @@ -83,6 +90,7 @@ case "${with_mpich}" in MPIF77="${MPIFC}" MPICH_CFLAGS="-I'${pkg_install_dir}/include'" MPICH_LDFLAGS="-L'${pkg_install_dir}/lib' -Wl,-rpath,'${pkg_install_dir}/lib'" + fi ;; __SYSTEM__) echo "==================== Finding MPICH from system paths ====================" diff --git a/toolchain/scripts/stage1/install_openmpi.sh b/toolchain/scripts/stage1/install_openmpi.sh index ab65a89553f..fdaace3d40d 100755 --- a/toolchain/scripts/stage1/install_openmpi.sh +++ b/toolchain/scripts/stage1/install_openmpi.sh @@ -49,6 +49,9 @@ case "${with_openmpi}" in else download_pkg_from_url "${openmpi_sha256}" "${openmpi_pkg}" "${url}" fi + if [ "${pack_run}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip installation" + else echo "Installing from scratch into ${pkg_install_dir}" [ -d openmpi-${openmpi_ver} ] && rm -rf openmpi-${openmpi_ver} tar -xjf ${openmpi_pkg} @@ -87,6 +90,10 @@ case "${with_openmpi}" in cd .. write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage1/$(basename ${SCRIPT_NAME})" fi + fi + if [ "${pack_run}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip system check" + else check_dir "${pkg_install_dir}/bin" check_dir "${pkg_install_dir}/lib" check_dir "${pkg_install_dir}/include" @@ -98,6 +105,7 @@ case "${with_openmpi}" in MPIF77="${MPIFC}" OPENMPI_CFLAGS="-I'${pkg_install_dir}/include'" OPENMPI_LDFLAGS="-L'${pkg_install_dir}/lib' -Wl,-rpath,'${pkg_install_dir}/lib'" + fi ;; __SYSTEM__) echo "==================== Finding OpenMPI from system paths ====================" diff --git a/toolchain/scripts/stage2/install_aocl.sh b/toolchain/scripts/stage2/install_aocl.sh index 51bcc8c4ddb..e3b861bcdb1 100755 --- a/toolchain/scripts/stage2/install_aocl.sh +++ b/toolchain/scripts/stage2/install_aocl.sh @@ -27,17 +27,23 @@ case "${with_aocl}" in __INSTALL__) echo "==================== Installing AOCL ====================" report_error ${LINENO} "To install AOCL, please contact your system administrator." - exit 1 + if [ "${pack_run}" != "__TRUE__" ]; then + exit 1 + fi ;; __SYSTEM__) echo "==================== Finding AOCL from system paths ====================" - check_lib -lblis "AOCL" - check_lib -lflame "AOCL" - AOCL_LIBS="-lblis -lflame" - add_include_from_paths AOCL_CFLAGS "blis.h" $INCLUDE_PATHS - add_lib_from_paths AOCL_LDFLAGS "libblis.*" $LIB_PATHS - add_include_from_paths AOCL_CFLAGS "lapack.h" $INCLUDE_PATHS - add_lib_from_paths AOCL_LDFLAGS "libflame.*" $LIB_PATHS + if [ "${pack_run}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip system check" + else + check_lib -lblis "AOCL" + check_lib -lflame "AOCL" + AOCL_LIBS="-lblis -lflame" + add_include_from_paths AOCL_CFLAGS "blis.h" $INCLUDE_PATHS + add_lib_from_paths AOCL_LDFLAGS "libblis.*" $LIB_PATHS + add_include_from_paths AOCL_CFLAGS "lapack.h" $INCLUDE_PATHS + add_lib_from_paths AOCL_LDFLAGS "libflame.*" $LIB_PATHS + fi ;; __DONTUSE__) ;; diff --git a/toolchain/scripts/stage2/install_mkl.sh b/toolchain/scripts/stage2/install_mkl.sh index f1c3eedb09d..054a7324736 100755 --- a/toolchain/scripts/stage2/install_mkl.sh +++ b/toolchain/scripts/stage2/install_mkl.sh @@ -28,15 +28,21 @@ case "${with_mkl}" in __INSTALL__) echo "==================== Installing MKL ====================" report_error ${LINENO} "To install MKL, please contact your system administrator." - exit 1 + if [ "${pack_run}" != "__TRUE__" ]; then + exit 1 + fi ;; __SYSTEM__) echo "==================== Finding MKL from system paths ====================" - if ! [ -z "${MKLROOT}" ]; then - echo "MKLROOT is found to be ${MKLROOT}" + if [ "${pack_run}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip system check" else - report_error ${LINENO} "Cannot find env variable MKLROOT, the script relies on it being set. Please check in MKL installation and use --with-mkl= to pass the path to MKL root directory to this script." - exit 1 + if ! [ -z "${MKLROOT}" ]; then + echo "MKLROOT is found to be ${MKLROOT}" + else + report_error ${LINENO} "Cannot find env variable MKLROOT, the script relies on it being set. Please check in MKL installation and use --with-mkl= to pass the path to MKL root directory to this script." + exit 1 + fi fi check_lib -lm check_lib -ldl diff --git a/toolchain/scripts/stage2/install_openblas.sh b/toolchain/scripts/stage2/install_openblas.sh index 6c411edaad1..c36d44f6016 100755 --- a/toolchain/scripts/stage2/install_openblas.sh +++ b/toolchain/scripts/stage2/install_openblas.sh @@ -41,7 +41,9 @@ case "${with_openblas}" in else download_pkg_from_ABACUS_org "${openblas_sha256}" "${openblas_pkg}" fi - + if [ "${pack_run}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip installation" + else echo "Installing from scratch into ${pkg_install_dir}" [ -d OpenBLAS-${openblas_ver} ] && rm -rf OpenBLAS-${openblas_ver} tar -zxf ${openblas_pkg} @@ -113,6 +115,7 @@ case "${with_openblas}" in cd .. write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage2/$(basename ${SCRIPT_NAME})" fi + fi OPENBLAS_CFLAGS="-I'${pkg_install_dir}/include'" OPENBLAS_LDFLAGS="-L'${pkg_install_dir}/lib' -Wl,-rpath,'${pkg_install_dir}/lib'" OPENBLAS_ROOT="${pkg_install_dir}" diff --git a/toolchain/scripts/stage3/install_elpa.sh b/toolchain/scripts/stage3/install_elpa.sh index 94cc3d1bb90..d9bd070fd44 100755 --- a/toolchain/scripts/stage3/install_elpa.sh +++ b/toolchain/scripts/stage3/install_elpa.sh @@ -68,6 +68,9 @@ case "$with_elpa" in else download_pkg_from_url "${elpa_sha256}" "${elpa_pkg}" "${url}" fi + if [ "${pack_run}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip installation" + else [ -d elpa-${elpa_ver} ] && rm -rf elpa-${elpa_ver} tar -xzf ${elpa_pkg} @@ -171,6 +174,7 @@ case "$with_elpa" in write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage3/$(basename ${SCRIPT_NAME})" fi + fi [ "$enable_openmp" != "yes" ] && elpa_dir_openmp="" ELPA_CFLAGS="-I'${pkg_install_dir}/IF_CUDA(nvidia|cpu)/include/elpa${elpa_dir_openmp}-${elpa_ver}/modules' -I'${pkg_install_dir}/IF_CUDA(nvidia|cpu)/include/elpa${elpa_dir_openmp}-${elpa_ver}/elpa'" ELPA_LDFLAGS="-L'${pkg_install_dir}/IF_CUDA(nvidia|cpu)/lib' -Wl,-rpath,'${pkg_install_dir}/IF_CUDA(nvidia|cpu)/lib'" diff --git a/toolchain/scripts/stage3/install_fftw.sh b/toolchain/scripts/stage3/install_fftw.sh index 291f54199c6..8bea8ed3c13 100755 --- a/toolchain/scripts/stage3/install_fftw.sh +++ b/toolchain/scripts/stage3/install_fftw.sh @@ -42,6 +42,9 @@ case "$with_fftw" in else download_pkg_from_ABACUS_org "${fftw_sha256}" "${fftw_pkg}" fi + if [ "${pack_run}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip installation" + else echo "Installing from scratch into ${pkg_install_dir}" [ -d fftw-${fftw_ver} ] && rm -rf fftw-${fftw_ver} tar -xzf ${fftw_pkg} @@ -75,6 +78,7 @@ case "$with_fftw" in cd .. write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage3/$(basename ${SCRIPT_NAME})" fi + fi FFTW_CFLAGS="-I'${pkg_install_dir}/include'" FFTW_LDFLAGS="-L'${pkg_install_dir}/lib' -Wl,-rpath,'${pkg_install_dir}/lib'" ;; diff --git a/toolchain/scripts/stage3/install_libxc.sh b/toolchain/scripts/stage3/install_libxc.sh index 04c96b7aad5..25cf4218026 100755 --- a/toolchain/scripts/stage3/install_libxc.sh +++ b/toolchain/scripts/stage3/install_libxc.sh @@ -43,6 +43,9 @@ case "$with_libxc" in libxc_url="https://gitlab.com/libxc/libxc/-/archive/${libxc_ver}/${libxc_pkg}" download_pkg_from_url "${libxc_sha256}" "${libxc_pkg}" "${libxc_url}" fi + if [ "${pack_run}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip installation" + else echo "Installing from scratch into ${pkg_install_dir}" [ -d libxc-${libxc_ver} ] && rm -rf libxc-${libxc_ver} tar -xjf ${libxc_pkg} @@ -65,6 +68,7 @@ case "$with_libxc" in cd ../.. write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage3/$(basename ${SCRIPT_NAME})" fi + fi LIBXC_CFLAGS="-I'${pkg_install_dir}/include'" LIBXC_LDFLAGS="-L'${pkg_install_dir}/lib' -Wl,-rpath,'${pkg_install_dir}/lib'" ;; diff --git a/toolchain/scripts/stage3/install_scalapack.sh b/toolchain/scripts/stage3/install_scalapack.sh index 93b231870a7..3b5d3612f73 100755 --- a/toolchain/scripts/stage3/install_scalapack.sh +++ b/toolchain/scripts/stage3/install_scalapack.sh @@ -41,6 +41,9 @@ case "$with_scalapack" in else download_pkg_from_ABACUS_org "${scalapack_sha256}" "${scalapack_pkg}" fi + if [ "${pack_run}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip installation" + else echo "Installing from scratch into ${pkg_install_dir}" [ -d scalapack-${scalapack_ver} ] && rm -rf scalapack-${scalapack_ver} tar -xzf ${scalapack_pkg} @@ -68,6 +71,7 @@ case "$with_scalapack" in popd > /dev/null write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage3/$(basename ${SCRIPT_NAME})" fi + fi SCALAPACK_LDFLAGS="-L'${pkg_install_dir}/lib' -Wl,-rpath,'${pkg_install_dir}/lib'" ;; __SYSTEM__) diff --git a/toolchain/scripts/stage4/install_cereal.sh b/toolchain/scripts/stage4/install_cereal.sh index 6874e02479a..15b94b2ecd5 100755 --- a/toolchain/scripts/stage4/install_cereal.sh +++ b/toolchain/scripts/stage4/install_cereal.sh @@ -42,20 +42,17 @@ case "$with_cereal" in # download from github.com and checksum echo "===> Notice: This version of CEREAL is downloaded in GitHub Release, which will always be out-of-date version <===" download_pkg_from_url "${cereal_sha256}" "${filename}" "${url}" - # echo "wget $url -O $filename" - # if ! wget $url -O $filename; then - # report_error "failed to download $url" - # recommend_offline_installation $filename $url - # fi - # # checksum - # checksum "$filename" "$cereal_sha256" fi + if [ "${pack_run}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip installation" + else echo "Installing from scratch into ${pkg_install_dir}" [ -d $dirname ] && rm -rf $dirname tar -xzf $filename mkdir -p "${pkg_install_dir}" cp -r $dirname/* "${pkg_install_dir}/" write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage4/$(basename ${SCRIPT_NAME})" + fi fi ;; __SYSTEM__) diff --git a/toolchain/scripts/stage4/install_libcomm.sh b/toolchain/scripts/stage4/install_libcomm.sh index 92df9c40d40..6fd351ce856 100755 --- a/toolchain/scripts/stage4/install_libcomm.sh +++ b/toolchain/scripts/stage4/install_libcomm.sh @@ -43,19 +43,16 @@ case "$with_libcomm" in # download from github.com and checksum echo "===> Notice: This version of LibComm is downloaded in GitHub Release, which will always be out-of-date version <===" download_pkg_from_url "${libcomm_sha256}" "${filename}" "${url}" - # echo "wget --quiet $url -O $filename" - # if ! wget --quiet $url -O $filename; then - # report_error "failed to download $url" - # recommend_offline_installation $filename $url - # fi - # # checksum - # checksum "$filename" "$libcomm_sha256" fi + if [ "${pack_run}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip installation" + else echo "Installing from scratch into ${pkg_install_dir}" [ -d $dirname ] && rm -rf $dirname tar -xzf $filename cp -r $dirname "${pkg_install_dir}/" write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage4/$(basename ${SCRIPT_NAME})" + fi fi ;; __SYSTEM__) diff --git a/toolchain/scripts/stage4/install_libnpy.sh b/toolchain/scripts/stage4/install_libnpy.sh index c7042e0a5d5..aef24c5ee49 100755 --- a/toolchain/scripts/stage4/install_libnpy.sh +++ b/toolchain/scripts/stage4/install_libnpy.sh @@ -43,20 +43,17 @@ case "$with_libnpy" in # download from github.com and checksum echo "===> Notice: This version of Libnpy is downloaded in GitHub Release, which will always be out-of-date version <===" download_pkg_from_url "${libnpy_sha256}" "${filename}" "${url}" - # echo "wget $url -O $filename" - # if ! wget $url -O $filename; then - # report_error "failed to download $url" - # recommend_offline_installation $filename $url - # fi - # # checksum - # checksum "$filename" "$libnpy_sha256" fi + if [ "${pack_run}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip installation" + else echo "Installing from scratch into ${pkg_install_dir}" [ -d $dirname ] && rm -rf $dirname tar -xzf $filename mkdir -p "${pkg_install_dir}" cp -r $dirname/* "${pkg_install_dir}/" write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage4/$(basename ${SCRIPT_NAME})" + fi fi ;; __SYSTEM__) diff --git a/toolchain/scripts/stage4/install_libri.sh b/toolchain/scripts/stage4/install_libri.sh index d6953655a70..4156cf0bcdd 100755 --- a/toolchain/scripts/stage4/install_libri.sh +++ b/toolchain/scripts/stage4/install_libri.sh @@ -43,19 +43,16 @@ case "$with_libri" in # download from github.com and checksum echo "===> Notice: This version of LibRI is downloaded in GitHub Release, which will always be out-of-date version <===" download_pkg_from_url "${libri_sha256}" "${filename}" "${url}" - # echo "wget --quiet $url -O $filename" - # if ! wget --quiet $url -O $filename; then - # report_error "failed to download $url" - # recommend_offline_installation $filename $url - # fi - # # checksum - # checksum "$filename" "$libri_sha256" fi + if [ "${pack_run}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip installation" + else echo "Installing from scratch into ${pkg_install_dir}" [ -d $dirname ] && rm -rf $dirname tar -xzf $filename cp -r $dirname "${pkg_install_dir}/" write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage4/$(basename ${SCRIPT_NAME})" + fi fi ;; __SYSTEM__) diff --git a/toolchain/scripts/stage4/install_libtorch.sh b/toolchain/scripts/stage4/install_libtorch.sh index 877d9d1fdf4..896cacb9f7a 100755 --- a/toolchain/scripts/stage4/install_libtorch.sh +++ b/toolchain/scripts/stage4/install_libtorch.sh @@ -53,6 +53,9 @@ case "${with_libtorch}" in url=https://download.pytorch.org/libtorch/cpu/${archive_file} download_pkg_from_url "${libtorch_sha256}" "${filename}" "${url}" fi + if [ "${pack_run}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip installation" + else echo "Installing from scratch into ${pkg_install_dir}" [ -d libtorch ] && rm -rf libtorch [ -d ${pkg_install_dir} ] && rm -rf ${pkg_install_dir} @@ -62,7 +65,7 @@ case "${with_libtorch}" in write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage4/$(basename ${SCRIPT_NAME})" fi - + fi LIBTORCH_CXXFLAGS="-I${pkg_install_dir}/include" LIBTORCH_LDFLAGS="-L'${pkg_install_dir}/lib' -Wl,-rpath='${pkg_install_dir}/lib'" ;; diff --git a/toolchain/scripts/stage4/install_rapidjson.sh b/toolchain/scripts/stage4/install_rapidjson.sh index bce4d84d6fd..eab76eee0aa 100755 --- a/toolchain/scripts/stage4/install_rapidjson.sh +++ b/toolchain/scripts/stage4/install_rapidjson.sh @@ -42,14 +42,10 @@ case "$with_rapidjson" in # download from github.com and checksum echo "===> Notice: This version of rapidjson is downloaded in GitHub Release, which will always be out-of-date version <===" download_pkg_from_url "${rapidjson_sha256}" "${filename}" "${url}" - # echo "wget $url -O $filename" - # if ! wget $url -O $filename; then - # report_error "failed to download $url" - # recommend_offline_installation $filename $url - # fi - # # checksum - # checksum "$filename" "$rapidjson_sha256" fi + if [ "${pack_run}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip installation" + else echo "Installing from scratch into ${pkg_install_dir}" [ -d $dirname ] && rm -rf $dirname tar -xzf $filename @@ -58,6 +54,7 @@ case "$with_rapidjson" in # for CMake to find rapidjson cp ${pkg_install_dir}/RapidJSONConfig.cmake.in ${pkg_install_dir}/RapidJSONConfig.cmake write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage4/$(basename ${SCRIPT_NAME})" + fi fi ;; __SYSTEM__) diff --git a/toolchain/scripts/tool_kit.sh b/toolchain/scripts/tool_kit.sh index e03c125c3b1..7f03c3d787f 100755 --- a/toolchain/scripts/tool_kit.sh +++ b/toolchain/scripts/tool_kit.sh @@ -655,7 +655,9 @@ download_pkg_from_ABACUS_org() { if ! wget ${DOWNLOADER_FLAGS} $__url; then report_error "failed to download $__url" recommend_offline_installation $__filename $__url - return 1 + if [ "${pack_run}" != "__TRUE__" ]; then + return 1 + fi fi # checksum checksum "$__filename" "$__sha256" @@ -673,7 +675,9 @@ download_pkg_from_url() { if ! wget ${DOWNLOADER_FLAGS} $__url -O $__filename; then report_error "failed to download $__url" recommend_offline_installation $__filename $__url - return 1 + if [ "${pack_run}" != "__TRUE__" ]; then + return 1 + fi fi # checksum checksum "$__filename" "$__sha256" diff --git a/toolchain/toolchain_gnu.sh b/toolchain/toolchain_gnu.sh index bea1ee0793f..ff319471b6b 100755 --- a/toolchain/toolchain_gnu.sh +++ b/toolchain/toolchain_gnu.sh @@ -27,11 +27,12 @@ --with-elpa=install \ --with-cereal=install \ --with-rapidjson=install \ ---with-libtorch=no \ ---with-libnpy=no \ ---with-libri=no \ ---with-libcomm=no \ +--with-libtorch=install \ +--with-libnpy=install \ +--with-libri=install \ +--with-libcomm=install \ --with-4th-openmpi=no \ +--pack-run \ | tee compile.log # to use openmpi-version4: set --with-4th-openmpi=yes # to enable gpu-lcao, add the following lines: From fe19be17986d7f06e1e2b3f01e57866b96dd5355 Mon Sep 17 00:00:00 2001 From: JamesMisaka Date: Tue, 25 Mar 2025 12:16:44 +0800 Subject: [PATCH 2/7] add dry-run and pack-run readme --- toolchain/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/toolchain/README.md b/toolchain/README.md index d190ff10644..a08ab7a5596 100644 --- a/toolchain/README.md +++ b/toolchain/README.md @@ -148,7 +148,11 @@ by running these scripts after loading `gcc` or `intel-mkl-mpi` environment. The toolchain installation process can be interrupted at anytime. -just re-run *toolchain_\*.sh*, toolchain itself may fix it +just re-run *toolchain_\*.sh*, toolchain itself may fix it. If you encouter some problem, you can always remove some package in the interrupted points and re-run the toolchain. + +Some useful options: +- `--dry-run`: just run the main install scripts for environment setting, without any package downloading or installation. +- `--pack-run`: just run the install scripts without any package building, which helps user to download and check the packages, paticularly for offline installation to a server. If compliation is successful, a message will be shown like this: From 40b34f2fee8dbe0d18dc337d8b9900328c9950e5 Mon Sep 17 00:00:00 2001 From: JamesMisaka Date: Tue, 25 Mar 2025 12:17:22 +0800 Subject: [PATCH 3/7] give back testing option --- toolchain/toolchain_gnu.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/toolchain/toolchain_gnu.sh b/toolchain/toolchain_gnu.sh index ff319471b6b..bea1ee0793f 100755 --- a/toolchain/toolchain_gnu.sh +++ b/toolchain/toolchain_gnu.sh @@ -27,12 +27,11 @@ --with-elpa=install \ --with-cereal=install \ --with-rapidjson=install \ ---with-libtorch=install \ ---with-libnpy=install \ ---with-libri=install \ ---with-libcomm=install \ +--with-libtorch=no \ +--with-libnpy=no \ +--with-libri=no \ +--with-libcomm=no \ --with-4th-openmpi=no \ ---pack-run \ | tee compile.log # to use openmpi-version4: set --with-4th-openmpi=yes # to enable gpu-lcao, add the following lines: From 1f0136fa320589ce7c779ae6f7bf92c3df0e8e6a Mon Sep 17 00:00:00 2001 From: JamesMisaka Date: Tue, 25 Mar 2025 12:21:31 +0800 Subject: [PATCH 4/7] make added global var uppercase --- toolchain/install_abacus_toolchain.sh | 21 +++++++++---------- toolchain/scripts/stage0/install_amd.sh | 8 +++---- toolchain/scripts/stage0/install_cmake.sh | 2 +- toolchain/scripts/stage0/install_gcc.sh | 2 +- toolchain/scripts/stage0/install_intel.sh | 6 +++--- toolchain/scripts/stage1/install_intelmpi.sh | 14 ++++++------- toolchain/scripts/stage1/install_mpich.sh | 4 ++-- toolchain/scripts/stage1/install_openmpi.sh | 6 +++--- toolchain/scripts/stage2/install_aocl.sh | 4 ++-- toolchain/scripts/stage2/install_mkl.sh | 4 ++-- toolchain/scripts/stage2/install_openblas.sh | 2 +- toolchain/scripts/stage3/install_elpa.sh | 4 ++-- toolchain/scripts/stage3/install_fftw.sh | 2 +- toolchain/scripts/stage3/install_libxc.sh | 2 +- toolchain/scripts/stage3/install_scalapack.sh | 2 +- toolchain/scripts/stage4/install_cereal.sh | 2 +- toolchain/scripts/stage4/install_libcomm.sh | 2 +- toolchain/scripts/stage4/install_libnpy.sh | 2 +- toolchain/scripts/stage4/install_libri.sh | 2 +- toolchain/scripts/stage4/install_libtorch.sh | 2 +- toolchain/scripts/stage4/install_rapidjson.sh | 2 +- toolchain/scripts/tool_kit.sh | 4 ++-- 22 files changed, 49 insertions(+), 50 deletions(-) diff --git a/toolchain/install_abacus_toolchain.sh b/toolchain/install_abacus_toolchain.sh index 6afba7607b5..dce50684ec9 100755 --- a/toolchain/install_abacus_toolchain.sh +++ b/toolchain/install_abacus_toolchain.sh @@ -330,11 +330,11 @@ export intel_classic="no" # but icx is recommended by intel compiler # option: --with-intel-classic can change it to yes/no # QuantumMisaka by 2023.08 -export pack_run="__FALSE__" -export intelmpi_classic="no" -export with_ifx="yes" # whether ifx is used in oneapi -export with_flang="no" # whether flang is used in aocc -export openmpi_4th="no" # whether openmpi downgrade +export PACK_RUN="__FALSE__" +export INTELMPI_CLASSIC="no" +export WITH_IFX="yes" # whether ifx is used in oneapi +export WITH_FLANG="no" # whether flang is used in aocc +export OPENMPI_4TH="no" # whether openmpi downgrade export GPUVER="no" export MPICH_DEVICE="ch4" export TARGET_CPU="native" @@ -464,7 +464,7 @@ while [ $# -ge 1 ]; do dry_run="__TRUE__" ;; --pack-run) - pack_run="__TRUE__" + PACK_RUN="__TRUE__" ;; --enable-tsan*) enable_tsan=$(read_enable $1) @@ -519,7 +519,7 @@ while [ $# -ge 1 ]; do fi ;; --with-4th-openmpi*) - openmpi_4th=$(read_with "${1}" "no") # default new openmpi + OPENMPI_4TH=$(read_with "${1}" "no") # default new openmpi ;; --with-openmpi*) with_openmpi=$(read_with "${1}") @@ -537,19 +537,19 @@ while [ $# -ge 1 ]; do intel_classic=$(read_with "${1}" "no") # default new intel compiler ;; --with-intel-mpi-clas*) - intelmpi_classic=$(read_with "${1}" "no") # default new intel mpi compiler + INTELMPI_CLASSIC=$(read_with "${1}" "no") # default new intel mpi compiler ;; --with-intel*) # must be read after items above with_intel=$(read_with "${1}" "__SYSTEM__") ;; --with-ifx*) - with_ifx=$(read_with "${1}" "yes") # default yes + WITH_IFX=$(read_with "${1}" "yes") # default yes ;; --with-amd*) with_amd=$(read_with "${1}" "__SYSTEM__") ;; --with-flang*) - with_flang=$(read_with "${1}" "no") + WITH_FLANG=$(read_with "${1}" "no") ;; --with-aocl*) with_aocl=$(read_with "${1}" "__SYSTEM__") @@ -840,7 +840,6 @@ if [ "${dry_run}" = "__TRUE__" ]; then echo "Wrote only configuration files (--dry-run)." else echo "# Leak suppressions" > ${INSTALLDIR}/lsan.supp - echo "pack_run: ${pack_run}" ./scripts/stage0/install_stage0.sh ./scripts/stage1/install_stage1.sh ./scripts/stage2/install_stage2.sh diff --git a/toolchain/scripts/stage0/install_amd.sh b/toolchain/scripts/stage0/install_amd.sh index 260fd39e7fc..5f3b1f5abff 100755 --- a/toolchain/scripts/stage0/install_amd.sh +++ b/toolchain/scripts/stage0/install_amd.sh @@ -27,7 +27,7 @@ case "${with_amd}" in __INSTALL__) echo "==================== Installing the AMD compiler ======================" echo "__INSTALL__ is not supported; please install the AMD compiler manually" - if [ "${pack_run}" != "__TRUE__" ]; then + if [ "${PACK_RUN}" != "__TRUE__" ]; then exit 1 fi ;; @@ -35,7 +35,7 @@ case "${with_amd}" in echo "==================== Finding AMD compiler from system paths ====================" check_command clang "amd" && CC="$(realpath $(command -v clang))" || exit 1 check_command clang++ "amd" && CXX="$(realpath $(command -v clang++))" || exit 1 - if [ "${with_flang}" = "yes" ]; then + if [ "${WITH_FLANG}" = "yes" ]; then check_command flang "amd" && FC="$(realpath $(command -v flang))" || exit 1 else check_command gfortran "gcc" && FC="gfortran" || exit 1 @@ -55,7 +55,7 @@ case "${with_amd}" in check_dir "${pkg_install_dir}/include" check_command ${pkg_install_dir}/bin/clang "amd" && CC="${pkg_install_dir}/bin/clang" || exit 1 check_command ${pkg_install_dir}/bin/clang++ "amd" && CXX="${pkg_install_dir}/bin/clang++" || exit 1 - if [ "${with_flang}" = "yes" ]; then + if [ "${WITH_FLANG}" = "yes" ]; then check_command ${pkg_install_dir}/bin/flang "amd" && FC="${pkg_install_dir}/bin/flang" || exit 1 else check_command gfortran "gcc" && FC="$(command -v gfortran)" || exit 1 @@ -72,7 +72,7 @@ if [ "${with_amd}" != "__DONTUSE__" ]; then echo "CXX is ${CXX}" [ $(realpath $(command -v clang++) | grep -e aocc-compiler) ] || echo "Check the AMD C++ compiler path" echo "FC is ${FC}" - if [ "${with_flang}" = "yes" ]; then + if [ "${WITH_FLANG}" = "yes" ]; then [ $(realpath $(command -v flang) | grep -e aocc-compiler) ] || echo "Check the AMD Fortran compiler path" else [ $(realpath $(command -v gfortran) | grep -e aocc-compiler) ] || echo "Check the GNU Fortran compiler path" diff --git a/toolchain/scripts/stage0/install_cmake.sh b/toolchain/scripts/stage0/install_cmake.sh index 2e616b90713..02cd6370248 100755 --- a/toolchain/scripts/stage0/install_cmake.sh +++ b/toolchain/scripts/stage0/install_cmake.sh @@ -45,7 +45,7 @@ case "${with_cmake}" in else download_pkg_from_ABACUS_org "${cmake_sha256}" "$cmake_pkg" fi - if [ "${pack_run}" = "__TRUE__" ]; then + if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip installation" else echo "Installing from scratch into ${pkg_install_dir}" diff --git a/toolchain/scripts/stage0/install_gcc.sh b/toolchain/scripts/stage0/install_gcc.sh index 149025a6b40..ef00b994b98 100755 --- a/toolchain/scripts/stage0/install_gcc.sh +++ b/toolchain/scripts/stage0/install_gcc.sh @@ -42,7 +42,7 @@ case "${with_gcc}" in else download_pkg_from_ABACUS_org "${gcc_sha256}" "gcc-${gcc_ver}.tar.gz" fi - if [ "${pack_run}" = "__TRUE__" ]; then + if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip installation" else [ -d gcc-${gcc_ver} ] && rm -rf gcc-${gcc_ver} diff --git a/toolchain/scripts/stage0/install_intel.sh b/toolchain/scripts/stage0/install_intel.sh index c08fc162725..98fda1131d8 100755 --- a/toolchain/scripts/stage0/install_intel.sh +++ b/toolchain/scripts/stage0/install_intel.sh @@ -26,7 +26,7 @@ case "${with_intel}" in __INSTALL__) echo "==================== Installing the Intel compiler ====================" echo "__INSTALL__ is not supported; please install the Intel compiler manually" - if [ "${pack_run}" != "__TRUE__" ]; then + if [ "${PACK_RUN}" != "__TRUE__" ]; then exit 1 fi exit 1 @@ -40,7 +40,7 @@ case "${with_intel}" in else check_command icx "intel" && CC="$(realpath $(command -v icx))" || exit 1 check_command icpx "intel" && CXX="$(realpath $(command -v icpx))" || exit 1 - if [ "${with_ifx}" = "yes" ]; then + if [ "${WITH_IFX}" = "yes" ]; then check_command ifx "intel" && FC="$(realpath $(command -v ifx))" || exit 1 else check_command ifort "intel" && FC="$(realpath $(command -v ifort))" || exit 1 @@ -65,7 +65,7 @@ case "${with_intel}" in else check_command ${pkg_install_dir}/bin/icx "intel" && CC="${pkg_install_dir}/bin/icx" || exit 1 check_command ${pkg_install_dir}/bin/icpx "intel" && CXX="${pkg_install_dir}/bin/icpx" || exit 1 - if [ "${with_ifx}" = "yes" ]; then + if [ "${WITH_IFX}" = "yes" ]; then check_command ${pkg_install_dir}/bin/ifx "intel" && FC="${pkg_install_dir}/bin/ifx" || exit 1 else check_command ${pkg_install_dir}/bin/ifort "intel" && FC="${pkg_install_dir}/bin/ifort" || exit 1 diff --git a/toolchain/scripts/stage1/install_intelmpi.sh b/toolchain/scripts/stage1/install_intelmpi.sh index 58165525ecc..61112d8f155 100755 --- a/toolchain/scripts/stage1/install_intelmpi.sh +++ b/toolchain/scripts/stage1/install_intelmpi.sh @@ -27,7 +27,7 @@ case "${with_intelmpi}" in __INSTALL__) echo "==================== Installing Intel MPI ====================" echo '__INSTALL__ is not supported; please manually install Intel MPI' - if [ "${pack_run}" != "__TRUE__" ]; then + if [ "${PACK_RUN}" != "__TRUE__" ]; then exit 1 fi ;; @@ -36,17 +36,17 @@ case "${with_intelmpi}" in check_command mpiexec "intelmpi" && MPIRUN="$(realpath $(command -v mpiexec))" if [ "${intel_classic}" = "yes" ]; then # if intel compiler used as classic, so as intelmpi - export intelmpi_classic="yes" + export INTELMPI_CLASSIC="yes" fi if [ "${with_intel}" != "__DONTUSE__" ]; then - if [ "${intelmpi_classic}" = "yes" ]; then + if [ "${INTELMPI_CLASSIC}" = "yes" ]; then check_command mpiicc "intelmpi" && MPICC="$(realpath $(command -v mpiicc))" || exit 1 check_command mpiicpc "intelmpi" && MPICXX="$(realpath $(command -v mpiicpc))" || exit 1 check_command mpiifort "intelmpi" && MPIFC="$(realpath $(command -v mpiifort))" || exit 1 else check_command mpiicx "intelmpi" && MPICC="$(realpath $(command -v mpiicx))" || exit 1 check_command mpiicpx "intelmpi" && MPICXX="$(realpath $(command -v mpiicpx))" || exit 1 - if [ "${with_ifx}" == "yes" ]; then + if [ "${WITH_IFX}" == "yes" ]; then check_command mpiifx "intelmpi" && MPIFC="$(realpath $(command -v mpiifx))" || exit 1 else check_command mpiifort "intelmpi" && MPIFC="$(realpath $(command -v mpiifort))" || exit 1 @@ -75,14 +75,14 @@ case "${with_intelmpi}" in check_dir "${pkg_install_dir}/include" check_command ${pkg_install_dir}/bin/mpiexec "intel" && MPIRUN="${pkg_install_dir}/bin/mpiexec" || exit 1 if [ "${with_intel}" != "__DONTUSE__" ]; then - if [ "${intelmpi_classic}" = "yes" ]; then + if [ "${INTELMPI_CLASSIC}" = "yes" ]; then check_command ${pkg_install_dir}/bin/mpiicc "intel" && MPICC="${pkg_install_dir}/bin/mpiicc" || exit 1 check_command ${pkg_install_dir}/bin/mpiicpc "intel" && MPICXX="${pkg_install_dir}/bin/mpiicpc" || exit 1 check_command ${pkg_install_dir}/bin/mpiifort "intel" && MPIFC="${pkg_install_dir}/bin/mpiifort" || exit 1 else check_command ${pkg_install_dir}/bin/mpiicx "intel" && MPICC="${pkg_install_dir}/bin/mpiicx" || exit 1 check_command ${pkg_install_dir}/bin/mpiicpx "intel" && MPICXX="${pkg_install_dir}/bin/mpiicpx" || exit 1 - if [ "${with_ifx}" = "yes" ]; then + if [ "${WITH_IFX}" = "yes" ]; then check_command ${pkg_install_dir}/bin/mpiifx "intel" && MPIFC="${pkg_install_dir}/bin/mpiifx" || exit 1 else check_command ${pkg_install_dir}/bin/mpiifort "intel" && MPIFC="${pkg_install_dir}/bin/mpiifort" || exit 1 @@ -107,7 +107,7 @@ if [ "${with_intelmpi}" != "__DONTUSE__" ]; then else I_MPI_CXX="icpx" I_MPI_CC="icx" - if [ "${with_ifx}" = "yes" ]; then + if [ "${WITH_IFX}" = "yes" ]; then I_MPI_FC="ifx" else I_MPI_FC="ifort" diff --git a/toolchain/scripts/stage1/install_mpich.sh b/toolchain/scripts/stage1/install_mpich.sh index c89ae2bb8ca..2b80c738920 100755 --- a/toolchain/scripts/stage1/install_mpich.sh +++ b/toolchain/scripts/stage1/install_mpich.sh @@ -47,7 +47,7 @@ case "${with_mpich}" in #download_pkg_from_ABACUS_org "${mpich_sha256}" "${mpich_pkg}" download_pkg_from_url "${mpich_sha256}" "${mpich_pkg}" "${url}" fi - if [ "${pack_run}" = "__TRUE__" ]; then + if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip installation" else echo "Installing from scratch into ${pkg_install_dir} for MPICH device ${MPICH_DEVICE}" @@ -76,7 +76,7 @@ case "${with_mpich}" in write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage1/$(basename ${SCRIPT_NAME})" fi fi - if [ "${pack_run}" = "__TRUE__" ]; then + if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip system check" else check_dir "${pkg_install_dir}/bin" diff --git a/toolchain/scripts/stage1/install_openmpi.sh b/toolchain/scripts/stage1/install_openmpi.sh index fdaace3d40d..6803ec1dcb7 100755 --- a/toolchain/scripts/stage1/install_openmpi.sh +++ b/toolchain/scripts/stage1/install_openmpi.sh @@ -10,7 +10,7 @@ [ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0 SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")/.." && pwd -P)" -if [ "${openmpi_4th}" = "yes" ]; then +if [ "${OPENMPI_4TH}" = "yes" ]; then openmpi_ver="4.1.6" openmpi_sha256="f740994485516deb63b5311af122c265179f5328a0d857a567b85db00b11e415" else @@ -49,7 +49,7 @@ case "${with_openmpi}" in else download_pkg_from_url "${openmpi_sha256}" "${openmpi_pkg}" "${url}" fi - if [ "${pack_run}" = "__TRUE__" ]; then + if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip installation" else echo "Installing from scratch into ${pkg_install_dir}" @@ -91,7 +91,7 @@ case "${with_openmpi}" in write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage1/$(basename ${SCRIPT_NAME})" fi fi - if [ "${pack_run}" = "__TRUE__" ]; then + if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip system check" else check_dir "${pkg_install_dir}/bin" diff --git a/toolchain/scripts/stage2/install_aocl.sh b/toolchain/scripts/stage2/install_aocl.sh index e3b861bcdb1..83d6d125b33 100755 --- a/toolchain/scripts/stage2/install_aocl.sh +++ b/toolchain/scripts/stage2/install_aocl.sh @@ -27,13 +27,13 @@ case "${with_aocl}" in __INSTALL__) echo "==================== Installing AOCL ====================" report_error ${LINENO} "To install AOCL, please contact your system administrator." - if [ "${pack_run}" != "__TRUE__" ]; then + if [ "${PACK_RUN}" != "__TRUE__" ]; then exit 1 fi ;; __SYSTEM__) echo "==================== Finding AOCL from system paths ====================" - if [ "${pack_run}" = "__TRUE__" ]; then + if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip system check" else check_lib -lblis "AOCL" diff --git a/toolchain/scripts/stage2/install_mkl.sh b/toolchain/scripts/stage2/install_mkl.sh index 054a7324736..4262b202bf2 100755 --- a/toolchain/scripts/stage2/install_mkl.sh +++ b/toolchain/scripts/stage2/install_mkl.sh @@ -28,13 +28,13 @@ case "${with_mkl}" in __INSTALL__) echo "==================== Installing MKL ====================" report_error ${LINENO} "To install MKL, please contact your system administrator." - if [ "${pack_run}" != "__TRUE__" ]; then + if [ "${PACK_RUN}" != "__TRUE__" ]; then exit 1 fi ;; __SYSTEM__) echo "==================== Finding MKL from system paths ====================" - if [ "${pack_run}" = "__TRUE__" ]; then + if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip system check" else if ! [ -z "${MKLROOT}" ]; then diff --git a/toolchain/scripts/stage2/install_openblas.sh b/toolchain/scripts/stage2/install_openblas.sh index c36d44f6016..2833501a488 100755 --- a/toolchain/scripts/stage2/install_openblas.sh +++ b/toolchain/scripts/stage2/install_openblas.sh @@ -41,7 +41,7 @@ case "${with_openblas}" in else download_pkg_from_ABACUS_org "${openblas_sha256}" "${openblas_pkg}" fi - if [ "${pack_run}" = "__TRUE__" ]; then + if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip installation" else echo "Installing from scratch into ${pkg_install_dir}" diff --git a/toolchain/scripts/stage3/install_elpa.sh b/toolchain/scripts/stage3/install_elpa.sh index d9bd070fd44..780e5c67767 100755 --- a/toolchain/scripts/stage3/install_elpa.sh +++ b/toolchain/scripts/stage3/install_elpa.sh @@ -68,7 +68,7 @@ case "$with_elpa" in else download_pkg_from_url "${elpa_sha256}" "${elpa_pkg}" "${url}" fi - if [ "${pack_run}" = "__TRUE__" ]; then + if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip installation" else [ -d elpa-${elpa_ver} ] && rm -rf elpa-${elpa_ver} @@ -109,7 +109,7 @@ case "$with_elpa" in echo "Installing from scratch into ${pkg_install_dir}/${TARGET}" mkdir -p "build_${TARGET}" cd "build_${TARGET}" - if [ "${with_amd}" != "__DONTUSE__" ] && [ "${with_flang}" = "yes" ] ; then + if [ "${with_amd}" != "__DONTUSE__" ] && [ "${WITH_FLANG}" = "yes" ] ; then echo "AMD fortran compiler detected, enable special option operation" ../configure --prefix="${pkg_install_dir}/${TARGET}/" \ --libdir="${pkg_install_dir}/${TARGET}/lib" \ diff --git a/toolchain/scripts/stage3/install_fftw.sh b/toolchain/scripts/stage3/install_fftw.sh index 8bea8ed3c13..a04d47d3225 100755 --- a/toolchain/scripts/stage3/install_fftw.sh +++ b/toolchain/scripts/stage3/install_fftw.sh @@ -42,7 +42,7 @@ case "$with_fftw" in else download_pkg_from_ABACUS_org "${fftw_sha256}" "${fftw_pkg}" fi - if [ "${pack_run}" = "__TRUE__" ]; then + if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip installation" else echo "Installing from scratch into ${pkg_install_dir}" diff --git a/toolchain/scripts/stage3/install_libxc.sh b/toolchain/scripts/stage3/install_libxc.sh index 25cf4218026..3eeac7a6580 100755 --- a/toolchain/scripts/stage3/install_libxc.sh +++ b/toolchain/scripts/stage3/install_libxc.sh @@ -43,7 +43,7 @@ case "$with_libxc" in libxc_url="https://gitlab.com/libxc/libxc/-/archive/${libxc_ver}/${libxc_pkg}" download_pkg_from_url "${libxc_sha256}" "${libxc_pkg}" "${libxc_url}" fi - if [ "${pack_run}" = "__TRUE__" ]; then + if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip installation" else echo "Installing from scratch into ${pkg_install_dir}" diff --git a/toolchain/scripts/stage3/install_scalapack.sh b/toolchain/scripts/stage3/install_scalapack.sh index 3b5d3612f73..eb45dbd8e18 100755 --- a/toolchain/scripts/stage3/install_scalapack.sh +++ b/toolchain/scripts/stage3/install_scalapack.sh @@ -41,7 +41,7 @@ case "$with_scalapack" in else download_pkg_from_ABACUS_org "${scalapack_sha256}" "${scalapack_pkg}" fi - if [ "${pack_run}" = "__TRUE__" ]; then + if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip installation" else echo "Installing from scratch into ${pkg_install_dir}" diff --git a/toolchain/scripts/stage4/install_cereal.sh b/toolchain/scripts/stage4/install_cereal.sh index 15b94b2ecd5..b3523affbe8 100755 --- a/toolchain/scripts/stage4/install_cereal.sh +++ b/toolchain/scripts/stage4/install_cereal.sh @@ -43,7 +43,7 @@ case "$with_cereal" in echo "===> Notice: This version of CEREAL is downloaded in GitHub Release, which will always be out-of-date version <===" download_pkg_from_url "${cereal_sha256}" "${filename}" "${url}" fi - if [ "${pack_run}" = "__TRUE__" ]; then + if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip installation" else echo "Installing from scratch into ${pkg_install_dir}" diff --git a/toolchain/scripts/stage4/install_libcomm.sh b/toolchain/scripts/stage4/install_libcomm.sh index 6fd351ce856..a1697e35c3c 100755 --- a/toolchain/scripts/stage4/install_libcomm.sh +++ b/toolchain/scripts/stage4/install_libcomm.sh @@ -44,7 +44,7 @@ case "$with_libcomm" in echo "===> Notice: This version of LibComm is downloaded in GitHub Release, which will always be out-of-date version <===" download_pkg_from_url "${libcomm_sha256}" "${filename}" "${url}" fi - if [ "${pack_run}" = "__TRUE__" ]; then + if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip installation" else echo "Installing from scratch into ${pkg_install_dir}" diff --git a/toolchain/scripts/stage4/install_libnpy.sh b/toolchain/scripts/stage4/install_libnpy.sh index aef24c5ee49..0a23d726aeb 100755 --- a/toolchain/scripts/stage4/install_libnpy.sh +++ b/toolchain/scripts/stage4/install_libnpy.sh @@ -44,7 +44,7 @@ case "$with_libnpy" in echo "===> Notice: This version of Libnpy is downloaded in GitHub Release, which will always be out-of-date version <===" download_pkg_from_url "${libnpy_sha256}" "${filename}" "${url}" fi - if [ "${pack_run}" = "__TRUE__" ]; then + if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip installation" else echo "Installing from scratch into ${pkg_install_dir}" diff --git a/toolchain/scripts/stage4/install_libri.sh b/toolchain/scripts/stage4/install_libri.sh index 4156cf0bcdd..0e187d53efc 100755 --- a/toolchain/scripts/stage4/install_libri.sh +++ b/toolchain/scripts/stage4/install_libri.sh @@ -44,7 +44,7 @@ case "$with_libri" in echo "===> Notice: This version of LibRI is downloaded in GitHub Release, which will always be out-of-date version <===" download_pkg_from_url "${libri_sha256}" "${filename}" "${url}" fi - if [ "${pack_run}" = "__TRUE__" ]; then + if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip installation" else echo "Installing from scratch into ${pkg_install_dir}" diff --git a/toolchain/scripts/stage4/install_libtorch.sh b/toolchain/scripts/stage4/install_libtorch.sh index 896cacb9f7a..84fcbe8e103 100755 --- a/toolchain/scripts/stage4/install_libtorch.sh +++ b/toolchain/scripts/stage4/install_libtorch.sh @@ -53,7 +53,7 @@ case "${with_libtorch}" in url=https://download.pytorch.org/libtorch/cpu/${archive_file} download_pkg_from_url "${libtorch_sha256}" "${filename}" "${url}" fi - if [ "${pack_run}" = "__TRUE__" ]; then + if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip installation" else echo "Installing from scratch into ${pkg_install_dir}" diff --git a/toolchain/scripts/stage4/install_rapidjson.sh b/toolchain/scripts/stage4/install_rapidjson.sh index eab76eee0aa..14dc5d8530c 100755 --- a/toolchain/scripts/stage4/install_rapidjson.sh +++ b/toolchain/scripts/stage4/install_rapidjson.sh @@ -43,7 +43,7 @@ case "$with_rapidjson" in echo "===> Notice: This version of rapidjson is downloaded in GitHub Release, which will always be out-of-date version <===" download_pkg_from_url "${rapidjson_sha256}" "${filename}" "${url}" fi - if [ "${pack_run}" = "__TRUE__" ]; then + if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip installation" else echo "Installing from scratch into ${pkg_install_dir}" diff --git a/toolchain/scripts/tool_kit.sh b/toolchain/scripts/tool_kit.sh index 7f03c3d787f..909fe836a2d 100755 --- a/toolchain/scripts/tool_kit.sh +++ b/toolchain/scripts/tool_kit.sh @@ -655,7 +655,7 @@ download_pkg_from_ABACUS_org() { if ! wget ${DOWNLOADER_FLAGS} $__url; then report_error "failed to download $__url" recommend_offline_installation $__filename $__url - if [ "${pack_run}" != "__TRUE__" ]; then + if [ "${PACK_RUN}" != "__TRUE__" ]; then return 1 fi fi @@ -675,7 +675,7 @@ download_pkg_from_url() { if ! wget ${DOWNLOADER_FLAGS} $__url -O $__filename; then report_error "failed to download $__url" recommend_offline_installation $__filename $__url - if [ "${pack_run}" != "__TRUE__" ]; then + if [ "${PACK_RUN}" != "__TRUE__" ]; then return 1 fi fi From 65ddd668aa41eda197d4fae3058d80dcaf073417 Mon Sep 17 00:00:00 2001 From: JamesMisaka Date: Tue, 25 Mar 2025 12:33:53 +0800 Subject: [PATCH 5/7] update downloading url --- toolchain/scripts/stage0/install_cmake.sh | 4 +++- toolchain/scripts/stage0/install_gcc.sh | 22 +++++++++++++-------- toolchain/scripts/stage1/install_openmpi.sh | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/toolchain/scripts/stage0/install_cmake.sh b/toolchain/scripts/stage0/install_cmake.sh index 02cd6370248..894a1e58f2f 100755 --- a/toolchain/scripts/stage0/install_cmake.sh +++ b/toolchain/scripts/stage0/install_cmake.sh @@ -43,7 +43,9 @@ case "${with_cmake}" in if [ -f $cmake_pkg ]; then echo "$cmake_pkg is found" else - download_pkg_from_ABACUS_org "${cmake_sha256}" "$cmake_pkg" + #download_pkg_from_ABACUS_org "${cmake_sha256}" "$cmake_pkg" + url="https://cmake.org/files/v${cmake_ver%.*}/${cmake_pkg}" + download_pkg_from_url "${cmake_sha256}" "${cmake_pkg}" "${url}" fi if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip installation" diff --git a/toolchain/scripts/stage0/install_gcc.sh b/toolchain/scripts/stage0/install_gcc.sh index ef00b994b98..65e9d93aa10 100755 --- a/toolchain/scripts/stage0/install_gcc.sh +++ b/toolchain/scripts/stage0/install_gcc.sh @@ -40,7 +40,9 @@ case "${with_gcc}" in if [ -f gcc-${gcc_ver}.tar.gz ]; then echo "gcc-${gcc_ver}.tar.gz is found" else - download_pkg_from_ABACUS_org "${gcc_sha256}" "gcc-${gcc_ver}.tar.gz" + #download_pkg_from_ABACUS_org "${gcc_sha256}" "gcc-${gcc_ver}.tar.gz" + url=https://mirrors.tuna.tsinghua.edu.cn/gnu/gcc/gcc-${gcc_ver}/gcc-${gcc_ver}.tar.gz + download_pkg_from_url "${gcc_sha256}" "gcc-${gcc_ver}.tar.gz" "${url}" fi if [ "${PACK_RUN}" = "__TRUE__" ]; then echo "--pack-run mode specified, skip installation" @@ -119,13 +121,17 @@ case "${with_gcc}" in write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage0/$(basename ${SCRIPT_NAME})" fi fi - check_install ${pkg_install_dir}/bin/gcc "gcc" && CC="${pkg_install_dir}/bin/gcc" || exit 1 - check_install ${pkg_install_dir}/bin/g++ "gcc" && CXX="${pkg_install_dir}/bin/g++" || exit 1 - check_install ${pkg_install_dir}/bin/gfortran "gcc" && FC="${pkg_install_dir}/bin/gfortran" || exit 1 - F90="${FC}" - F77="${FC}" - GCC_CFLAGS="-I'${pkg_install_dir}/include'" - GCC_LDFLAGS="-L'${pkg_install_dir}/lib64' -L'${pkg_install_dir}/lib' -Wl,-rpath,'${pkg_install_dir}/lib64' -Wl,-rpath,'${pkg_install_dir}/lib64'" + if [ "${PACK_RUN}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip system check" + else + check_install ${pkg_install_dir}/bin/gcc "gcc" && CC="${pkg_install_dir}/bin/gcc" || exit 1 + check_install ${pkg_install_dir}/bin/g++ "gcc" && CXX="${pkg_install_dir}/bin/g++" || exit 1 + check_install ${pkg_install_dir}/bin/gfortran "gcc" && FC="${pkg_install_dir}/bin/gfortran" || exit 1 + F90="${FC}" + F77="${FC}" + GCC_CFLAGS="-I'${pkg_install_dir}/include'" + GCC_LDFLAGS="-L'${pkg_install_dir}/lib64' -L'${pkg_install_dir}/lib' -Wl,-rpath,'${pkg_install_dir}/lib64' -Wl,-rpath,'${pkg_install_dir}/lib64'" + fi ;; __SYSTEM__) echo "==================== Finding GCC from system paths ====================" diff --git a/toolchain/scripts/stage1/install_openmpi.sh b/toolchain/scripts/stage1/install_openmpi.sh index 6803ec1dcb7..e9ececd7a7c 100755 --- a/toolchain/scripts/stage1/install_openmpi.sh +++ b/toolchain/scripts/stage1/install_openmpi.sh @@ -40,7 +40,7 @@ case "${with_openmpi}" in pkg_install_dir="${INSTALLDIR}/openmpi-${openmpi_ver}" #pkg_install_dir="${HOME}/apps/openmpi/${openmpi_ver}-gcc8" install_lock_file="$pkg_install_dir/install_successful" - url="https://download.open-mpi.org/release/open-mpi/v${openmpi_ver:0:3}/${openmpi_pkg}" + url="https://download.open-mpi.org/release/open-mpi/v${openmpi_ver%.*}/${openmpi_pkg}" if verify_checksums "${install_lock_file}"; then echo "openmpi-${openmpi_ver} is already installed, skipping it." else From b18e519d372c11b806032ed5a69c5e2e568a8860 Mon Sep 17 00:00:00 2001 From: JamesMisaka Date: Tue, 25 Mar 2025 12:41:31 +0800 Subject: [PATCH 6/7] add pack-run in intel/amd --- toolchain/scripts/stage0/install_amd.sh | 4 ++++ toolchain/scripts/stage0/install_intel.sh | 4 ++++ toolchain/scripts/stage1/install_intelmpi.sh | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/toolchain/scripts/stage0/install_amd.sh b/toolchain/scripts/stage0/install_amd.sh index 5f3b1f5abff..4ecfce526c1 100755 --- a/toolchain/scripts/stage0/install_amd.sh +++ b/toolchain/scripts/stage0/install_amd.sh @@ -33,6 +33,9 @@ case "${with_amd}" in ;; __SYSTEM__) echo "==================== Finding AMD compiler from system paths ====================" + if [ "${PACK_RUN}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip system check" + else check_command clang "amd" && CC="$(realpath $(command -v clang))" || exit 1 check_command clang++ "amd" && CXX="$(realpath $(command -v clang++))" || exit 1 if [ "${WITH_FLANG}" = "yes" ]; then @@ -41,6 +44,7 @@ case "${with_amd}" in check_command gfortran "gcc" && FC="gfortran" || exit 1 add_lib_from_paths GCC_LDFLAGS "libgfortran.*" ${LIB_PATHS} fi + fi F90="${FC}" F77="${FC}" ;; diff --git a/toolchain/scripts/stage0/install_intel.sh b/toolchain/scripts/stage0/install_intel.sh index 98fda1131d8..afec2e312ff 100755 --- a/toolchain/scripts/stage0/install_intel.sh +++ b/toolchain/scripts/stage0/install_intel.sh @@ -33,6 +33,9 @@ case "${with_intel}" in ;; __SYSTEM__) echo "==================== Finding Intel compiler from system paths ====================" + if [ "${PACK_RUN}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip system check" + else if [ "${intel_classic}" = "yes" ]; then check_command icc "intel" && CC="$(realpath $(command -v icc))" || exit 1 check_command icpc "intel" && CXX="$(realpath $(command -v icpc))" || exit 1 @@ -46,6 +49,7 @@ case "${with_intel}" in check_command ifort "intel" && FC="$(realpath $(command -v ifort))" || exit 1 fi fi + fi F90="${FC}" F77="${FC}" ;; diff --git a/toolchain/scripts/stage1/install_intelmpi.sh b/toolchain/scripts/stage1/install_intelmpi.sh index 61112d8f155..0c350f69ae7 100755 --- a/toolchain/scripts/stage1/install_intelmpi.sh +++ b/toolchain/scripts/stage1/install_intelmpi.sh @@ -33,6 +33,9 @@ case "${with_intelmpi}" in ;; __SYSTEM__) echo "==================== Finding Intel MPI from system paths ====================" + if [ "${PACK_RUN}" = "__TRUE__" ]; then + echo "--pack-run mode specified, skip system check" + else check_command mpiexec "intelmpi" && MPIRUN="$(realpath $(command -v mpiexec))" if [ "${intel_classic}" = "yes" ]; then # if intel compiler used as classic, so as intelmpi @@ -63,6 +66,7 @@ case "${with_intelmpi}" in add_lib_from_paths INTELMPI_LDFLAGS "libmpi.*" $LIB_PATHS check_lib -lmpi "intelmpi" check_lib -lmpicxx "intelmpi" + fi ;; __DONTUSE__) # Nothing to do From 6ba6c6390bd70c3fe479205c0f8ac53ee5790745 Mon Sep 17 00:00:00 2001 From: JamesMisaka Date: Tue, 25 Mar 2025 12:55:23 +0800 Subject: [PATCH 7/7] fix link of github packages --- toolchain/scripts/stage4/install_cereal.sh | 1 + toolchain/scripts/stage4/install_libcomm.sh | 1 + toolchain/scripts/stage4/install_libnpy.sh | 1 + toolchain/scripts/stage4/install_libri.sh | 1 + toolchain/scripts/stage4/install_rapidjson.sh | 1 + 5 files changed, 5 insertions(+) diff --git a/toolchain/scripts/stage4/install_cereal.sh b/toolchain/scripts/stage4/install_cereal.sh index b3523affbe8..81ab61eccf4 100755 --- a/toolchain/scripts/stage4/install_cereal.sh +++ b/toolchain/scripts/stage4/install_cereal.sh @@ -54,6 +54,7 @@ case "$with_cereal" in write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage4/$(basename ${SCRIPT_NAME})" fi fi + CEREAL_CFLAGS="-I'${pkg_install_dir}'" ;; __SYSTEM__) echo "==================== CANNOT Finding CEREAL from system paths NOW ====================" diff --git a/toolchain/scripts/stage4/install_libcomm.sh b/toolchain/scripts/stage4/install_libcomm.sh index a1697e35c3c..1f3aa5d8145 100755 --- a/toolchain/scripts/stage4/install_libcomm.sh +++ b/toolchain/scripts/stage4/install_libcomm.sh @@ -54,6 +54,7 @@ case "$with_libcomm" in write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage4/$(basename ${SCRIPT_NAME})" fi fi + LIBCOMM_CFLAGS="-I'${pkg_install_dir}'" ;; __SYSTEM__) echo "==================== CANNOT Finding LIBCOMM from system paths NOW ====================" diff --git a/toolchain/scripts/stage4/install_libnpy.sh b/toolchain/scripts/stage4/install_libnpy.sh index 0a23d726aeb..f787a8bbc07 100755 --- a/toolchain/scripts/stage4/install_libnpy.sh +++ b/toolchain/scripts/stage4/install_libnpy.sh @@ -55,6 +55,7 @@ case "$with_libnpy" in write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage4/$(basename ${SCRIPT_NAME})" fi fi + LIBNPY_CFLAGS="-I'${pkg_install_dir}'" ;; __SYSTEM__) echo "==================== CANNOT Finding LIBNPY from system paths NOW ====================" diff --git a/toolchain/scripts/stage4/install_libri.sh b/toolchain/scripts/stage4/install_libri.sh index 0e187d53efc..2e3e6574319 100755 --- a/toolchain/scripts/stage4/install_libri.sh +++ b/toolchain/scripts/stage4/install_libri.sh @@ -54,6 +54,7 @@ case "$with_libri" in write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage4/$(basename ${SCRIPT_NAME})" fi fi + LIBRI_CFLAGS="-I'${pkg_install_dir}'" ;; __SYSTEM__) echo "==================== CANNOT Finding LIBRI from system paths NOW ====================" diff --git a/toolchain/scripts/stage4/install_rapidjson.sh b/toolchain/scripts/stage4/install_rapidjson.sh index 14dc5d8530c..3c420ca1de5 100755 --- a/toolchain/scripts/stage4/install_rapidjson.sh +++ b/toolchain/scripts/stage4/install_rapidjson.sh @@ -56,6 +56,7 @@ case "$with_rapidjson" in write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage4/$(basename ${SCRIPT_NAME})" fi fi + RAPIDJSON_CFLAGS="-I'${pkg_install_dir}'" ;; __SYSTEM__) echo "==================== CANNOT Finding RAPIDJSON from system paths NOW ===================="