All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
install_sbncode-v08_40_00_01.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_40_00"
18  LAR_QUAL="e19:prof"
19  SBN_VERSION="v08_40_00_01"
20 else
21  LAR_VERSION=$1
22  LAR_QUAL=$2
23  SBN_VERSION=$LAR_VERSION
24 fi
25 
26 if [ -z "$LAR_VERSION" ] || [ -z "$LAR_QUAL" ]; then
27  echo "Invalid LArSoft version: $LAR_VERSION -q $LAR_QUAL"
28  exit 1
29 else
30  echo "Using LArSoft version: $LAR_VERSION -q $LAR_QUAL"
31 fi
32 
33 # Set up the environment
34 TOPDIR=${PWD}
35 cat << EOF > ${TOPDIR}/setup_sbncode-${SBN_VERSION}.sh
36 source /cvmfs/uboone.opensciencegrid.org/products/setup_uboone.sh
37 setup uboonecode ${LAR_VERSION} -q ${LAR_QUAL}
38 source /cvmfs/sbnd.opensciencegrid.org/products/sbnd/setup_sbnd.sh
39 setup sbndcode ${LAR_VERSION} -q ${LAR_QUAL}
40 source /cvmfs/icarus.opensciencegrid.org/products/icarus/setup_icarus.sh
41 setup icaruscode ${LAR_VERSION} -q ${LAR_QUAL}
42 EOF
43 
44 source ./setup_sbncode-${SBN_VERSION}.sh
45 
46 # Create working area
47 WDIR="${PWD}/sbncode-${SBN_VERSION}"
48 mkdir $WDIR
49 
50 if [ $? -ne 0 ]; then
51  echo "Unable to create directory ${WDIR}"
52  exit
53 fi
54 
55 cd ${WDIR}
56 mrb newDev -v ${LAR_VERSION} -q ${LAR_QUAL}
57 LAR_QUAL_STR=${LAR_QUAL//:/_}
58 MRB_SETUP=${WDIR}/localProducts_larsoft_${LAR_VERSION}_${LAR_QUAL_STR}/setup
59 source ${MRB_SETUP}
60 
61 # Get sbncode
62 cd srcs
63 mrb gitCheckout -t ${SBN_VERSION} sbncode
64 
65 #mrb gitCheckout -t master sbncode
66 #echo "Bailing early..."
67 #exit
68 
69 # Build sbncode
70 mrbsetenv
71 mrb i -j4
72 
73 cat << EOF >> ${TOPDIR}/setup_sbncode-${SBN_VERSION}.sh
74 source ${MRB_SETUP}
75 mrbslp
76 mrbsetenv
77 EOF
78 
79 # Build sbnanalysis
80 cd ${WDIR}/srcs/sbncode/sbnanalysis
81 mkdir build
82 cd build
83 cmake .. -DCMAKE_BUILD_TYPE=Debug
84 make install -j4
85 source bin/setup_sbnanalysis.sh
86 
87 echo "source ${PWD}/bin/setup_sbnanalysis.sh" >> ${TOPDIR}/setup_sbncode-${SBN_VERSION}.sh
88 
89 echo -e "Setup finished. To use this environment, run\n\n source setup_sbncode-${SBN_VERSION}.sh"
90 
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