setup_dune.sh
Go to the documentation of this file.
1 
2 # DUNE software environment setup script
3 # to be sourced.
4 
5 # Look for obsolete lines in login scripts
6 checkthesefiles=
7 for file in ~/.bash_profile ~/.bash_login ~/.profile ~/.shrc ~/.bashrc;
8 do
9  if [[ -f $file ]]; then
10  found=0
11  while IFS= read -r line; do
12  if [[ $line == *"setup login"* && $line != *"#"* ]]; then
13  #echo $line in $file
14  found=1
15  fi
16  if [[ $line == *"setup shrc"* && $line != *"#"* ]]; then
17  #echo $line in $file
18  found=1
19  fi
20  done < "$file"
21  #echo $found
22  if [[ $found == 1 ]]; then
23  #echo file $file
24  checkthesefiles="$file $checkthesefiles"
25  #echo checkthesefiles $checkthesefiles
26  fi
27  fi
28 done
29 if [[ -n $checkthesefiles ]]; then
30  echo -e "\033[0;31mIMPORTANT! We detect obsolete lines in your login scripts $checkthesefiles \033[0m"
31  echo "Please look for the following lines or something similar in $checkthesefiles and comment those lines out and relogin. Those lines may cause a conflict with cvmfs later."
32  echo "pa=/grid/fermiapp/products/common/etc"
33  echo "if [ -r \"$pa/setups.sh\" ]"
34  echo "then"
35  echo " . \"$pa/setups.sh\" "
36  echo " if ups exist login"
37  echo " then"
38  echo " setup login"
39  echo " fi"
40  echo "fi"
41  echo or
42  echo "pa=/grid/fermiapp/products/common/etc"
43  echo "if [ -r \"$pa/setups.sh\" ]"
44  echo "then"
45  echo " . \"$pa/setups.sh\" "
46  echo "fi"
47  echo ""
48  echo "if ups exist shrc"
49  echo "then"
50  echo " setup shrc"
51  echo "fi"
52  echo
53  echo "For more information, please check https://cdcvs.fnal.gov/redmine/issues/15028 or contact Tingjun (tjyang@fnal.gov) or Tom (trj@fnal.gov)."
54 fi
55 
56 # Source this file to set the basic configuration needed by LArSoft
57 # and for the DUNE-specific software that interfaces to LArSoft.
58 
59 # location of the common UPS database
60 
61 CVMFS_COMMON_DIR="/cvmfs/fermilab.opensciencegrid.org/products/common/db/"
62 
63 # current location of larsoft in CVMFS
64 
65 CVMFS_LARSOFT_DIR="/cvmfs/larsoft.opensciencegrid.org/products/"
66 
67 # location of DUNE software. /grid/fermiapp is a fallback
68 
69 CVMFS_DUNE_DIR="/cvmfs/dune.opensciencegrid.org/products/dune/"
70 FERMIAPP_DUNE_DIR="/grid/fermiapp/products/dune/"
71 
72 # Set up ups for LArSoft
73 
74 for dir in $CVMFS_LARSOFT_DIR;
75 do
76  if [[ -f $dir/setup ]]; then
77  echo "Setting up larsoft UPS area... ${dir}"
78  source $dir/setup
79  break
80  fi
81 done
82 
83 # need also the common db in $PRODUCTS
84 
85 for dir in $CVMFS_COMMON_DIR
86 do
87  if [[ -d $CVMFS_COMMON_DIR ]]; then
88  export PRODUCTS=`dropit -p $PRODUCTS common/db`:${CVMFS_COMMON_DIR}
89  break
90  fi
91 done
92 
93 # Set up ups for DUNE. Try CVMFS first and fall back to /grid/fermiapp
94 # only if the CVMFS setup cannot be found
95 
96 for dir in $CVMFS_DUNE_DIR $FERMIAPP_DUNE_DIR;
97 do
98  if [[ -f $dir/setup ]]; then
99  echo "Setting up DUNE UPS area... ${dir}"
100  source $dir/setup
101  break
102  fi
103 done
104 
105 # Add current working directory (".") to FW_SEARCH_PATH
106 #
107 if [[ -n "${FW_SEARCH_PATH}" ]]; then
108  export FW_SEARCH_PATH=.:`dropit -e -p $FW_SEARCH_PATH .`
109 else
110  export FW_SEARCH_PATH=.
111 fi
112 
113 # Set up the basic tools that will be needed
114 #
115 if [ `uname` != Darwin ]; then
116 
117  # Work around git table file bugs.
118 
119  export PATH=`dropit git`
120  export LD_LIBRARY_PATH=`dropit -p $LD_LIBRARY_PATH git`
121  setup git
122 fi
123 
124 setup gitflow
125 setup mrb
126 
127 # this is now setup by jobsub_client. setup pycurl
128 
129 # Define the value of MRB_PROJECT. This can be used
130 # to drive other set-ups.
131 # We need to set this to 'larsoft' for now.
132 
133 export MRB_PROJECT=larsoft
134 
135 # Define environment variables that store the standard experiment name.
136 
137 export JOBSUB_GROUP=dune
138 export EXPERIMENT=dune # Used by ifdhc
139 export SAM_EXPERIMENT=dune
140 
141 # For Art workbook
142 
143 export ART_WORKBOOK_OUTPUT_BASE=/dune/data/users
144 export ART_WORKBOOK_WORKING_BASE=/dune/app/users
145 export ART_WORKBOOK_QUAL="s2:e5:nu"
146 
147 # For database
148 
149 export DBIWSPWDFILE=/dune/experts/path/to/proddbpwd/for/writes
150 export DBIWSURL=http://dbdata0vm.fnal.gov:8116/LBNE35tCon/app/
151 export DBIWSURLINT=http://dbdata0vm.fnal.gov:8116/LBNE35tCon/app/
152 export DBIWSURLPUT=http://dbdata0vm.fnal.gov:8117/LBNE35tCon/app/
153 export DBIQEURL=http://dbdata0vm.fnal.gov:8122/QE/dune35t/prod/app/SQ/
154 export DBIHOST=ifdbprod.fnal.gov
155 export DBINAME=dune35t_prod
156 export DBIPORT=5442
157 export DBIUSER=dune_reader
158 export DBIPWDFILE='~jpaley/dune/db/proddbpwd'
159 
160 # For ifbeam
161 
162 export SSL_CERT_FILE=""
163 
164 # to ensure compatibility on OSG nodes missing OS libraries
165 
166 setup dune_oslibs v1_0_0
167 
168 # set up gdb and ninja out of ups
169 
170 setup gdb
171 setup ninja