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

Last change on this file since 123 was 101, checked in by barrand, 19 years ago
File size: 10.5 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 v1r1.
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/v1r4p2"
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
136snova_home="/Users/barrand/dev/exp/nemo/snova/v2r0p0"
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
145snova_platform="Darwin"
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
154CLHEP_home="/usr/local/CLHEP/2.0.3.1"
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
163Geant4_home="/usr/local/geant4/8.2"
164fi
165unset obuild_platform_result
166if [ ! -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
186fi
187obuild_find_exe="${obuild_snovis_path}/${obuild_dir_bin}/obuild_find"
188if [ "${obuild_find_exe}" = "" ] ; then
189 echo "Variable obuild_find_exe not defined."
190 return
191fi
192obuild_OnX_path=`"${obuild_find_exe}" OnX 'v17r*'`
193if [ "${obuild_OnX_path}" = "" ] ; then
194 echo "Can't find OnX package."
195 return
196fi
197if [ "${obuild_find_exe}" = "" ] ; then
198 echo "Variable obuild_find_exe not defined."
199 return
200fi
201obuild_G4Lab_path=`"${obuild_find_exe}" G4Lab 'v8r*'`
202if [ "${obuild_G4Lab_path}" = "" ] ; then
203 echo "Can't find G4Lab package."
204 return
205fi
206
207# Execute setup of used packages :
208if [ ! -e "${obuild_OnX_path}/obuild/setup.sh" ] ; then
209 echo "setup.sh not found for package OnX."
210 return
211fi
212. "${obuild_OnX_path}/obuild/setup.sh"
213
214if [ ! -e "${obuild_G4Lab_path}/obuild/setup.sh" ] ; then
215 echo "setup.sh not found for package G4Lab."
216 return
217fi
218. "${obuild_G4Lab_path}/obuild/setup.sh"
219
220# Set environment variables of this package :
221SNOVISROOT="${obuild_snovis_path}"
222export SNOVISROOT
223G4RADIOACTIVEDATA="${Geant4_home}/data/RadiativeDecay3.1"
224export G4RADIOACTIVEDATA
225G4LEVELGAMMADATA="${Geant4_home}/data/PhotonEvaporation2.0"
226export G4LEVELGAMMADATA
227G4LEDATA="${Geant4_home}/data/G4EMLOW4.2"
228export G4LEDATA
229NeutronHPCrossSections="${Geant4_home}/data/G4NDL3.10"
230export NeutronHPCrossSections
231
232if [ "${obuild_platform_exe}" = "" ] ; then
233 echo "Variable obuild_platform_exe not defined."
234 return
235fi
236obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
237if [ ${obuild_platform_result} = yes ] ; then
238if [ "${obuild_platform_exe}" = "" ] ; then
239 echo "Variable obuild_platform_exe not defined."
240 return
241fi
242obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
243if [ ${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
251fi
252unset obuild_platform_result
253else
254if [ "${obuild_platform_exe}" = "" ] ; then
255 echo "Variable obuild_platform_exe not defined."
256 return
257fi
258obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
259if [ ${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
267fi
268unset obuild_platform_result
269fi
270unset obuild_platform_result
271
272if [ "${obuild_platform_exe}" = "" ] ; then
273 echo "Variable obuild_platform_exe not defined."
274 return
275fi
276obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
277if [ ${obuild_platform_result} = yes ] ; then
278if [ "${obuild_platform_exe}" = "" ] ; then
279 echo "Variable obuild_platform_exe not defined."
280 return
281fi
282obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
283if [ ${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
291fi
292unset obuild_platform_result
293else
294if [ "${obuild_platform_exe}" = "" ] ; then
295 echo "Variable obuild_platform_exe not defined."
296 return
297fi
298obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
299if [ ${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
307fi
308unset obuild_platform_result
309fi
310unset obuild_platform_result
311
312if [ "${obuild_platform_exe}" = "" ] ; then
313 echo "Variable obuild_platform_exe not defined."
314 return
315fi
316obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
317if [ ${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
325else
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
333fi
334unset obuild_platform_result
335
336if [ "${PATH}" = "" ] ; then
337 PATH="${obuild_snovis_path}/${obuild_dir_bin}"
338 export PATH
339else
340 PATH="${PATH}:${obuild_snovis_path}/${obuild_dir_bin}"
341 export PATH
342fi
343unset obuild_snovis_path
344
345#FIXME unset obuild_platform
346#FIXME unset obuild_dir_bin
Note: See TracBrowser for help on using the repository browser.