| 1 | #!/bin/sh -f
|
|---|
| 2 |
|
|---|
| 3 | #
|
|---|
| 4 | # File produced by the obuild tool version 1.0
|
|---|
| 5 | # for the package snovis with version v1r0.
|
|---|
| 6 | #
|
|---|
| 7 |
|
|---|
| 8 | #////////////////////////////////////////////////
|
|---|
| 9 | # Usage :
|
|---|
| 10 | # sh> . setup.sh
|
|---|
| 11 | #////////////////////////////////////////////////
|
|---|
| 12 |
|
|---|
| 13 | #set -x # uncomment this line to have full verbosity.
|
|---|
| 14 |
|
|---|
| 15 | #////////////////////////////////////////////////
|
|---|
| 16 | # Set the absolute path of this package.
|
|---|
| 17 | # If in the below line there is the keyword :
|
|---|
| 18 | #
|
|---|
| 19 | # @@absolute_dir@@
|
|---|
| 20 | #
|
|---|
| 21 | # then the package had not been installed.
|
|---|
| 22 | #
|
|---|
| 23 | # Someone has to replace @@absolute_dir@@
|
|---|
| 24 | # by the absolute path of the package.
|
|---|
| 25 | # By "absolute path of the package", we mean that
|
|---|
| 26 | # if the obuild directory of the package is
|
|---|
| 27 | # found under :
|
|---|
| 28 | # some_path/pack/vers/obuild
|
|---|
| 29 | # then the "absolute path of the package" is :
|
|---|
| 30 | # some_path/pack/vers
|
|---|
| 31 | #
|
|---|
| 32 | # This replacement can be done on the setup
|
|---|
| 33 | # scripts of the package by using the sh/build
|
|---|
| 34 | # with the -i option.
|
|---|
| 35 | #
|
|---|
| 36 | # This replacement can be done recursively
|
|---|
| 37 | # on the setups of the used packages by using
|
|---|
| 38 | # the sh/build script with the -bci option
|
|---|
| 39 | # ("bci" for broadcast install).
|
|---|
| 40 | #
|
|---|
| 41 | #////////////////////////////////////////////////
|
|---|
| 42 |
|
|---|
| 43 | obuild_snovis_path="@@absolute_dir@@"
|
|---|
| 44 |
|
|---|
| 45 | if [ "${obuild_snovis_path}" = '@@absolute_dir@@' ] ; then
|
|---|
| 46 | echo ' The package snovis had not been installed.'
|
|---|
| 47 | echo ''
|
|---|
| 48 | echo ' In the file :'
|
|---|
| 49 | echo ' snovis/<vers>/obuild/setup.sh'
|
|---|
| 50 | echo ' someone has to replace '
|
|---|
| 51 | echo ' @@absolute_dir@@'
|
|---|
| 52 | echo ' by the absolute path of the package.'
|
|---|
| 53 | echo ' By "absolute path of the package", we mean that'
|
|---|
| 54 | echo ' if the obuild directory of the package is found under :'
|
|---|
| 55 | echo ' some_path/pack/vers/obuild'
|
|---|
| 56 | echo ' then the "absolute path of the package" is :'
|
|---|
| 57 | echo ' some_path/pack/vers'
|
|---|
| 58 | echo ''
|
|---|
| 59 | echo ' If having the write access, this replacement can be done'
|
|---|
| 60 | echo ' on the setup scripts of the package by using the sh/build'
|
|---|
| 61 | echo ' with the -i option. This replacement can be done recursively'
|
|---|
| 62 | echo ' on the setups of the used packages by using the sh/build script'
|
|---|
| 63 | echo ' with the -bci option ("bci" for broadcast install).'
|
|---|
| 64 | echo ''
|
|---|
| 65 | return
|
|---|
| 66 | fi
|
|---|
| 67 |
|
|---|
| 68 | if [ "${OBUILD_PLATFORM}" = "" ] ; then
|
|---|
| 69 | obuild_platform=`uname`
|
|---|
| 70 | else
|
|---|
| 71 | obuild_platform=${OBUILD_PLATFORM}
|
|---|
| 72 | fi
|
|---|
| 73 |
|
|---|
| 74 | if [ "${obuild_platform}" = "" ] ; then
|
|---|
| 75 | echo "obuild_platform variable not defined."
|
|---|
| 76 | return
|
|---|
| 77 | fi
|
|---|
| 78 |
|
|---|
| 79 | if [ "${OBUILD_DIR_BIN}" = "" ] ; then
|
|---|
| 80 | obuild_dir_bin=${obuild_platform}_obuild
|
|---|
| 81 | else
|
|---|
| 82 | obuild_dir_bin=${OBUILD_DIR_BIN}
|
|---|
| 83 | fi
|
|---|
| 84 |
|
|---|
| 85 | if [ "${obuild_dir_bin}" = "" ] ; then
|
|---|
| 86 | echo "obuild_dir_bin variable not defined."
|
|---|
| 87 | return
|
|---|
| 88 | fi
|
|---|
| 89 |
|
|---|
| 90 | if [ ! -e "${obuild_snovis_path}/${obuild_dir_bin}/obuild_platform" ] ; then
|
|---|
| 91 | if [ ! -e "${obuild_snovis_path}/obuild/cpp/obuild_platform.cpp" ] ; then
|
|---|
| 92 | echo "Program source obuild_platform.cpp not found."
|
|---|
| 93 | return
|
|---|
| 94 | fi
|
|---|
| 95 | if [ "${obuild_cxx_command}" = "" ] ; then
|
|---|
| 96 | if [ "${OBUILD_CXX}" != "" ] ; then
|
|---|
| 97 | obuild_platform_compiler=${OBUILD_CXX}
|
|---|
| 98 | else
|
|---|
| 99 | obuild_platform_compiler=c++
|
|---|
| 100 | fi
|
|---|
| 101 | else
|
|---|
| 102 | obuild_platform_compiler=${obuild_cxx_command}
|
|---|
| 103 | fi
|
|---|
| 104 | ${obuild_platform_compiler} -o "${obuild_snovis_path}/${obuild_dir_bin}/obuild_platform" "${obuild_snovis_path}/obuild/cpp/obuild_platform.cpp"
|
|---|
| 105 | unset obuild_platform_compiler
|
|---|
| 106 | if [ ! -e "${obuild_snovis_path}/${obuild_dir_bin}/obuild_platform" ] ; then
|
|---|
| 107 | echo "Program obuild_platform not found."
|
|---|
| 108 | return
|
|---|
| 109 | fi
|
|---|
| 110 | fi
|
|---|
| 111 | obuild_platform_exe="${obuild_snovis_path}/${obuild_dir_bin}/obuild_platform"
|
|---|
| 112 | if [ "${obuild_platform_exe}" = "" ] ; then
|
|---|
| 113 | echo "Variable obuild_platform_exe not defined."
|
|---|
| 114 | return
|
|---|
| 115 | fi
|
|---|
| 116 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
|
|---|
| 117 | if [ ${obuild_platform_result} = yes ] ; then
|
|---|
| 118 | bhep_home="/Users/barrand/dev/exp/nemo/bhep/v1r4p2"
|
|---|
| 119 | fi
|
|---|
| 120 | unset obuild_platform_result
|
|---|
| 121 | if [ "${obuild_platform_exe}" = "" ] ; then
|
|---|
| 122 | echo "Variable obuild_platform_exe not defined."
|
|---|
| 123 | return
|
|---|
| 124 | fi
|
|---|
| 125 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
|
|---|
| 126 | if [ ${obuild_platform_result} = yes ] ; then
|
|---|
| 127 | bhep_platform="Darwin"
|
|---|
| 128 | fi
|
|---|
| 129 | unset obuild_platform_result
|
|---|
| 130 | if [ "${obuild_platform_exe}" = "" ] ; then
|
|---|
| 131 | echo "Variable obuild_platform_exe not defined."
|
|---|
| 132 | return
|
|---|
| 133 | fi
|
|---|
| 134 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
|
|---|
| 135 | if [ ${obuild_platform_result} = yes ] ; then
|
|---|
| 136 | snova_home="/Users/barrand/dev/exp/nemo/snova/v2r0p0"
|
|---|
| 137 | fi
|
|---|
| 138 | unset obuild_platform_result
|
|---|
| 139 | if [ "${obuild_platform_exe}" = "" ] ; then
|
|---|
| 140 | echo "Variable obuild_platform_exe not defined."
|
|---|
| 141 | return
|
|---|
| 142 | fi
|
|---|
| 143 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
|
|---|
| 144 | if [ ${obuild_platform_result} = yes ] ; then
|
|---|
| 145 | snova_platform="Darwin"
|
|---|
| 146 | fi
|
|---|
| 147 | unset obuild_platform_result
|
|---|
| 148 | if [ "${obuild_platform_exe}" = "" ] ; then
|
|---|
| 149 | echo "Variable obuild_platform_exe not defined."
|
|---|
| 150 | return
|
|---|
| 151 | fi
|
|---|
| 152 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
|
|---|
| 153 | if [ ${obuild_platform_result} = yes ] ; then
|
|---|
| 154 | CLHEP_home="/usr/local/CLHEP/2.0.3.1"
|
|---|
| 155 | fi
|
|---|
| 156 | unset obuild_platform_result
|
|---|
| 157 | if [ "${obuild_platform_exe}" = "" ] ; then
|
|---|
| 158 | echo "Variable obuild_platform_exe not defined."
|
|---|
| 159 | return
|
|---|
| 160 | fi
|
|---|
| 161 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
|
|---|
| 162 | if [ ${obuild_platform_result} = yes ] ; then
|
|---|
| 163 | Geant4_home="/usr/local/geant4/8.2"
|
|---|
| 164 | fi
|
|---|
| 165 | unset obuild_platform_result
|
|---|
| 166 | if [ ! -e "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find" ] ; then
|
|---|
| 167 | if [ ! -e "${obuild_snovis_path}/obuild/cpp/obuild_find.cpp" ] ; then
|
|---|
| 168 | echo "Program source obuild_find.cpp not found."
|
|---|
| 169 | return
|
|---|
| 170 | fi
|
|---|
| 171 | if [ "${obuild_cxx_command}" = "" ] ; then
|
|---|
| 172 | if [ "${OBUILD_CXX}" != "" ] ; then
|
|---|
| 173 | obuild_find_compiler=${OBUILD_CXX}
|
|---|
| 174 | else
|
|---|
| 175 | obuild_find_compiler=c++
|
|---|
| 176 | fi
|
|---|
| 177 | else
|
|---|
| 178 | obuild_find_compiler=${obuild_cxx_command}
|
|---|
| 179 | fi
|
|---|
| 180 | ${obuild_find_compiler} -o "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find" "${obuild_snovis_path}/obuild/cpp/obuild_find.cpp"
|
|---|
| 181 | unset obuild_find_compiler
|
|---|
| 182 | if [ ! -e "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find" ] ; then
|
|---|
| 183 | echo "Program obuild_find not found."
|
|---|
| 184 | return
|
|---|
| 185 | fi
|
|---|
| 186 | fi
|
|---|
| 187 | obuild_find_exe="${obuild_snovis_path}/${obuild_dir_bin}/obuild_find"
|
|---|
| 188 | if [ "${obuild_find_exe}" = "" ] ; then
|
|---|
| 189 | echo "Variable obuild_find_exe not defined."
|
|---|
| 190 | return
|
|---|
| 191 | fi
|
|---|
| 192 | obuild_OnX_path=`"${obuild_find_exe}" OnX 'v17r*'`
|
|---|
| 193 | if [ "${obuild_OnX_path}" = "" ] ; then
|
|---|
| 194 | echo "Can't find OnX package."
|
|---|
| 195 | return
|
|---|
| 196 | fi
|
|---|
| 197 | if [ "${obuild_find_exe}" = "" ] ; then
|
|---|
| 198 | echo "Variable obuild_find_exe not defined."
|
|---|
| 199 | return
|
|---|
| 200 | fi
|
|---|
| 201 | obuild_G4Lab_path=`"${obuild_find_exe}" G4Lab 'v8r*'`
|
|---|
| 202 | if [ "${obuild_G4Lab_path}" = "" ] ; then
|
|---|
| 203 | echo "Can't find G4Lab package."
|
|---|
| 204 | return
|
|---|
| 205 | fi
|
|---|
| 206 |
|
|---|
| 207 | # Execute setup of used packages :
|
|---|
| 208 | if [ ! -e "${obuild_OnX_path}/obuild/setup.sh" ] ; then
|
|---|
| 209 | echo "setup.sh not found for package OnX."
|
|---|
| 210 | return
|
|---|
| 211 | fi
|
|---|
| 212 | . "${obuild_OnX_path}/obuild/setup.sh"
|
|---|
| 213 |
|
|---|
| 214 | if [ ! -e "${obuild_G4Lab_path}/obuild/setup.sh" ] ; then
|
|---|
| 215 | echo "setup.sh not found for package G4Lab."
|
|---|
| 216 | return
|
|---|
| 217 | fi
|
|---|
| 218 | . "${obuild_G4Lab_path}/obuild/setup.sh"
|
|---|
| 219 |
|
|---|
| 220 | # Set environment variables of this package :
|
|---|
| 221 | SNOVISROOT="${obuild_snovis_path}"
|
|---|
| 222 | export SNOVISROOT
|
|---|
| 223 | G4RADIOACTIVEDATA="${Geant4_home}/data/RadiativeDecay3.1"
|
|---|
| 224 | export G4RADIOACTIVEDATA
|
|---|
| 225 | G4LEVELGAMMADATA="${Geant4_home}/data/PhotonEvaporation2.0"
|
|---|
| 226 | export G4LEVELGAMMADATA
|
|---|
| 227 | G4LEDATA="${Geant4_home}/data/G4EMLOW4.2"
|
|---|
| 228 | export G4LEDATA
|
|---|
| 229 | NeutronHPCrossSections="${Geant4_home}/data/G4NDL3.10"
|
|---|
| 230 | export NeutronHPCrossSections
|
|---|
| 231 |
|
|---|
| 232 | if [ "${obuild_platform_exe}" = "" ] ; then
|
|---|
| 233 | echo "Variable obuild_platform_exe not defined."
|
|---|
| 234 | return
|
|---|
| 235 | fi
|
|---|
| 236 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
|
|---|
| 237 | if [ ${obuild_platform_result} = yes ] ; then
|
|---|
| 238 | if [ "${obuild_platform_exe}" = "" ] ; then
|
|---|
| 239 | echo "Variable obuild_platform_exe not defined."
|
|---|
| 240 | return
|
|---|
| 241 | fi
|
|---|
| 242 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
|
|---|
| 243 | if [ ${obuild_platform_result} = yes ] ; then
|
|---|
| 244 | if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then
|
|---|
| 245 | DYLD_LIBRARY_PATH="${bhep_home}/Darwin"
|
|---|
| 246 | export DYLD_LIBRARY_PATH
|
|---|
| 247 | else
|
|---|
| 248 | DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${bhep_home}/Darwin"
|
|---|
| 249 | export DYLD_LIBRARY_PATH
|
|---|
| 250 | fi
|
|---|
| 251 | fi
|
|---|
| 252 | unset obuild_platform_result
|
|---|
| 253 | else
|
|---|
| 254 | if [ "${obuild_platform_exe}" = "" ] ; then
|
|---|
| 255 | echo "Variable obuild_platform_exe not defined."
|
|---|
| 256 | return
|
|---|
| 257 | fi
|
|---|
| 258 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
|
|---|
| 259 | if [ ${obuild_platform_result} = yes ] ; then
|
|---|
| 260 | if [ "${LD_LIBRARY_PATH}" = "" ] ; then
|
|---|
| 261 | LD_LIBRARY_PATH="${bhep_home}/Darwin"
|
|---|
| 262 | export LD_LIBRARY_PATH
|
|---|
| 263 | else
|
|---|
| 264 | LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${bhep_home}/Darwin"
|
|---|
| 265 | export LD_LIBRARY_PATH
|
|---|
| 266 | fi
|
|---|
| 267 | fi
|
|---|
| 268 | unset obuild_platform_result
|
|---|
| 269 | fi
|
|---|
| 270 | unset obuild_platform_result
|
|---|
| 271 |
|
|---|
| 272 | if [ "${obuild_platform_exe}" = "" ] ; then
|
|---|
| 273 | echo "Variable obuild_platform_exe not defined."
|
|---|
| 274 | return
|
|---|
| 275 | fi
|
|---|
| 276 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
|
|---|
| 277 | if [ ${obuild_platform_result} = yes ] ; then
|
|---|
| 278 | if [ "${obuild_platform_exe}" = "" ] ; then
|
|---|
| 279 | echo "Variable obuild_platform_exe not defined."
|
|---|
| 280 | return
|
|---|
| 281 | fi
|
|---|
| 282 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
|
|---|
| 283 | if [ ${obuild_platform_result} = yes ] ; then
|
|---|
| 284 | if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then
|
|---|
| 285 | DYLD_LIBRARY_PATH="${snova_home}/Darwin"
|
|---|
| 286 | export DYLD_LIBRARY_PATH
|
|---|
| 287 | else
|
|---|
| 288 | DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${snova_home}/Darwin"
|
|---|
| 289 | export DYLD_LIBRARY_PATH
|
|---|
| 290 | fi
|
|---|
| 291 | fi
|
|---|
| 292 | unset obuild_platform_result
|
|---|
| 293 | else
|
|---|
| 294 | if [ "${obuild_platform_exe}" = "" ] ; then
|
|---|
| 295 | echo "Variable obuild_platform_exe not defined."
|
|---|
| 296 | return
|
|---|
| 297 | fi
|
|---|
| 298 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
|
|---|
| 299 | if [ ${obuild_platform_result} = yes ] ; then
|
|---|
| 300 | if [ "${LD_LIBRARY_PATH}" = "" ] ; then
|
|---|
| 301 | LD_LIBRARY_PATH="${snova_home}/Darwin"
|
|---|
| 302 | export LD_LIBRARY_PATH
|
|---|
| 303 | else
|
|---|
| 304 | LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${snova_home}/Darwin"
|
|---|
| 305 | export LD_LIBRARY_PATH
|
|---|
| 306 | fi
|
|---|
| 307 | fi
|
|---|
| 308 | unset obuild_platform_result
|
|---|
| 309 | fi
|
|---|
| 310 | unset obuild_platform_result
|
|---|
| 311 |
|
|---|
| 312 | if [ "${obuild_platform_exe}" = "" ] ; then
|
|---|
| 313 | echo "Variable obuild_platform_exe not defined."
|
|---|
| 314 | return
|
|---|
| 315 | fi
|
|---|
| 316 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
|
|---|
| 317 | if [ ${obuild_platform_result} = yes ] ; then
|
|---|
| 318 | if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then
|
|---|
| 319 | DYLD_LIBRARY_PATH="${obuild_snovis_path}/${obuild_dir_bin}"
|
|---|
| 320 | export DYLD_LIBRARY_PATH
|
|---|
| 321 | else
|
|---|
| 322 | DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${obuild_snovis_path}/${obuild_dir_bin}"
|
|---|
| 323 | export DYLD_LIBRARY_PATH
|
|---|
| 324 | fi
|
|---|
| 325 | else
|
|---|
| 326 | if [ "${LD_LIBRARY_PATH}" = "" ] ; then
|
|---|
| 327 | LD_LIBRARY_PATH="${obuild_snovis_path}/${obuild_dir_bin}"
|
|---|
| 328 | export LD_LIBRARY_PATH
|
|---|
| 329 | else
|
|---|
| 330 | LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${obuild_snovis_path}/${obuild_dir_bin}"
|
|---|
| 331 | export LD_LIBRARY_PATH
|
|---|
| 332 | fi
|
|---|
| 333 | fi
|
|---|
| 334 | unset obuild_platform_result
|
|---|
| 335 |
|
|---|
| 336 | if [ "${PATH}" = "" ] ; then
|
|---|
| 337 | PATH="${obuild_snovis_path}/${obuild_dir_bin}"
|
|---|
| 338 | export PATH
|
|---|
| 339 | else
|
|---|
| 340 | PATH="${PATH}:${obuild_snovis_path}/${obuild_dir_bin}"
|
|---|
| 341 | export PATH
|
|---|
| 342 | fi
|
|---|
| 343 | unset obuild_snovis_path
|
|---|
| 344 |
|
|---|
| 345 | #FIXME unset obuild_platform
|
|---|
| 346 | #FIXME unset obuild_dir_bin
|
|---|