From f4bd8eca222cbff574c0a3c20168ca9bc726adcd Mon Sep 17 00:00:00 2001 From: Growl Date: Sat, 28 Mar 2026 02:31:24 +0800 Subject: [PATCH] Apply outside "-ef/-df" logic --- make_cp2k.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/make_cp2k.sh b/make_cp2k.sh index bb7e3c51e0..3328f1125a 100755 --- a/make_cp2k.sh +++ b/make_cp2k.sh @@ -300,7 +300,7 @@ while [[ $# -gt 0 ]]; do ace) SED_PATTERN_LIST+=" -e '/\s*-\s+\"p${2,,}@/ ${SUBST}" ;; - cosma | dftd4 | elpa | greenx | hdf5 | libsmeagol | libxc | pexsi | plumed | spglib | trexio) + cosma | dftd4 | elpa | greenx | hdf5 | libsmeagol | libxc | pexsi | plumed | spglib | tblite | trexio) SED_PATTERN_LIST+=" -e '/\s*-\s+\"${2,,}@/ ${SUBST}" ;; deepmd | libtorch) @@ -334,13 +334,6 @@ while [[ $# -gt 0 ]]; do vori) SED_PATTERN_LIST+=" -e '/\s*-\s+\"lib${2,,}@/ ${SUBST}" ;; - tblite) - SED_PATTERN_LIST+=" -e '/\s*-\s+\"${2,,}@/ ${SUBST}" - if [[ "${ON_OFF}" == "ON" ]]; then - echo "INFO: Enabling tblite. Automatically disabling standalone dftd4 to avoid potential conflicts." - SED_PATTERN_LIST+=" -e '/\s*-\s+\"dftd4@/ s/^ /#/'" - fi - ;; esac ;; libvdwxc | spfft | spla | sirius) @@ -754,6 +747,15 @@ case "${MPI_MODE}" in ;; esac +# Check if dftd4 and tblite are enabled at the same time; if so, install tblite only +if [[ "${CMAKE_FEATURE_FLAGS}" != *"-DCP2K_USE_TBLITE=OFF"* ]]; then + if [[ "${CMAKE_FEATURE_FLAG_ALL}" == *"-DCP2K_USE_EVERYTHING=ON"* ]] || + [[ "${CMAKE_FEATURE_FLAGS}" == *"-DCP2K_USE_TBLITE=ON"* ]]; then + echo "INFO: Prioritizing tblite. Automatically disabling dftd4 to avoid conflicts." + SED_PATTERN_LIST+=" -e '/\s*-\s+\"dftd4@/ s/^ /#/'" + fi +fi + # Check if CP2K_VERSION and the selected features are compatible case "${CP2K_VERSION}" in ssmp | ssmp-static)