From fa59b1c6f2df95b7485de105115307dadcc68e7a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 12 Jun 2025 22:05:43 -0400 Subject: [PATCH] correct and simplify install script for legacy build system --- src/APIP/Install.sh | 49 +++++++----------------------------------- src/ML-PACE/Install.sh | 19 +++++----------- 2 files changed, 13 insertions(+), 55 deletions(-) diff --git a/src/APIP/Install.sh b/src/APIP/Install.sh index fc47926882..78fe1eb0d5 100644 --- a/src/APIP/Install.sh +++ b/src/APIP/Install.sh @@ -26,48 +26,15 @@ action () { fi } -# all package files with no dependencies - -for file in *.cpp *.h; do - test -f ${file} && action $file -done - - -# edit 2 Makefile.package files to include/exclude package info +# some styles in APIP have depend on the ML-PACE package if (test $1 = 1) then - - if (test -e ../Makefile.package) then - sed -i -e 's/[^ \t]*pace[^ \t]* //' ../Makefile.package - sed -i -e 's|^PKG_SYSINC =[ \t]*|&$(pace_SYSINC) |' ../Makefile.package - sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(pace_SYSLIB) |' ../Makefile.package - sed -i -e 's|^PKG_SYSPATH =[ \t]*|&$(pace_SYSPATH) |' ../Makefile.package + if (test ! -e ../pair_pace.cpp) then + echo "Must install ML-PACE package with APIP package" + exit 1 fi - - if (test -e ../Makefile.package.settings) then - sed -i -e '/^[ \t]*include.*pace.*$/d' ../Makefile.package.settings - # multiline form needed for BSD sed on Macs - sed -i -e '4 i \ -include ..\/..\/lib\/pace\/Makefile.lammps -' ../Makefile.package.settings - fi - -elif (test $1 = 0) then - - # The ML-PACE package depends also on the pace library. - # Remove in Makefiles only if there are no remaining includes from ML-PACE. - # grep searches also in kspace.cpp and thus returns no error. - if (test $(grep '#include "ace' ../*pace*.cpp | wc -l) = 0) then - - # update Makefiles - if (test -e ../Makefile.package) then - sed -i -e 's/[^ \t]*pace[^ \t]* //' ../Makefile.package - fi - - if (test -e ../Makefile.package.settings) then - sed -i -e '/^[ \t]*include.*pace.*$/d' ../Makefile.package.settings - fi - - fi - fi + +for file in *.cpp *.h; do + action ${file} +done diff --git a/src/ML-PACE/Install.sh b/src/ML-PACE/Install.sh index d86841da03..c0a0958424 100644 --- a/src/ML-PACE/Install.sh +++ b/src/ML-PACE/Install.sh @@ -32,7 +32,6 @@ for file in *.cpp *.h; do test -f ${file} && action $file done - # edit 2 Makefile.package files to include/exclude package info if (test $1 = 1) then @@ -54,20 +53,12 @@ include ..\/..\/lib\/pace\/Makefile.lammps elif (test $1 = 0) then - # The APIP package depends also on the pace library. - # Remove in Makefiles only if there are no remaining includes from APIP. - # grep searches also in kspace.cpp and thus returns no error. - if (test $(grep '#include "ace' ../*pace*.cpp | wc -l) = 0) then - - # update Makefiles - if (test -e ../Makefile.package) then - sed -i -e 's/[^ \t]*pace[^ \t]* //' ../Makefile.package - fi - - if (test -e ../Makefile.package.settings) then - sed -i -e '/^[ \t]*include.*pace.*$/d' ../Makefile.package.settings - fi + if (test -e ../Makefile.package) then + sed -i -e 's/[^ \t]*pace[^ \t]* //' ../Makefile.package + fi + if (test -e ../Makefile.package.settings) then + sed -i -e '/^[ \t]*include.*pace.*$/d' ../Makefile.package.settings fi fi