All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
install_sbncode-v08_47_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_47_00"
18  LAR_QUAL="e19: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 source /cvmfs/icarus.opensciencegrid.org/products/icarus/setup_icarus.sh
39 setup icaruscode ${LAR_VERSION} -q ${LAR_QUAL}
40 EOF
41 
42 source ./setup_sbncode-${LAR_VERSION}.sh
43 
44 # Create working area
45 WDIR="${PWD}/sbncode-${LAR_VERSION}"
46 mkdir $WDIR
47 
48 if [ $? -ne 0 ]; then
49  echo "Unable to create directory ${WDIR}"
50  exit
51 fi
52 
53 cd ${WDIR}
54 mrb newDev -v ${LAR_VERSION} -q ${LAR_QUAL}
55 LAR_QUAL_STR=${LAR_QUAL//:/_}
56 MRB_SETUP=${WDIR}/localProducts_larsoft_${LAR_VERSION}_${LAR_QUAL_STR}/setup
57 source ${MRB_SETUP}
58 
59 # Get sbncode
60 cd srcs
61 mrb gitCheckout -t ${LAR_VERSION} sbncode
62 
63 #mrb gitCheckout -t master sbncode
64 #echo "Bailing early..."
65 #exit
66 
67 # Build sbncode
68 mrbsetenv
69 mrb i -j4
70 
71 cat << EOF >> ${TOPDIR}/setup_sbncode-${LAR_VERSION}.sh
72 source ${MRB_SETUP}
73 mrbslp
74 mrbsetenv
75 EOF
76 
77 # Build sbnanalysis
78 cd ${WDIR}/srcs/sbncode/sbnanalysis
79 mkdir build
80 cd build
81 cmake .. -DCMAKE_BUILD_TYPE=Debug
82 make install -j4
83 source bin/setup_sbnanalysis.sh
84 
85 echo "source ${PWD}/bin/setup_sbnanalysis.sh" >> ${TOPDIR}/setup_sbncode-${LAR_VERSION}.sh
86 
87 echo -e "Setup finished. To use this environment, run\n\n source setup_sbncode-${LAR_VERSION}.sh"
88 
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