setup_g4lbne_fnal_SL5.sh
Go to the documentation of this file.
1 
2 source /grid/fermiapp/products/common/etc/setup
3 setup ifdhc
4 
5 # Setup grid submit tools if not on a grid node
6 if [ -z "${_CONDOR_SCRATCH_DIR}" ]; then
7  echo "_CONDOR_SCRATCH_DIR is not set... so I'm assuming we're not running on a grid node.... Setting up jobsub tools."
8  setup jobsub_tools
9 fi
10 
11 if [ -z "${G4LBNE_IS_SETUP}" ]; then
12 
13  case ${HOSTNAME} in
14  argoneut*)
15  export GROUP=argoneut
16  export EXPERIMENT=argoneut
17  ;;
18  uboone*)
19  export GROUP=microboone
20  export EXPERIMENT=uboone
21  ;;
22  lbne*)
23  export GROUP=lbne
24  export EXPERIMENT=lbne
25  ;;
26  esac
27  echo experiment is $GROUP
28 
29  export SETUP_LOCATION=/grid/fermiapp/products/lbne/
30 
31  #
32  #Locate and Setup UPS
33  #
34  # Make sure this file exists.
35  if [ -f ${SETUP_LOCATION}/setup ]; then
36  source ${SETUP_LOCATION}/setup
37  fi
38  #
39  #Now SETUP_UPS and UPS_DIR env vars should now be set
40  #so setup ups now
41  #
42  setup ${SETUP_UPS}
43 
44  #
45  #Set the versions of root, and geant4 you want to setup
46  #If you want to print the avaliable versions define print_products variable
47  print_products=1
48  #
49  export ROOT_VERSION=v5_30_06
50  export ROOT_FLAVOR=Linux64bit+2.6-2.5
51  export ROOT_QUALIFIERS=gcc46:prof
52 
53  export GEANT4_VERSION=v4_9_4_p03
54  export GEANT4_FLAVOR=Linux64bit+2.6-2.5
55  export GEANT4_QUALIFIERS=gcc46:prof
56 
57  #
58 
59  if [ -z "${print_products}" ]; then
60  echo "PRODUCTS = ${PRODUCTS}"
61 
62  ups list -a root
63  ups list -a geant4
64  ups list -a clhep
65 
66  fi
67 
68 
69  echo "Setting up ROOT"
70  export SETUP_ROOT="root ${ROOT_VERSION} -f ${ROOT_FLAVOR} -z ${SETUP_LOCATION} -q ${ROOT_QUALIFIERS}"
71  setup ${SETUP_ROOT}
72  echo "setup ${SETUP_ROOT}"
73 
74  echo "Setting up GEANT4"
75  export SETUP_GEANT4="geant4 ${GEANT4_VERSION} -f ${GEANT4_FLAVOR} -z ${SETUP_LOCATION} -q ${GEANT4_QUALIFIERS}"
76  setup ${SETUP_GEANT4}
77  echo "setup ${SETUP_GEANT4}"
78 
79  echo "Setting up G4Photon"
80  export SETUP_G4PHOTON="g4photon v2_1"
81  setup ${SETUP_G4PHOTON}
82  echo "setup ${SETUP_G4PHOTON}"
83 
84 ##!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
85 ##
86 ## Set G4WORKDIR to g4lbne directory, if not already set
87 ##
88 ##!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
89 
90  SETUPDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
91 
92  if [ -z "$G4WORKDIR" ]; then
93  export G4WORKDIR=`dirname $SETUPDIR`
94  echo "G4WORKDIR is not set... Setting it to "$G4WORKDIR
95  fi
96 
97  export G4LBNEWORKDIR=`dirname $SETUPDIR`
98 
99  export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:$G4LIB/Linux-g++"
100 
101 
102 
103 
104  echo "*********************"
105  echo Locating ROOT...
106  env | grep root
107  echo "*********************"
108  echo Locating Geant4...
109  env | grep geant4
110  echo "*********************"
111  echo Locating CLHEP...
112  env | grep clhep
113  echo "*********************"
114 
115  setup dk2nu r487 -f Linux64bit+2.6-2.5 -q g4lbne-gcc46-r53006
116  echo Locating Dk2Nu
117  env | grep DK2NU
118  echo "*********************"
119 
120 
121  echo G4WORKDIR is ${G4WORKDIR}
122  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH}
123 
124  #
125  # Set a flag to suppress unnecessary re-executions of this script.
126  #
127  #export G4LBNE_IS_SETUP=1
128 
129 fi