-
Notifications
You must be signed in to change notification settings - Fork 2.4k
use spack find from bash to check if a spec is installed #8033
Copy link
Copy link
Closed
Labels
Description
I have a bash script which goes through a set of sepcs, installs them and runs tests. Key parts are:
spack install --keep-stage "$s"
spack cd -s "$s"
cd <build-folder>
spack env "$s" bash << EOF
ctest <parameters>
EOF
I would like to improve this by not re-installing the spec, but rather check if it's installed already, and if so, in the stage I kept outside of system temporary directories I would just do git pull to update the sources and make all -j8 to re-build.
spack find <spec> is the candidate, but I don't think it returns an error code to the bash.
Ideally it should be something like
spec_installed = <something-with-spack-find>
if [ "${spec_installed}" == "1" ]; then
git pull
make all
else
spack install --keep-stage "$s"$
fi
Anyone tried to do something similar with bash?
Reactions are currently unavailable