source: snovis/trunk/obuild/setup.sh@ 91

Last change on this file since 91 was 6, checked in by barrand, 19 years ago
File size: 14.0 KB
Line 
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
43obuild_snovis_path="@@absolute_dir@@"
44
45if [ "${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
66fi
67
68if [ "${OBUILD_PLATFORM}" = "" ] ; then
69 obuild_platform=`uname`
70else
71 obuild_platform=${OBUILD_PLATFORM}
72fi
73
74if [ "${obuild_platform}" = "" ] ; then
75 echo "obuild_platform variable not defined."
76 return
77fi
78
79if [ "${OBUILD_DIR_BIN}" = "" ] ; then
80 obuild_dir_bin=${obuild_platform}_obuild
81else
82 obuild_dir_bin=${OBUILD_DIR_BIN}
83fi
84
85if [ "${obuild_dir_bin}" = "" ] ; then
86 echo "obuild_dir_bin variable not defined."
87 return
88fi
89
90if [ ! -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
110fi
111obuild_platform_exe="${obuild_snovis_path}/${obuild_dir_bin}/obuild_platform"
112if [ "${obuild_platform_exe}" = "" ] ; then
113 echo "Variable obuild_platform_exe not defined."
114 return
115fi
116obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
117if [ ${obuild_platform_result} = yes ] ; then
118bhep_home="/Users/barrand/dev/exp/nemo/bhep/v1r4p1"
119fi
120unset obuild_platform_result
121if [ "${obuild_platform_exe}" = "" ] ; then
122 echo "Variable obuild_platform_exe not defined."
123 return
124fi
125obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
126if [ ${obuild_platform_result} = yes ] ; then
127bhep_platform="Darwin"
128fi
129unset obuild_platform_result
130if [ "${obuild_platform_exe}" = "" ] ; then
131 echo "Variable obuild_platform_exe not defined."
132 return
133fi
134obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
135if [ ${obuild_platform_result} = yes ] ; then
136GeomUtils_home="/Users/barrand/dev/exp/nemo/SNgeom/v0r1p0/build_area/GeomUtils"
137fi
138unset obuild_platform_result
139if [ "${obuild_platform_exe}" = "" ] ; then
140 echo "Variable obuild_platform_exe not defined."
141 return
142fi
143obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
144if [ ${obuild_platform_result} = yes ] ; then
145GeomUtils_platform="Darwin-i386"
146fi
147unset obuild_platform_result
148if [ "${obuild_platform_exe}" = "" ] ; then
149 echo "Variable obuild_platform_exe not defined."
150 return
151fi
152obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
153if [ ${obuild_platform_result} = yes ] ; then
154SNgeom2_home="/Users/barrand/dev/exp/nemo/SNgeom/v0r1p0/build_area/SNgeom2"
155fi
156unset obuild_platform_result
157if [ "${obuild_platform_exe}" = "" ] ; then
158 echo "Variable obuild_platform_exe not defined."
159 return
160fi
161obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
162if [ ${obuild_platform_result} = yes ] ; then
163snova_home="/Users/barrand/dev/exp/nemo/SNgeom/v0r1p0/build_area/snova"
164fi
165unset obuild_platform_result
166if [ "${obuild_platform_exe}" = "" ] ; then
167 echo "Variable obuild_platform_exe not defined."
168 return
169fi
170obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
171if [ ${obuild_platform_result} = yes ] ; then
172CLHEP_home="/usr/local/CLHEP/2.0.3.1"
173fi
174unset obuild_platform_result
175if [ "${obuild_platform_exe}" = "" ] ; then
176 echo "Variable obuild_platform_exe not defined."
177 return
178fi
179obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
180if [ ${obuild_platform_result} = yes ] ; then
181Geant4_home="/geant4/geant4.8.2"
182fi
183unset obuild_platform_result
184if [ "${obuild_platform_exe}" = "" ] ; then
185 echo "Variable obuild_platform_exe not defined."
186 return
187fi
188obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
189if [ ${obuild_platform_result} = yes ] ; then
190Geant4_work="${Geant4_home}/Darwin"
191fi
192unset obuild_platform_result
193if [ "${obuild_platform_exe}" = "" ] ; then
194 echo "Variable obuild_platform_exe not defined."
195 return
196fi
197obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Linux'`
198if [ ${obuild_platform_result} = yes ] ; then
199Geant4_work="${Geant4_home}/slc3_gcc323"
200fi
201unset obuild_platform_result
202if [ "${obuild_platform_exe}" = "" ] ; then
203 echo "Variable obuild_platform_exe not defined."
204 return
205fi
206obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
207if [ ${obuild_platform_result} = yes ] ; then
208Geant4_system="Darwin-g++"
209fi
210unset obuild_platform_result
211if [ "${obuild_platform_exe}" = "" ] ; then
212 echo "Variable obuild_platform_exe not defined."
213 return
214fi
215obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Linux'`
216if [ ${obuild_platform_result} = yes ] ; then
217Geant4_system="Linux-g++"
218fi
219unset obuild_platform_result
220if [ "${obuild_platform_exe}" = "" ] ; then
221 echo "Variable obuild_platform_exe not defined."
222 return
223fi
224obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Windows_NT'`
225if [ ${obuild_platform_result} = yes ] ; then
226Geant4_system="WIN32-VC"
227fi
228unset obuild_platform_result
229if [ ! -e "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find" ] ; then
230 if [ ! -e "${obuild_snovis_path}/obuild/cpp/obuild_find.cpp" ] ; then
231 echo "Program source obuild_find.cpp not found."
232 return
233 fi
234 if [ "${obuild_cxx_command}" = "" ] ; then
235 if [ "${OBUILD_CXX}" != "" ] ; then
236 obuild_find_compiler=${OBUILD_CXX}
237 else
238 obuild_find_compiler=c++
239 fi
240 else
241 obuild_find_compiler=${obuild_cxx_command}
242 fi
243 ${obuild_find_compiler} -o "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find" "${obuild_snovis_path}/obuild/cpp/obuild_find.cpp"
244 unset obuild_find_compiler
245 if [ ! -e "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find" ] ; then
246 echo "Program obuild_find not found."
247 return
248 fi
249fi
250obuild_find_exe="${obuild_snovis_path}/${obuild_dir_bin}/obuild_find"
251if [ "${obuild_find_exe}" = "" ] ; then
252 echo "Variable obuild_find_exe not defined."
253 return
254fi
255obuild_OnX_path=`"${obuild_find_exe}" OnX 'v17r*'`
256if [ "${obuild_OnX_path}" = "" ] ; then
257 echo "Can't find OnX package."
258 return
259fi
260if [ "${obuild_find_exe}" = "" ] ; then
261 echo "Variable obuild_find_exe not defined."
262 return
263fi
264obuild_G4Lab_path=`"${obuild_find_exe}" G4Lab 'v8r*'`
265if [ "${obuild_G4Lab_path}" = "" ] ; then
266 echo "Can't find G4Lab package."
267 return
268fi
269
270# Execute setup of used packages :
271if [ ! -e "${obuild_OnX_path}/obuild/setup.sh" ] ; then
272 echo "setup.sh not found for package OnX."
273 return
274fi
275. "${obuild_OnX_path}/obuild/setup.sh"
276
277if [ ! -e "${obuild_G4Lab_path}/obuild/setup.sh" ] ; then
278 echo "setup.sh not found for package G4Lab."
279 return
280fi
281. "${obuild_G4Lab_path}/obuild/setup.sh"
282
283# Set environment variables of this package :
284SNOVISROOT="${obuild_snovis_path}"
285export SNOVISROOT
286G4RADIOACTIVEDATA="${Geant4_home}/data/RadiativeDecay3.1"
287export G4RADIOACTIVEDATA
288G4LEVELGAMMADATA="${Geant4_home}/data/PhotonEvaporation2.0"
289export G4LEVELGAMMADATA
290G4LEDATA="${Geant4_home}/data/G4EMLOW4.2"
291export G4LEDATA
292NeutronHPCrossSections="${Geant4_home}/data/G4NDL3.10"
293export NeutronHPCrossSections
294
295if [ "${obuild_platform_exe}" = "" ] ; then
296 echo "Variable obuild_platform_exe not defined."
297 return
298fi
299obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
300if [ ${obuild_platform_result} = yes ] ; then
301if [ "${obuild_platform_exe}" = "" ] ; then
302 echo "Variable obuild_platform_exe not defined."
303 return
304fi
305obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
306if [ ${obuild_platform_result} = yes ] ; then
307 if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then
308 DYLD_LIBRARY_PATH="${GeomUtils_home}/Darwin-i386/lib"
309 export DYLD_LIBRARY_PATH
310 else
311 DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${GeomUtils_home}/Darwin-i386/lib"
312 export DYLD_LIBRARY_PATH
313 fi
314fi
315unset obuild_platform_result
316else
317if [ "${obuild_platform_exe}" = "" ] ; then
318 echo "Variable obuild_platform_exe not defined."
319 return
320fi
321obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
322if [ ${obuild_platform_result} = yes ] ; then
323 if [ "${LD_LIBRARY_PATH}" = "" ] ; then
324 LD_LIBRARY_PATH="${GeomUtils_home}/Darwin-i386/lib"
325 export LD_LIBRARY_PATH
326 else
327 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GeomUtils_home}/Darwin-i386/lib"
328 export LD_LIBRARY_PATH
329 fi
330fi
331unset obuild_platform_result
332fi
333unset obuild_platform_result
334
335if [ "${obuild_platform_exe}" = "" ] ; then
336 echo "Variable obuild_platform_exe not defined."
337 return
338fi
339obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
340if [ ${obuild_platform_result} = yes ] ; then
341if [ "${obuild_platform_exe}" = "" ] ; then
342 echo "Variable obuild_platform_exe not defined."
343 return
344fi
345obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
346if [ ${obuild_platform_result} = yes ] ; then
347 if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then
348 DYLD_LIBRARY_PATH="${SNgeom2_home}/Darwin-i386/lib"
349 export DYLD_LIBRARY_PATH
350 else
351 DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${SNgeom2_home}/Darwin-i386/lib"
352 export DYLD_LIBRARY_PATH
353 fi
354fi
355unset obuild_platform_result
356else
357if [ "${obuild_platform_exe}" = "" ] ; then
358 echo "Variable obuild_platform_exe not defined."
359 return
360fi
361obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
362if [ ${obuild_platform_result} = yes ] ; then
363 if [ "${LD_LIBRARY_PATH}" = "" ] ; then
364 LD_LIBRARY_PATH="${SNgeom2_home}/Darwin-i386/lib"
365 export LD_LIBRARY_PATH
366 else
367 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${SNgeom2_home}/Darwin-i386/lib"
368 export LD_LIBRARY_PATH
369 fi
370fi
371unset obuild_platform_result
372fi
373unset obuild_platform_result
374
375if [ "${obuild_platform_exe}" = "" ] ; then
376 echo "Variable obuild_platform_exe not defined."
377 return
378fi
379obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
380if [ ${obuild_platform_result} = yes ] ; then
381if [ "${obuild_platform_exe}" = "" ] ; then
382 echo "Variable obuild_platform_exe not defined."
383 return
384fi
385obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
386if [ ${obuild_platform_result} = yes ] ; then
387 if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then
388 DYLD_LIBRARY_PATH="${bhep_home}/Darwin/lib"
389 export DYLD_LIBRARY_PATH
390 else
391 DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${bhep_home}/Darwin/lib"
392 export DYLD_LIBRARY_PATH
393 fi
394fi
395unset obuild_platform_result
396else
397if [ "${obuild_platform_exe}" = "" ] ; then
398 echo "Variable obuild_platform_exe not defined."
399 return
400fi
401obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
402if [ ${obuild_platform_result} = yes ] ; then
403 if [ "${LD_LIBRARY_PATH}" = "" ] ; then
404 LD_LIBRARY_PATH="${bhep_home}/Darwin/lib"
405 export LD_LIBRARY_PATH
406 else
407 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${bhep_home}/Darwin/lib"
408 export LD_LIBRARY_PATH
409 fi
410fi
411unset obuild_platform_result
412fi
413unset obuild_platform_result
414
415if [ "${obuild_platform_exe}" = "" ] ; then
416 echo "Variable obuild_platform_exe not defined."
417 return
418fi
419obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
420if [ ${obuild_platform_result} = yes ] ; then
421 if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then
422 DYLD_LIBRARY_PATH="${obuild_snovis_path}/${obuild_dir_bin}"
423 export DYLD_LIBRARY_PATH
424 else
425 DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${obuild_snovis_path}/${obuild_dir_bin}"
426 export DYLD_LIBRARY_PATH
427 fi
428else
429 if [ "${LD_LIBRARY_PATH}" = "" ] ; then
430 LD_LIBRARY_PATH="${obuild_snovis_path}/${obuild_dir_bin}"
431 export LD_LIBRARY_PATH
432 else
433 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${obuild_snovis_path}/${obuild_dir_bin}"
434 export LD_LIBRARY_PATH
435 fi
436fi
437unset obuild_platform_result
438
439if [ "${PATH}" = "" ] ; then
440 PATH="${obuild_snovis_path}/${obuild_dir_bin}"
441 export PATH
442else
443 PATH="${PATH}:${obuild_snovis_path}/${obuild_dir_bin}"
444 export PATH
445fi
446unset obuild_snovis_path
447
448#FIXME unset obuild_platform
449#FIXME unset obuild_dir_bin
Note: See TracBrowser for help on using the repository browser.