Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ __pycache__
abacus.json
*.npy
toolchain/install/
toolchain/abacus_env.sh
toolchain/abacus_env.sh
.trae
12 changes: 6 additions & 6 deletions toolchain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,21 +151,21 @@ Mix online and offline packages as needed - the toolchain automatically detects
## Supported Toolchains

### GNU Toolchain
- **Compilers**: System GCC (≥5.0)
- **Compilers**: System GCC (≥5.0) or installed GCC
- **MPI**: OpenMPI or MPICH
- **Math**: OpenBLAS + ScaLAPACK
- **Features**: Most stable, widely compatible

### Intel Toolchain
- **Compilers**: Intel OneAPI (icx/icpx/ifx or classic icc/icpc/ifort)
- **Compilers**: Intel OneAPI (icx/icpx/ifx or classic icc/icpc/ifort) with system/installed GCC (≥5.0)
- **MPI**: Intel MPI
- **Math**: Intel MKL
- **Features**: Optimized performance, EXX support
- **Features**: Optimized performance for Intel Machine

### AMD Toolchain
- **Compilers**: AMD AOCC or GCC
- **Compilers**: AMD AOCC or system/installed GCC
- **Math**: AMD AOCL (Optimized math libraries)
- **Features**: AMD processor optimization
- **Features**: AMD processor optimization (e.g., Zen3+)

## Dependencies

Expand Down Expand Up @@ -193,7 +193,7 @@ Mix online and offline packages as needed - the toolchain automatically detects
| LibComm | master | EXX calculations | GPL-3.0 | Install |
| LibTorch | 2.1.2 / 1.12.1 | MLALGO support | BSD-3-Clause | Optional |
| LibNPY | 1.0.1 / 1.0.1 | NumPy I/O | MIT | Optional |
| NEP | main | Neural network potential | MIT | Optional |
| NEP | main | Neuroevolution potential | MIT | Optional |

Also, [Intel-oneAPI](https://www.intel.cn/content/www/cn/zh/developer/tools/oneapi/toolkits.html) and AMD [AOCC](https://www.amd.com/zh-cn/developer/aocc.html) and [AOCL](https://www.amd.com/zh-cn/developer/aocl.html) are supported in toolchain by setting them to system option, but one should install them manually by server administrator.

Expand Down
21 changes: 1 addition & 20 deletions toolchain/install_abacus_toolchain.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
#!/bin/bash -e

# TODO: Review and if possible fix shellcheck errors.
# TODO: Remove this deprecated script in the future.
# shellcheck disable=all

[ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")" && pwd -P)"

# +---------------------------------------------------------------------------+
# | ABACUS: (Atomic-orbital Based Ab-initio Computation at UStc) |
# | -- an open-source package based on density functional theory(DFT) |
# | Copyright 2004-2022 ABACUS developers group |
# | <https://github.com/deepmodeling/abacus-develop> |
# | |
# | SPDX-License-Identifier: GPL-2.0-or-later |
# +---------------------------------------------------------------------------+
#
#
# *****************************************************************************
#> \brief This script will compile and install or link existing tools and
#> libraries ABACUS depends on and generate setup files that
#> can be used to compile and use ABACUS
#> \history Created on Friday, 2023/08/18
# Update for Intel (18.08.2023, MK)
#> \author Zhaoqing Liu (Quantum Misaka) [email protected]
# *****************************************************************************

# ------------------------------------------------------------------------
# Work directories and used files
# ------------------------------------------------------------------------
Expand Down
7 changes: 3 additions & 4 deletions toolchain/install_abacus_toolchain_new.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#!/bin/bash -e

# ============================================================================
# ABACUS Toolchain Installation Script (New Version - Enhanced UI)
# ABACUS Toolchain Installation Script (New refractored version)
# ============================================================================
# This is the new refactored version of the ABACUS toolchain installation script.
# It provides the same functionality as the original script but with improved
# modularity, maintainability, extensibility, and beautiful terminal output.
# It provides the most main functionality as the original script but with
# improved modularity, maintainability, extensibility, and beautiful terminal output.
#
# Author: Quantum Misaka by Trae SOLO
# Date: 2025-10-16
# Enhanced: Beautiful terminal UI with harmonious color scheme
# ============================================================================

# Set script name for error reporting
Expand Down
9 changes: 9 additions & 0 deletions toolchain/scripts/lib/user_interface.sh
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,15 @@ ui_show_summary() {
echo " ├─ Kernel: $(uname -r)"
echo " ├─ glibc: $(ui_get_glibc_version)"
echo " ├─ CPU Cores: $(nproc 2>/dev/null || echo "unknown")"
# CPU model detection
local cpu_model="unknown"
if command -v lscpu &> /dev/null; then
cpu_model=$(LC_ALL=C lscpu | awk -F: '/^Model name/{print $2}' | sed 's/^[[:space:]]*//')
fi
if [[ -z "$cpu_model" || "$cpu_model" == "unknown" ]] && [[ -r /proc/cpuinfo ]]; then
cpu_model=$(awk -F: '/model name|Hardware|Processor/{print $2; exit}' /proc/cpuinfo | sed 's/^[[:space:]]*//')
fi
echo " ├─ CPU Model: ${cpu_model}"
if command -v free &> /dev/null; then
local mem_gb=$(free -g | awk '/^Mem:/ {print $2}')
echo " ├─ Memory: ${mem_gb}GB"
Expand Down
6 changes: 3 additions & 3 deletions toolchain/scripts/stage2/install_aocl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ export AOCL_ROOT="${pkg_install_dir}"
export AOCL_CFLAGS="${AOCL_CFLAGS}"
export AOCL_LDFLAGS="${AOCL_LDFLAGS}"
export AOCL_LIBS="${AOCL_LIBS}"
export FAST_MATH_CFLAGS="\${FAST_MATH_CFLAGS} ${AOCL_CFLAGS}"
export FAST_MATH_LDFLAGS="\${FAST_MATH_LDFLAGS} ${AOCL_LDFLAGS}"
export FAST_MATH_LIBS="\${FAST_MATH_LIBS} ${AOCL_LIBS}"
export MATH_CFLAGS="\${MATH_CFLAGS} ${AOCL_CFLAGS}"
export MATH_LDFLAGS="\${MATH_LDFLAGS} ${AOCL_LDFLAGS}"
export MATH_LIBS="\${MATH_LIBS} ${AOCL_LIBS}"
EOF
fi

Expand Down
3 changes: 3 additions & 0 deletions toolchain/scripts/tool_kit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,7 @@ download_pkg_from_url() {
"strict")
echo "Downloading with strict certificate validation: $__url"
if ! wget ${DOWNLOADER_FLAGS} "$__url" -O "$__filename"; then
rm -f "$__filename"
report_error "failed to download $__url (strict certificate validation)"
recommend_offline_installation "$__filename" "$__url"
if [ "${PACK_RUN}" != "__TRUE__" ]; then
Expand All @@ -966,6 +967,7 @@ download_pkg_from_url() {
"skip")
echo "Downloading with certificate validation disabled: $__url"
if ! wget ${DOWNLOADER_FLAGS} "$__url" -O "$__filename" --no-check-certificate; then
rm -f "$__filename"
report_error "failed to download $__url"
recommend_offline_installation "$__filename" "$__url"
if [ "${PACK_RUN}" != "__TRUE__" ]; then
Expand All @@ -981,6 +983,7 @@ download_pkg_from_url() {
else
echo "Certificate validation failed, retrying without certificate check..."
if ! wget ${DOWNLOADER_FLAGS} "$__url" -O "$__filename" --no-check-certificate; then
rm -f "$__filename"
report_error "failed to download $__url (both secure and insecure attempts failed)"
recommend_offline_installation "$__filename" "$__url"
if [ "${PACK_RUN}" != "__TRUE__" ]; then
Expand Down
4 changes: 3 additions & 1 deletion toolchain/toolchain_aocc-aocl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ WITH_RAPIDJSON="install"
WITH_LIBRI="install"
WITH_LIBCOMM="install"

# Optional Features (DeepKS support)
# Optional Features (MLALGO support)
WITH_LIBTORCH="no" # Set to "install" for DeepKS support
WITH_LIBNPY="no" # Set to "install" for DeepKS support
WITH_NEP="no"
Expand Down Expand Up @@ -71,7 +71,9 @@ CMAKE_VERSION="main" # main=3.31.7, alt=3.30.5
OPENMPI_VERSION="main" # main=5.0.8, alt=4.1.6
ELPA_VERSION="main" # main=2025.06.001, alt=2024.05.001
LIBXC_VERSION="main" # main=7.0.0, alt=6.2.2
# Optional Libraries
LIBTORCH_VERSION="main" # main=2.1.2, alt=1.12.1 (use alt for older GLIBC)
# Note: alt(1.12.1) version of LibTorch cannot support DeePMD-Torch for DPA

# Note: AOCC-AOCL toolchain uses AOCL for math libraries (FFTW, ScaLAPACK)
# so OpenBLAS and ScaLAPACK version selections are not applicable
Expand Down
2 changes: 2 additions & 0 deletions toolchain/toolchain_gcc-aocl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ CMAKE_VERSION="main" # main=3.31.7, alt=3.30.5
OPENMPI_VERSION="main" # main=5.0.8, alt=4.1.6
ELPA_VERSION="main" # main=2025.06.001, alt=2024.05.001
LIBXC_VERSION="main" # main=7.0.0, alt=6.2.2
# Optional Libraries
LIBTORCH_VERSION="main" # main=2.1.2, alt=1.12.1 (use alt for older GLIBC)
# Note: alt(1.12.1) version of LibTorch cannot support DeePMD-Torch for DPA

# Note: GCC-AOCL toolchain uses AOCL for math libraries (FFTW, ScaLAPACK)
# so OpenBLAS and ScaLAPACK version selections are not applicable
Expand Down
1 change: 1 addition & 0 deletions toolchain/toolchain_gnu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ LIBXC_VERSION="main" # main=7.0.0, alt=6.2.2
SCALAPACK_VERSION="main" # main=2.2.2, alt=2.2.1
# Optional Libraries
LIBTORCH_VERSION="main" # main=2.1.2, alt=1.12.1 (use alt for older GLIBC)
# Note: alt(1.12.1) version of LibTorch cannot support DeePMD-Torch for DPA

# ============================================================================
# Execute Installation (DO NOT MODIFY BELOW THIS LINE)
Expand Down
2 changes: 2 additions & 0 deletions toolchain/toolchain_intel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ INTELMPI_CLASSIC="no" # Set to "yes" to use classic Intel MPI wrappers (mpiicc
CMAKE_VERSION="main" # main=3.31.7, alt=3.30.5
ELPA_VERSION="alt" # main=2025.06.001, alt=2024.05.001 for intel oneapi<2024.2
LIBXC_VERSION="main" # main=7.0.0, alt=6.2.2
# Optional Libraries
LIBTORCH_VERSION="main" # main=2.1.2, alt=1.12.1 (use alt for older GLIBC)
# Note: alt(1.12.1) version of LibTorch cannot support DeePMD-Torch for DPA

# Note: Intel toolchain uses MKL for math libraries (FFTW, ScaLAPACK)
# so OpenBLAS, FFTW, and ScaLAPACK version selections are not applicable
Expand Down
Loading