Toolchain: Remove redundant exporting variables#7230
Toolchain: Remove redundant exporting variables#7230Growl1234 wants to merge 5 commits intodeepmodeling:developfrom
Conversation
There was a problem hiding this comment.
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 viaprepend_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_ROOTis 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.
46f60c8 to
a180b61
Compare
|
Thanks for your PR! I'll have some quick tests |
|
There is a problem during my quick test for Do you encounter the same problem ? |
|
I'll have a look, but I haven't encountered this problem before.
Update: This should now be resolved. It's my fault forgetting to remove the trailing `:${PATH}`, but it also seems the sed command in `remove_path` function is not that robust.
|
fca9a25 to
867bcaf
Compare
|
@Growl1234 Please link your issue in your PR introduction. |
-DCMAKE_POLICY_VERSION_MINIMUM=3.5flag to libXC installing script, and update ScaLAPACK to version 2.2.3.Resolves #7226.