1 | #!/bin/sh -f |
---|
2 | |
---|
3 | # |
---|
4 | # File produced by the obuild tool version 1.0 |
---|
5 | # for the package snova with version v2r0p0. |
---|
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_snova_path="@@absolute_dir@@" |
---|
44 | |
---|
45 | if [ "${obuild_snova_path}" = '@@absolute_dir@@' ] ; then |
---|
46 | echo ' The package snova had not been installed.' |
---|
47 | echo '' |
---|
48 | echo ' In the file :' |
---|
49 | echo ' snova/<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=bin_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_snova_path}/${obuild_dir_bin}/obuild_platform" ] ; then |
---|
91 | if [ ! -e "${obuild_snova_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_snova_path}/${obuild_dir_bin}/obuild_platform" "${obuild_snova_path}/obuild/cpp/obuild_platform.cpp" |
---|
105 | unset obuild_platform_compiler |
---|
106 | if [ ! -e "${obuild_snova_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_snova_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 | CLHEP_home="/usr/local/CLHEP/2.0.3.1" |
---|
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} 'UNIX'` |
---|
126 | if [ ${obuild_platform_result} = yes ] ; then |
---|
127 | Geant4_home="/usr/local/geant4/8.2" |
---|
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 | HDF5_home="/usr/local/HDF5/1.6.5" |
---|
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} 'UNIX'` |
---|
144 | if [ ${obuild_platform_result} = yes ] ; then |
---|
145 | zlib_home="/usr" |
---|
146 | fi |
---|
147 | unset obuild_platform_result |
---|
148 | if [ ! -e "${obuild_snova_path}/${obuild_dir_bin}/obuild_find" ] ; then |
---|
149 | if [ ! -e "${obuild_snova_path}/obuild/cpp/obuild_find.cpp" ] ; then |
---|
150 | echo "Program source obuild_find.cpp not found." |
---|
151 | return |
---|
152 | fi |
---|
153 | if [ "${obuild_cxx_command}" = "" ] ; then |
---|
154 | if [ "${OBUILD_CXX}" != "" ] ; then |
---|
155 | obuild_find_compiler=${OBUILD_CXX} |
---|
156 | else |
---|
157 | obuild_find_compiler=c++ |
---|
158 | fi |
---|
159 | else |
---|
160 | obuild_find_compiler=${obuild_cxx_command} |
---|
161 | fi |
---|
162 | ${obuild_find_compiler} -o "${obuild_snova_path}/${obuild_dir_bin}/obuild_find" "${obuild_snova_path}/obuild/cpp/obuild_find.cpp" |
---|
163 | unset obuild_find_compiler |
---|
164 | if [ ! -e "${obuild_snova_path}/${obuild_dir_bin}/obuild_find" ] ; then |
---|
165 | echo "Program obuild_find not found." |
---|
166 | return |
---|
167 | fi |
---|
168 | fi |
---|
169 | obuild_find_exe="${obuild_snova_path}/${obuild_dir_bin}/obuild_find" |
---|
170 | if [ "${obuild_find_exe}" = "" ] ; then |
---|
171 | echo "Variable obuild_find_exe not defined." |
---|
172 | return |
---|
173 | fi |
---|
174 | obuild_bhep_path=`"${obuild_find_exe}" bhep 'v1r4p2'` |
---|
175 | if [ "${obuild_bhep_path}" = "" ] ; then |
---|
176 | echo "Can't find bhep package." |
---|
177 | return |
---|
178 | fi |
---|
179 | |
---|
180 | # Execute setup of used packages : |
---|
181 | if [ ! -e "${obuild_bhep_path}/obuild/setup.sh" ] ; then |
---|
182 | echo "setup.sh not found for package bhep." |
---|
183 | return |
---|
184 | fi |
---|
185 | . "${obuild_bhep_path}/obuild/setup.sh" |
---|
186 | |
---|
187 | # Set environment variables of this package : |
---|
188 | |
---|
189 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
190 | echo "Variable obuild_platform_exe not defined." |
---|
191 | return |
---|
192 | fi |
---|
193 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'` |
---|
194 | if [ ${obuild_platform_result} = yes ] ; then |
---|
195 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
196 | echo "Variable obuild_platform_exe not defined." |
---|
197 | return |
---|
198 | fi |
---|
199 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
200 | if [ ${obuild_platform_result} = yes ] ; then |
---|
201 | if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then |
---|
202 | DYLD_LIBRARY_PATH="${HDF5_home}/lib" |
---|
203 | export DYLD_LIBRARY_PATH |
---|
204 | else |
---|
205 | DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${HDF5_home}/lib" |
---|
206 | export DYLD_LIBRARY_PATH |
---|
207 | fi |
---|
208 | fi |
---|
209 | unset obuild_platform_result |
---|
210 | else |
---|
211 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
212 | echo "Variable obuild_platform_exe not defined." |
---|
213 | return |
---|
214 | fi |
---|
215 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
216 | if [ ${obuild_platform_result} = yes ] ; then |
---|
217 | if [ "${LD_LIBRARY_PATH}" = "" ] ; then |
---|
218 | LD_LIBRARY_PATH="${HDF5_home}/lib" |
---|
219 | export LD_LIBRARY_PATH |
---|
220 | else |
---|
221 | LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${HDF5_home}/lib" |
---|
222 | export LD_LIBRARY_PATH |
---|
223 | fi |
---|
224 | fi |
---|
225 | unset obuild_platform_result |
---|
226 | fi |
---|
227 | unset obuild_platform_result |
---|
228 | |
---|
229 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
230 | echo "Variable obuild_platform_exe not defined." |
---|
231 | return |
---|
232 | fi |
---|
233 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'` |
---|
234 | if [ ${obuild_platform_result} = yes ] ; then |
---|
235 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
236 | echo "Variable obuild_platform_exe not defined." |
---|
237 | return |
---|
238 | fi |
---|
239 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
240 | if [ ${obuild_platform_result} = yes ] ; then |
---|
241 | if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then |
---|
242 | DYLD_LIBRARY_PATH="${CLHEP_home}/lib" |
---|
243 | export DYLD_LIBRARY_PATH |
---|
244 | else |
---|
245 | DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${CLHEP_home}/lib" |
---|
246 | export DYLD_LIBRARY_PATH |
---|
247 | fi |
---|
248 | fi |
---|
249 | unset obuild_platform_result |
---|
250 | else |
---|
251 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
252 | echo "Variable obuild_platform_exe not defined." |
---|
253 | return |
---|
254 | fi |
---|
255 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
256 | if [ ${obuild_platform_result} = yes ] ; then |
---|
257 | if [ "${LD_LIBRARY_PATH}" = "" ] ; then |
---|
258 | LD_LIBRARY_PATH="${CLHEP_home}/lib" |
---|
259 | export LD_LIBRARY_PATH |
---|
260 | else |
---|
261 | LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${CLHEP_home}/lib" |
---|
262 | export LD_LIBRARY_PATH |
---|
263 | fi |
---|
264 | fi |
---|
265 | unset obuild_platform_result |
---|
266 | fi |
---|
267 | unset obuild_platform_result |
---|
268 | |
---|
269 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
270 | echo "Variable obuild_platform_exe not defined." |
---|
271 | return |
---|
272 | fi |
---|
273 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'` |
---|
274 | if [ ${obuild_platform_result} = yes ] ; then |
---|
275 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
276 | echo "Variable obuild_platform_exe not defined." |
---|
277 | return |
---|
278 | fi |
---|
279 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
280 | if [ ${obuild_platform_result} = yes ] ; then |
---|
281 | if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then |
---|
282 | DYLD_LIBRARY_PATH="${Geant4_home}/lib" |
---|
283 | export DYLD_LIBRARY_PATH |
---|
284 | else |
---|
285 | DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${Geant4_home}/lib" |
---|
286 | export DYLD_LIBRARY_PATH |
---|
287 | fi |
---|
288 | fi |
---|
289 | unset obuild_platform_result |
---|
290 | else |
---|
291 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
292 | echo "Variable obuild_platform_exe not defined." |
---|
293 | return |
---|
294 | fi |
---|
295 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
296 | if [ ${obuild_platform_result} = yes ] ; then |
---|
297 | if [ "${LD_LIBRARY_PATH}" = "" ] ; then |
---|
298 | LD_LIBRARY_PATH="${Geant4_home}/lib" |
---|
299 | export LD_LIBRARY_PATH |
---|
300 | else |
---|
301 | LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${Geant4_home}/lib" |
---|
302 | export LD_LIBRARY_PATH |
---|
303 | fi |
---|
304 | fi |
---|
305 | unset obuild_platform_result |
---|
306 | fi |
---|
307 | unset obuild_platform_result |
---|
308 | |
---|
309 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
310 | echo "Variable obuild_platform_exe not defined." |
---|
311 | return |
---|
312 | fi |
---|
313 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'` |
---|
314 | if [ ${obuild_platform_result} = yes ] ; then |
---|
315 | if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then |
---|
316 | DYLD_LIBRARY_PATH="${obuild_snova_path}/${obuild_dir_bin}" |
---|
317 | export DYLD_LIBRARY_PATH |
---|
318 | else |
---|
319 | DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${obuild_snova_path}/${obuild_dir_bin}" |
---|
320 | export DYLD_LIBRARY_PATH |
---|
321 | fi |
---|
322 | else |
---|
323 | if [ "${LD_LIBRARY_PATH}" = "" ] ; then |
---|
324 | LD_LIBRARY_PATH="${obuild_snova_path}/${obuild_dir_bin}" |
---|
325 | export LD_LIBRARY_PATH |
---|
326 | else |
---|
327 | LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${obuild_snova_path}/${obuild_dir_bin}" |
---|
328 | export LD_LIBRARY_PATH |
---|
329 | fi |
---|
330 | fi |
---|
331 | unset obuild_platform_result |
---|
332 | |
---|
333 | if [ "${PATH}" = "" ] ; then |
---|
334 | PATH="${obuild_snova_path}/${obuild_dir_bin}" |
---|
335 | export PATH |
---|
336 | else |
---|
337 | PATH="${PATH}:${obuild_snova_path}/${obuild_dir_bin}" |
---|
338 | export PATH |
---|
339 | fi |
---|
340 | unset obuild_snova_path |
---|
341 | |
---|
342 | #FIXME unset obuild_platform |
---|
343 | #FIXME unset obuild_dir_bin |
---|