Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

customize for experiments #52

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions bin/make_spack
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ clone_repos() {
$dir/var/spack/extensions/spack-subspack main https://github.com/marcmengel/spack-subspack.git
$dir/var/spack/repos/fnal_art develop https://github.com/FNALssi/fnal_art.git
$dir/var/spack/repos/scd_recipes master https://github.com/marcmengel/scd_recipes.git
$dir/var/spack/repos/nusofthep-spack-recipes main https://github.com/NuSoftHEP/nusofthep-spack-recipes.git
$dir/var/spack/repos/larsoft-spack-recipes main https://github.com/LArSoft/larsoft-spack-recipes.git
$dir/var/spack/repos/artdaq-spack develop https://github.com/art-daq/artdaq-spack.git
EOF
if [ "$customize" == "larsoft" ]; then
git clone -b main --depth $depth https://github.com/NuSoftHEP/nusofthep-spack-recipes.git $dir/var/spack/repos/nusofthep-spack-recipes
git clone -b main --depth $depth https://github.com/LArSoft/larsoft-spack-recipes.git $dir/var/spack/repos/larsoft-spack-recipes
elif [ "$customize" == "mu2e" ]; then
git clone -b main --depth $depth https://github.com/Mu2e/mu2e-spack.git $dir/var/spack/repos/mu2e-spack
fi
}


Expand Down Expand Up @@ -73,6 +77,12 @@ query_packages() {
fi
}

do_customize() {
if [ "$customize" == "mu2e" ]; then
echo " mu2e: https://spack-cache-1.fnal.gov/binaries/mu2e" >> $dir/etc/spack/linux/mirrors.yaml
fi
}

usage() {
echo "Usage: $0 [options] -[utp] /base/directory"
echo " options:"
Expand All @@ -83,6 +93,7 @@ usage() {
echo " --spack_repo url"
echo " --depth n"
echo " --minimal"
echo " --customize variant_name"
echo " --verbose"
echo " -u fermi 'unified' layout (deprecated)"
echo " -t fermi 'traditional' layout (deprecated)"
Expand All @@ -105,6 +116,7 @@ parse_args() {
spack_release=$(get_from_bootstrap default_spack_version)
use_buildcache=true
minimal=false
customize=larsoft
upgrading=false
padding=false
layout=unified
Expand All @@ -114,7 +126,7 @@ parse_args() {
depth=1

origargs="$*"
if x=$(getopt --longoptions help,depth,with_padding,upgrade,spack_release:,minimal,no_buildcache,repover,spack_repo:,query-packages,verbose --options mptuv -- "$@")
if x=$(getopt --longoptions help,depth,with_padding,upgrade,spack_release:,minimal,customize:,no_buildcache,repover,spack_repo:,query-packages,verbose --options mptuv -- "$@")
then
eval set : $x
shift
Expand All @@ -131,6 +143,7 @@ parse_args() {
x--spack_release) spack_release=$2; shift; shift ;;
x--spack_repo) spack_repo=$2; shift; shift;;
x--minimal) minimal=true; shift ;;
x--customize) customize=$2; shift; shift ;;
x--query-packages) query_packages=true; shift ;;
x--help) usage; exit;;
x--no_buildcache) use_buildcache=false; shift;;
Expand Down Expand Up @@ -173,6 +186,7 @@ main() {
clone_repos
add_fermi_setups
do_padding
do_customize
do_spack_bootstrap
query_packages
}
Expand Down
4 changes: 2 additions & 2 deletions bin/make_subspack
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ fi
os=`$SPACK_ROOT/bin/spack arch --operating-system`

message "installing packages.yaml"
test -d $SPACK_ROOT/etc/spack/${os} || mkdir $SPACK_ROOT/etc/spack/${os}
cp $src/etc/spack/${os}/packages.yaml $SPACK_ROOT/etc/spack/${os}/packages.yaml
test -d $SPACK_ROOT/etc/spack/linux/${os} || mkdir -p $SPACK_ROOT/etc/spack/linux/${os}
cp $src/etc/spack/linux/${os}/packages.yaml $SPACK_ROOT/etc/spack/linux/${os}/packages.yaml


message "installing upstreams.yaml..."
Expand Down