Skip to content

Toolchain: Remove redundant exporting variables#7230

Open
Growl1234 wants to merge 5 commits intodeepmodeling:developfrom
Growl1234:toolchain
Open

Toolchain: Remove redundant exporting variables#7230
Growl1234 wants to merge 5 commits intodeepmodeling:developfrom
Growl1234:toolchain

Conversation

@Growl1234
Copy link
Copy Markdown

@Growl1234 Growl1234 commented Apr 10, 2026

  • Remove redundant exporting variables
  • For CMake 4.x compatibility: Add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 flag to libXC installing script, and update ScaLAPACK to version 2.2.3.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR streamlines the ABACUS toolchain install scripts by reducing redundant environment-variable exports in generated setup_* files (relying more consistently on prepend_path), while also updating some package configuration details (e.g., ScaLAPACK versions and a LibXC CMake option).

Changes:

  • Remove redundant export ...="$dir:$VAR" patterns in multiple install scripts and standardize variable expansion/quoting.
  • Adjust how toolchain setup files populate CPATH, CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and library paths via prepend_path.
  • Update ScaLAPACK main/alt versions (and checksums) in centralized package version management.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
toolchain/scripts/stage4/install_rapidjson.sh Simplifies setup generation (use prepend_path + consolidated exports) and standardizes quoting.
toolchain/scripts/stage4/install_nep.sh Removes redundant exports in generated setup file; keeps root/flags exports.
toolchain/scripts/stage4/install_libtorch.sh Removes redundant exports in setup generation (but currently impacts CPU include path setup).
toolchain/scripts/stage4/install_libri.sh Simplifies CPATH setup and standardizes quoting.
toolchain/scripts/stage4/install_libnpy.sh Simplifies CPATH setup and standardizes quoting.
toolchain/scripts/stage4/install_libcomm.sh Simplifies CPATH setup and standardizes quoting.
toolchain/scripts/stage4/install_cereal.sh Simplifies setup generation and adjusts CMake prefix handling.
toolchain/scripts/stage3/install_scalapack.sh Removes redundant exports from path-setup block; keeps root/flags exports.
toolchain/scripts/stage3/install_libxc.sh Simplifies setup generation and adds a CMake policy minimum option.
toolchain/scripts/stage3/install_fftw.sh Removes redundant exports in setup generation.
toolchain/scripts/stage3/install_elpa.sh Removes redundant exports in setup generation and consolidates ELPA_ROOT export.
toolchain/scripts/stage2/install_openblas.sh Removes redundant exports in one block; still sets/uses pkg-config/cmake prefix paths in setup.
toolchain/scripts/stage2/install_aocl.sh Drops previously generated path-prepend setup block; keeps AOCL flags/root exports.
toolchain/scripts/stage1/install_openmpi.sh Removes redundant exports and attempts to switch to prepend_path for env setup.
toolchain/scripts/stage1/install_mpich.sh Removes redundant exports and attempts to switch to prepend_path for env setup.
toolchain/scripts/stage1/install_intelmpi.sh Removes non-system PATH/lib/include prepend block; keeps wrapper/flags exports.
toolchain/scripts/stage0/install_intel.sh Removes redundant path-prepend block; keeps compiler/flags exports.
toolchain/scripts/stage0/install_gcc.sh Removes redundant exports in generated setup file; keeps prepend-based env setup.
toolchain/scripts/stage0/install_cmake.sh Removes redundant PATH export and relies on prepend_path.
toolchain/scripts/stage0/install_amd.sh Removes redundant path-prepend block; keeps compiler/flags exports.
toolchain/scripts/package_versions.sh Bumps ScaLAPACK versions/checksums in centralized version list.
Comments suppressed due to low confidence (1)

toolchain/scripts/stage3/install_scalapack.sh:130

  • SCALAPACK_ROOT is exported twice in the generated setup file. This is redundant and makes future edits error-prone; keep a single export (preferably once in the common export block).
    cat << EOF >> "${BUILDDIR}/setup_scalapack"
export SCALAPACK_ROOT="${pkg_install_dir}"
export SCALAPACK_LDFLAGS="${SCALAPACK_LDFLAGS}"
export SCALAPACK_LIBS="${SCALAPACK_LIBS}"
export SCALAPACK_ROOT="${pkg_install_dir}"
export CP_DFLAGS="\${CP_DFLAGS} IF_MPI(-D__SCALAPACK|)"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Growl1234 Growl1234 force-pushed the toolchain branch 5 times, most recently from 46f60c8 to a180b61 Compare April 10, 2026 04:37
@QuantumMisaka QuantumMisaka self-requested a review April 10, 2026 13:16
@QuantumMisaka
Copy link
Copy Markdown
Collaborator

Thanks for your PR! I'll have some quick tests

@QuantumMisaka
Copy link
Copy Markdown
Collaborator

There is a problem during my quick test for gnu toolchain in my WSL environment

🖥️  System Information:
   ├─ OS: Linux x86_64
   ├─ Kernel: 6.6.87.2-microsoft-standard-WSL2
   ├─ glibc: 2.35
   ├─ CPU Cores: 32
   ├─ CPU Model: AMD Ryzen 9 3950X 16-Core Processor
   ├─ Memory: 31GB
   └─ GPU: NVIDIA GeForce RTX 2070 SUPER

⚙️  Build Configuration:
   ├─ MPI Mode:       openmpi
   ├─ Math Mode:      openblas
   ├─ Target CPU:     native
   ├─ GPU Version:    no
   └─ Parallel Jobs:  32

...


==================== Finding GCC from system paths ====================
path to gcc is /usr/bin/gcc
path to g++ is /usr/bin/g++
path to gfortran is /usr/bin/gfortran
Found include directory /usr/include
Step gcc took 0.00 seconds.
Step intel took 0.00 seconds.
Step amd took 0.00 seconds.
==================== Getting proc arch info using OpenBLAS tools ====================
OpenBLAS-0.3.30.tar.gz is found
OpenBLAS detected LIBCORE = zen
OpenBLAS detected ARCH    = x86_64
==================== Installing CMake ====================
cmake-3.31.7 is already installed, skipping it.
Step cmake took 0.00 seconds.

────────────────────────────────────────────────────────────
[*] Stage 1: MPI Implementations
────────────────────────────────────────────────────────────

[^] Installing packages for stage 1...
==================== Installing OpenMPI ====================
openmpi-5.0.8 is already installed, skipping it.
Found directory /home/james/toys/abacus/abacus-develop/toolchain/install/openmpi-5.0.8/bin
Found directory /home/james/toys/abacus/abacus-develop/toolchain/install/openmpi-5.0.8/lib
Found directory /home/james/toys/abacus/abacus-develop/toolchain/install/openmpi-5.0.8/include
mpiexec is installed as /home/james/toys/abacus/abacus-develop/toolchain/install/openmpi-5.0.8/bin/mpiexec
mpicc is installed as /home/james/toys/abacus/abacus-develop/toolchain/install/openmpi-5.0.8/bin/mpicc
mpicxx is installed as /home/james/toys/abacus/abacus-develop/toolchain/install/openmpi-5.0.8/bin/mpicxx
mpifort is installed as /home/james/toys/abacus/abacus-develop/toolchain/install/openmpi-5.0.8/bin/mpifort
sed: -e expression #1, char 81: unknown option to `s'

Do you encounter the same problem ?

@Growl1234
Copy link
Copy Markdown
Author

Growl1234 commented Apr 10, 2026 via email

@Growl1234 Growl1234 force-pushed the toolchain branch 4 times, most recently from fca9a25 to 867bcaf Compare April 10, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants