Toolchain: Use "filter_setup" functional for a cleaner setup file#7319
Open
Growl1234 wants to merge 2 commits intodeepmodeling:developfrom
Open
Toolchain: Use "filter_setup" functional for a cleaner setup file#7319Growl1234 wants to merge 2 commits intodeepmodeling:developfrom
Growl1234 wants to merge 2 commits intodeepmodeling:developfrom
Conversation
There was a problem hiding this comment.
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()intool_kit.shand switched many stage install scripts fromcat setup_* >> $SETUPFILEtofilter_setup setup_* $SETUPFILE. - Removed several
*_CFLAGS/*_LDFLAGS/*_LIBSexports from somesetup_*files (since they’re no longer intended to be written intoinstall/setup). - Updated ELPA setup generation to use
/cpuand optional/nvidiasubpaths (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.
f1d4fdd to
6125b45
Compare
Otherwise ELPA_ROOT would be wrong when toolchain is executed again
QuantumMisaka
approved these changes
May 7, 2026
Collaborator
QuantumMisaka
left a comment
There was a problem hiding this comment.
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.
4 tasks
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.envanyways.Also revises ELPA installation in toolchain.