Skip to content

Commit fe49ac8

Browse files
authored
Merge branch 'develop' into refactor/hegvd_op
2 parents 915cc10 + e43b1cd commit fe49ac8

File tree

11 files changed

+41
-37
lines changed

11 files changed

+41
-37
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ __pycache__
2323
abacus.json
2424
*.npy
2525
toolchain/install/
26-
toolchain/abacus_env.sh
26+
toolchain/abacus_env.sh
27+
.trae

toolchain/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,21 +151,21 @@ Mix online and offline packages as needed - the toolchain automatically detects
151151
## Supported Toolchains
152152

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

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

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

170170
## Dependencies
171171

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

198198
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.
199199

toolchain/install_abacus_toolchain.sh

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,11 @@
11
#!/bin/bash -e
22

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

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

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

toolchain/install_abacus_toolchain_new.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
#!/bin/bash -e
22

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

1514
# Set script name for error reporting

toolchain/scripts/lib/user_interface.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,15 @@ ui_show_summary() {
690690
echo " ├─ Kernel: $(uname -r)"
691691
echo " ├─ glibc: $(ui_get_glibc_version)"
692692
echo " ├─ CPU Cores: $(nproc 2>/dev/null || echo "unknown")"
693+
# CPU model detection
694+
local cpu_model="unknown"
695+
if command -v lscpu &> /dev/null; then
696+
cpu_model=$(LC_ALL=C lscpu | awk -F: '/^Model name/{print $2}' | sed 's/^[[:space:]]*//')
697+
fi
698+
if [[ -z "$cpu_model" || "$cpu_model" == "unknown" ]] && [[ -r /proc/cpuinfo ]]; then
699+
cpu_model=$(awk -F: '/model name|Hardware|Processor/{print $2; exit}' /proc/cpuinfo | sed 's/^[[:space:]]*//')
700+
fi
701+
echo " ├─ CPU Model: ${cpu_model}"
693702
if command -v free &> /dev/null; then
694703
local mem_gb=$(free -g | awk '/^Mem:/ {print $2}')
695704
echo " ├─ Memory: ${mem_gb}GB"

toolchain/scripts/stage2/install_aocl.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ export AOCL_ROOT="${pkg_install_dir}"
8080
export AOCL_CFLAGS="${AOCL_CFLAGS}"
8181
export AOCL_LDFLAGS="${AOCL_LDFLAGS}"
8282
export AOCL_LIBS="${AOCL_LIBS}"
83-
export FAST_MATH_CFLAGS="\${FAST_MATH_CFLAGS} ${AOCL_CFLAGS}"
84-
export FAST_MATH_LDFLAGS="\${FAST_MATH_LDFLAGS} ${AOCL_LDFLAGS}"
85-
export FAST_MATH_LIBS="\${FAST_MATH_LIBS} ${AOCL_LIBS}"
83+
export MATH_CFLAGS="\${MATH_CFLAGS} ${AOCL_CFLAGS}"
84+
export MATH_LDFLAGS="\${MATH_LDFLAGS} ${AOCL_LDFLAGS}"
85+
export MATH_LIBS="\${MATH_LIBS} ${AOCL_LIBS}"
8686
EOF
8787
fi
8888

toolchain/scripts/tool_kit.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,7 @@ download_pkg_from_url() {
956956
"strict")
957957
echo "Downloading with strict certificate validation: $__url"
958958
if ! wget ${DOWNLOADER_FLAGS} "$__url" -O "$__filename"; then
959+
rm -f "$__filename"
959960
report_error "failed to download $__url (strict certificate validation)"
960961
recommend_offline_installation "$__filename" "$__url"
961962
if [ "${PACK_RUN}" != "__TRUE__" ]; then
@@ -966,6 +967,7 @@ download_pkg_from_url() {
966967
"skip")
967968
echo "Downloading with certificate validation disabled: $__url"
968969
if ! wget ${DOWNLOADER_FLAGS} "$__url" -O "$__filename" --no-check-certificate; then
970+
rm -f "$__filename"
969971
report_error "failed to download $__url"
970972
recommend_offline_installation "$__filename" "$__url"
971973
if [ "${PACK_RUN}" != "__TRUE__" ]; then
@@ -981,6 +983,7 @@ download_pkg_from_url() {
981983
else
982984
echo "Certificate validation failed, retrying without certificate check..."
983985
if ! wget ${DOWNLOADER_FLAGS} "$__url" -O "$__filename" --no-check-certificate; then
986+
rm -f "$__filename"
984987
report_error "failed to download $__url (both secure and insecure attempts failed)"
985988
recommend_offline_installation "$__filename" "$__url"
986989
if [ "${PACK_RUN}" != "__TRUE__" ]; then

toolchain/toolchain_aocc-aocl.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ WITH_RAPIDJSON="install"
3939
WITH_LIBRI="install"
4040
WITH_LIBCOMM="install"
4141

42-
# Optional Features (DeepKS support)
43-
WITH_LIBTORCH="no" # Set to "install" for DeepKS support
44-
WITH_LIBNPY="no" # Set to "install" for DeepKS support
42+
# Optional Features (MLALGO support)
43+
WITH_LIBTORCH="no"
44+
WITH_LIBNPY="no"
4545
WITH_NEP="no"
4646

4747
# AMD Compiler Options
@@ -71,7 +71,10 @@ CMAKE_VERSION="main" # main=3.31.7, alt=3.30.5
7171
OPENMPI_VERSION="main" # main=5.0.8, alt=4.1.6
7272
ELPA_VERSION="main" # main=2025.06.001, alt=2024.05.001
7373
LIBXC_VERSION="main" # main=7.0.0, alt=6.2.2
74+
# Optional Libraries
7475
LIBTORCH_VERSION="main" # main=2.1.2, alt=1.12.1 (use alt for older GLIBC)
76+
# Note: main(2.1.2) version of LibTorch need glibc > 2.27
77+
# Note: alt(1.12.1) version of LibTorch cannot support DeePMD-Torch for DPA
7578

7679
# Note: AOCC-AOCL toolchain uses AOCL for math libraries (FFTW, ScaLAPACK)
7780
# so OpenBLAS and ScaLAPACK version selections are not applicable

toolchain/toolchain_gcc-aocl.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ CMAKE_VERSION="main" # main=3.31.7, alt=3.30.5
6868
OPENMPI_VERSION="main" # main=5.0.8, alt=4.1.6
6969
ELPA_VERSION="main" # main=2025.06.001, alt=2024.05.001
7070
LIBXC_VERSION="main" # main=7.0.0, alt=6.2.2
71+
# Optional Libraries
7172
LIBTORCH_VERSION="main" # main=2.1.2, alt=1.12.1 (use alt for older GLIBC)
73+
# Note: main(2.1.2) version of LibTorch need glibc > 2.27
74+
# Note: alt(1.12.1) version of LibTorch cannot support DeePMD-Torch for DPA
7275

7376
# Note: GCC-AOCL toolchain uses AOCL for math libraries (FFTW, ScaLAPACK)
7477
# so OpenBLAS and ScaLAPACK version selections are not applicable

toolchain/toolchain_gnu.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ LIBXC_VERSION="main" # main=7.0.0, alt=6.2.2
7272
SCALAPACK_VERSION="main" # main=2.2.2, alt=2.2.1
7373
# Optional Libraries
7474
LIBTORCH_VERSION="main" # main=2.1.2, alt=1.12.1 (use alt for older GLIBC)
75+
# Note: main(2.1.2) version of LibTorch need glibc > 2.27
76+
# Note: alt(1.12.1) version of LibTorch cannot support DeePMD-Torch for DPA
7577

7678
# ============================================================================
7779
# Execute Installation (DO NOT MODIFY BELOW THIS LINE)

0 commit comments

Comments
 (0)