Skip to content

Toolchain: Use "filter_setup" functional for a cleaner setup file#7319

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

Toolchain: Use "filter_setup" functional for a cleaner setup file#7319
Growl1234 wants to merge 2 commits intodeepmodeling:developfrom
Growl1234:toolchain

Conversation

@Growl1234
Copy link
Copy Markdown

@Growl1234 Growl1234 commented May 7, 2026

note: The flags are not directly deleted in case some other packages in toolchain need some of them since they are written into install/toolchain.env anyways.

Also revises ELPA installation in toolchain.

Copilot AI review requested due to automatic review settings May 7, 2026 09:01
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 introduces a shared filter_setup helper to generate a cleaner install/setup by appending only the “runtime/use” environment (e.g., *_ROOT and prepend_path lines) and filtering out build flags and other noisy variables from individual setup_* snippets.

Changes:

  • Added filter_setup() in tool_kit.sh and switched many stage install scripts from cat setup_* >> $SETUPFILE to filter_setup setup_* $SETUPFILE.
  • Removed several *_CFLAGS/*_LDFLAGS/*_LIBS exports from some setup_* files (since they’re no longer intended to be written into install/setup).
  • Updated ELPA setup generation to use /cpu and optional /nvidia subpaths (but this currently conflicts with the actual install prefix logic).

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
toolchain/scripts/tool_kit.sh Adds filter_setup() that appends filtered setup content into the global install/setup.
toolchain/scripts/stage4/install_rapidjson.sh Uses filter_setup and removes flag exports from setup_rapidjson.
toolchain/scripts/stage4/install_nep.sh Uses filter_setup and drops NEP flag exports from setup_nep.
toolchain/scripts/stage4/install_libtorch.sh Refactors setup_libtorch writing and appends via filter_setup.
toolchain/scripts/stage4/install_libri.sh Uses filter_setup and removes LIBRI_CFLAGS export from setup_libri.
toolchain/scripts/stage4/install_libnpy.sh Uses filter_setup and removes LIBNPY_CFLAGS export from setup_libnpy.
toolchain/scripts/stage4/install_libcomm.sh Uses filter_setup and removes LIBCOMM_CFLAGS export from setup_libcomm.
toolchain/scripts/stage4/install_cereal.sh Uses filter_setup and removes cereal flag exports from setup_cereal.
toolchain/scripts/stage3/install_scalapack.sh Uses filter_setup instead of appending full setup_scalapack.
toolchain/scripts/stage3/install_libxc.sh Uses filter_setup instead of appending full setup_libxc.
toolchain/scripts/stage3/install_fftw.sh Uses filter_setup instead of appending full setup_fftw.
toolchain/scripts/stage3/install_elpa.sh Changes ELPA setup paths/roots and appends via filter_setup (currently inconsistent with install prefix).
toolchain/scripts/stage2/install_openblas.sh Uses filter_setup instead of appending full setup_openblas.
toolchain/scripts/stage2/install_mkl.sh Uses filter_setup instead of appending full setup_mkl.
toolchain/scripts/stage2/install_aocl.sh Uses filter_setup instead of appending full setup_aocl.
toolchain/scripts/stage1/install_openmpi.sh Uses filter_setup instead of appending full setup_openmpi.
toolchain/scripts/stage1/install_mpich.sh Uses filter_setup instead of appending full setup_mpich.
toolchain/scripts/stage1/install_intelmpi.sh Uses filter_setup instead of appending full setup_intelmpi.
toolchain/scripts/stage0/install_intel.sh Uses filter_setup instead of appending full setup_intel.
toolchain/scripts/stage0/install_gcc.sh Uses filter_setup instead of appending full setup_gcc.
toolchain/scripts/stage0/install_cmake.sh Uses filter_setup instead of appending full setup_cmake.
toolchain/scripts/stage0/install_amd.sh Uses filter_setup instead of appending full setup_amd.

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

Comment thread toolchain/scripts/tool_kit.sh
Comment thread toolchain/scripts/tool_kit.sh
Comment thread toolchain/scripts/stage3/install_elpa.sh
Comment thread toolchain/scripts/stage3/install_elpa.sh Outdated
Comment thread toolchain/scripts/stage3/install_elpa.sh
@Growl1234 Growl1234 force-pushed the toolchain branch 5 times, most recently from f1d4fdd to 6125b45 Compare May 7, 2026 09:27
@mohanchen mohanchen added the Compile & CICD & Docs & Dependencies Issues related to compiling ABACUS label May 7, 2026
Copy link
Copy Markdown
Collaborator

@QuantumMisaka QuantumMisaka left a comment

Choose a reason for hiding this comment

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

LGTM
In fact I'm also fixing the same elpa installation problem lol

QuantumMisaka added a commit to QuantumMisaka/abacus-develop that referenced this pull request May 7, 2026
Backports the setup filtering direction from deepmodeling#7319 with an LTS-specific safer filter that preserves conditional blocks. Also keeps the ELPA CPU/NVIDIA install layout discoverable for ABACUS builds and brings in the minimal MPI CXX component change from deepmodeling#7139.
QuantumMisaka added a commit to QuantumMisaka/abacus-develop that referenced this pull request May 7, 2026
Sets the Toolchain Smoke Test job shell to bash so pipefail is supported in the container. Also aligns ELPA setup generation with PR deepmodeling#7319 by avoiding if blocks in the generated setup file and appending NVIDIA paths only during setup generation when the nvidia install exists.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Compile & CICD & Docs & Dependencies Issues related to compiling ABACUS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants