Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion toolchain/build_abacus_gnu.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -e
#SBATCH -J build_abacus_gnu
#SBATCH -N 1
#SBATCH -n 16
Expand Down
2 changes: 1 addition & 1 deletion toolchain/build_abacus_intel.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -e
#SBATCH -J build_abacus_intel
#SBATCH -N 1
#SBATCH -n 16
Expand Down
9 changes: 9 additions & 0 deletions toolchain/scripts/lib/config_manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,11 @@ config_validate() {
CONFIG_CACHE["ARCH_NUM"]="no"
fi

# Backward compatibility: also export ARCH_NUM to environment when set
if [[ -n "${CONFIG_CACHE[ARCH_NUM]}" ]]; then
export ARCH_NUM="${CONFIG_CACHE[ARCH_NUM]}"
fi

return 0
}

Expand Down Expand Up @@ -606,6 +611,10 @@ config_export_to_env() {
for key in "${!CONFIG_CACHE[@]}"; do
export "$key"="${CONFIG_CACHE[$key]}"
done

# Backward compatibility for stage scripts expecting uppercase GPU flags
# Installers (e.g., stage3/install_elpa.sh) read ENABLE_CUDA, not enable_cuda
export ENABLE_CUDA="${CONFIG_CACHE[enable_cuda]}"

# Export package list variables
export tool_list
Expand Down
2 changes: 1 addition & 1 deletion toolchain/scripts/stage2/install_openblas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if [[ -z "$version_suffix" && -n "${ABACUS_TOOLCHAIN_VERSION_SUFFIX}" ]]; then
fi
# Load package variables with appropriate version
load_package_vars "openblas" "$version_suffix"
openblas_pkg="openblas-${openblas_ver}.tar.gz"
openblas_pkg="OpenBLAS-${openblas_ver}.tar.gz"

source "${INSTALLDIR}"/toolchain.conf
source "${INSTALLDIR}"/toolchain.env
Expand Down
8 changes: 6 additions & 2 deletions toolchain/scripts/stage3/install_elpa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ case "$with_elpa" in
fi
fi
for TARGET in "cpu" "nvidia"; do
[ "$TARGET" = "nvidia" ] && [ "$ENABLE_CUDA" != "__TRUE__" ] && continue
# Accept both uppercase and lowercase GPU enable flags for compatibility
gpu_enabled="${ENABLE_CUDA:-${enable_cuda}}"
[ "$TARGET" = "nvidia" ] && [ "$gpu_enabled" != "__TRUE__" ] && continue
# disable cpu if cuda is enabled, only install one
[ "$TARGET" != "nvidia" ] && [ "$ENABLE_CUDA" = "__TRUE__" ] && continue
[ "$TARGET" != "nvidia" ] && [ "$gpu_enabled" = "__TRUE__" ] && continue
# extend the pkg_install_dir by TARGET
# this linking method is totally different from cp2k toolchain
# for cp2k, ref https://github.com/cp2k/cp2k/commit/6fe2fc105b8cded84256248f68c74139dd8fc2e9
Expand All @@ -139,6 +141,7 @@ case "$with_elpa" in
--with-cuda-path=${CUDA_PATH:-${CUDA_HOME:-/CUDA_HOME-notset}} \
--enable-nvidia-gpu-kernels=$([ "$TARGET" = "nvidia" ] && echo "yes" || echo "no") \
--with-NVIDIA-GPU-compute-capability=$([ "$TARGET" = "nvidia" ] && echo "sm_$ARCH_NUM" || echo "sm_70") \
--enable-nvidia-cub --with-cusolver \
OMPI_MCA_plm_rsh_agent=/bin/false \
FC=${MPIFC} \
CC=${MPICC} \
Expand Down Expand Up @@ -170,6 +173,7 @@ case "$with_elpa" in
--enable-nvidia-gpu-kernels=$([ "$TARGET" = "nvidia" ] && echo "yes" || echo "no") \
--with-cuda-path=${CUDA_PATH:-${CUDA_HOME:-/CUDA_HOME-notset}} \
--with-NVIDIA-GPU-compute-capability=$([ "$TARGET" = "nvidia" ] && echo "sm_$ARCH_NUM" || echo "sm_70") \
--enable-nvidia-cub --with-cusolver \
FC=${MPIFC} \
CC=${MPICC} \
CXX=${MPICXX} \
Expand Down
2 changes: 1 addition & 1 deletion toolchain/scripts/tool_kit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ download_pkg_from_url() {
"smart"|*)
# Smart fallback: try with certificate validation first, then without
echo "Attempting secure download: $__url"
if wget ${DOWNLOADER_FLAGS} "$__url" -O "$__filename" 2>/dev/null; then
if wget ${DOWNLOADER_FLAGS} "$__url" -O "$__filename"; then
echo "Download successful with certificate validation"
else
echo "Certificate validation failed, retrying without certificate check..."
Expand Down
Loading