Skip to content

Commit

Permalink
Merge pull request #48 from FNALssi/new_make_spack
Browse files Browse the repository at this point in the history
New make spack
  • Loading branch information
knoepfel authored Aug 22, 2024
2 parents 7d50a6a + c817d1d commit 0662b6f
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 292 deletions.
32 changes: 24 additions & 8 deletions bin/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ parse_args() {
x--) shift; break;;
esac
done
dest=${1:-$PWD}
dest=${1:-$PWD/spack}
if [ -d $dest ]
then
echo "FAIL: Destination directory $d already exists. " >&2
exit 1
fi
}

detail_log() {
Expand Down Expand Up @@ -96,7 +101,7 @@ stop_monitor() {
message() {
stop_monitor
echo $* >&3
start_monitor $logfile 458
start_monitor $logfile 255
}

check_bootstrap() {
Expand All @@ -113,25 +118,36 @@ main() {
parse_args "$@"

detail_log
mkdir -p $dest/fermi-spack-tools/$ver
mkdir -p $dest
cd $dest



message "Cloning FNALssi fermi-spack-tools repository"
git clone -b $ver $fermi_spack_tools_repo fermi-spack-tools/$ver/NULL/
fst=/tmp/fst$$
git clone -b $ver $fermi_spack_tools_repo $fst

PATH=$dest/fermi-spack-tools/$ver/NULL/bin:$PATH
PATH=$fst/bin:$PATH

message "Setting up with make_spack"
make_spack --verbose $query_packages --spack_release $spack_version --spack_repo $spack_repo $with_padding --minimal -u $dest
sh -x $fst/bin/make_spack --verbose $query_packages --spack_release $spack_version --spack_repo $spack_repo $with_padding --minimal -u $dest

message "Setting up new instance"

message "Finding compilers"
source $dest/setup-env.sh

message "Finding compilers"

spack compiler find --scope=site

cd $dest/fermi-spack-tools/$ver/NULL && bin/declare_simple fermi-spack-tools $ver
message "installing fermi-spack-tools..."
pyspec=$(spack config get packages | grep python | grep spec: | sed -e 's/ - spec://')
spack install fermi-spack-tools ^$pyspec

check_bootstrap

# cleanup
rm -rf $fst &
}

main "$@"
Expand Down
Loading

0 comments on commit 0662b6f

Please sign in to comment.