All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
install_sbncode-v08_30_00.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 ###############################################################################
4 # Set up the environment and install sbncode on a GPVM
5 #
6 # A. Mastbaum <mastbaum@uchicago.edu>, 2018/06/12
7 ###############################################################################
8 
9 # Check we're in a good location
10 #ALLOWED="/sbnd/app/users/${USER}"
11 #if [[ ${PWD} != *"${ALLOWED}"* ]]; then
12 # echo "Please move to a location inside ${ALLOWED}."
13 # exit
14 #fi
15 
16 if [ $# -eq 0 ]; then
17  LAR_VERSION="v08_30_00"
18  LAR_QUAL="e17:prof"
19 else
20  LAR_VERSION=$1
21  LAR_QUAL=$2
22 fi
23 
24 if [ -z "$LAR_VERSION" ] || [ -z "$LAR_QUAL" ]; then
25  echo "Invalid LArSoft version: $LAR_VERSION -q $LAR_QUAL"
26  exit 1
27 else
28  echo "Using LArSoft version: $LAR_VERSION -q $LAR_QUAL"
29 fi
30 
31 # Set up the environment
32 TOPDIR=${PWD}
33 cat << EOF > ${TOPDIR}/setup_sbncode-${LAR_VERSION}.sh
34 source /cvmfs/uboone.opensciencegrid.org/products/setup_uboone.sh
35 setup uboonecode ${LAR_VERSION} -q ${LAR_QUAL}
36 source /cvmfs/sbnd.opensciencegrid.org/products/sbnd/setup_sbnd.sh
37 setup sbndcode ${LAR_VERSION} -q ${LAR_QUAL}
38 unsetup larbatch
39 source /cvmfs/icarus.opensciencegrid.org/products/icarus/setup_icarus.sh
40 setup icaruscode ${LAR_VERSION} -q ${LAR_QUAL}
41 EOF
42 
43 source ./setup_sbncode-${LAR_VERSION}.sh
44 
45 # Create working area
46 WDIR="${PWD}/sbncode-${LAR_VERSION}"
47 mkdir $WDIR
48 
49 if [ $? -ne 0 ]; then
50  echo "Unable to create directory ${WDIR}"
51  exit
52 fi
53 
54 cd ${WDIR}
55 mrb newDev -v ${LAR_VERSION} -q ${LAR_QUAL}
56 LAR_QUAL_STR=${LAR_QUAL//:/_}
57 MRB_SETUP=${WDIR}/localProducts_larsoft_${LAR_VERSION}_${LAR_QUAL_STR}/setup
58 source ${MRB_SETUP}
59 
60 # Get sbncode
61 cd srcs
62 mrb gitCheckout -t ${LAR_VERSION} sbncode
63 
64 #mrb gitCheckout -t master sbncode
65 #echo "Bailing early..."
66 #exit
67 
68 # Build sbncode
69 mrbsetenv
70 mrb i -j4
71 
72 cat << EOF >> ${TOPDIR}/setup_sbncode-${LAR_VERSION}.sh
73 source ${MRB_SETUP}
74 mrbslp
75 mrbsetenv
76 EOF
77 
78 # Build sbnanalysis
79 cd ${WDIR}/srcs/sbncode/sbnanalysis
80 mkdir build
81 cd build
82 cmake .. -DCMAKE_BUILD_TYPE=Debug
83 make install -j4
84 source bin/setup_sbnanalysis.sh
85 
86 echo "source ${PWD}/bin/setup_sbnanalysis.sh" >> ${TOPDIR}/setup_sbncode-${LAR_VERSION}.sh
87 
88 echo -e "Setup finished. To use this environment, run\n\n source setup_sbncode-${LAR_VERSION}.sh"
89 
process_name opflash particleana ie ie ie z
then source grid fermiapp products dune setup_dune_fermiapp sh exit else echo No setup file found exit fi setup
process_name uboone
do source
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
then shift fi
do cd
do i e
stream1 can override from command line with o or output services user sbnd