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

Last change on this file since 134 was 134, checked in by barrand, 17 years ago
File size: 10.2 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} 'Darwin'`
117if [ ${obuild_platform_result} = yes ] ; then
118snova_platform="Darwin"
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} 'UNIX'`
126if [ ${obuild_platform_result} = yes ] ; then
127bhep_home="/Users/barrand/dev/exp/nemo/bhep/v1r4p2"
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} 'UNIX'`
144if [ ${obuild_platform_result} = yes ] ; then
145CLHEP_home="/usr/local/CLHEP/2.0.3.1"
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
154Geant4_home="/usr/local/geant4/8.2"
155fi
156unset obuild_platform_result
157if [ ! -e "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find" ] ; then
158  if [ ! -e "${obuild_snovis_path}/obuild/cpp/obuild_find.cpp" ] ; then
159    echo "Program source obuild_find.cpp not found."
160    return
161  fi
162  if [ "${obuild_cxx_command}" = "" ] ; then
163    if [  "${OBUILD_CXX}" != "" ] ; then
164      obuild_find_compiler=${OBUILD_CXX}
165    else
166      obuild_find_compiler=c++
167    fi
168  else
169    obuild_find_compiler=${obuild_cxx_command}
170  fi
171  ${obuild_find_compiler} -o "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find" "${obuild_snovis_path}/obuild/cpp/obuild_find.cpp"
172  unset obuild_find_compiler
173  if [ ! -e "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find" ] ; then
174    echo "Program obuild_find not found."
175    return
176  fi
177fi
178obuild_find_exe="${obuild_snovis_path}/${obuild_dir_bin}/obuild_find"
179if [ "${obuild_find_exe}" = "" ] ; then
180  echo "Variable obuild_find_exe not defined."
181  return
182fi
183obuild_OnX_path=`"${obuild_find_exe}" OnX 'v17r*'`
184if [ "${obuild_OnX_path}" = "" ] ; then
185  echo "Can't find OnX package."
186  return
187fi
188if [ "${obuild_find_exe}" = "" ] ; then
189  echo "Variable obuild_find_exe not defined."
190  return
191fi
192obuild_G4Lab_path=`"${obuild_find_exe}" G4Lab 'v8r*'`
193if [ "${obuild_G4Lab_path}" = "" ] ; then
194  echo "Can't find G4Lab package."
195  return
196fi
197
198# Execute setup of used packages :
199if [ ! -e "${obuild_OnX_path}/obuild/setup.sh" ] ; then
200  echo "setup.sh not found for package OnX."
201  return
202fi
203. "${obuild_OnX_path}/obuild/setup.sh"
204
205if [ ! -e "${obuild_G4Lab_path}/obuild/setup.sh" ] ; then
206  echo "setup.sh not found for package G4Lab."
207  return
208fi
209. "${obuild_G4Lab_path}/obuild/setup.sh"
210
211# Set environment variables of this package :
212SNOVISROOT="${obuild_snovis_path}"
213export SNOVISROOT
214G4RADIOACTIVEDATA="${Geant4_home}/data/RadiativeDecay3.1"
215export G4RADIOACTIVEDATA
216G4LEVELGAMMADATA="${Geant4_home}/data/PhotonEvaporation2.0"
217export G4LEVELGAMMADATA
218G4LEDATA="${Geant4_home}/data/G4EMLOW4.2"
219export G4LEDATA
220NeutronHPCrossSections="${Geant4_home}/data/G4NDL3.10"
221export NeutronHPCrossSections
222
223if [ "${obuild_platform_exe}" = "" ] ; then
224  echo "Variable obuild_platform_exe not defined."
225  return
226fi
227obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
228if [ ${obuild_platform_result} = yes ] ; then
229if [ "${obuild_platform_exe}" = "" ] ; then
230  echo "Variable obuild_platform_exe not defined."
231  return
232fi
233obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
234if [ ${obuild_platform_result} = yes ] ; then
235  if [  "${DYLD_LIBRARY_PATH}" = "" ] ; then
236    DYLD_LIBRARY_PATH="${bhep_home}/Darwin"
237    export DYLD_LIBRARY_PATH
238  else
239    DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${bhep_home}/Darwin"
240    export DYLD_LIBRARY_PATH
241  fi
242fi
243unset obuild_platform_result
244else
245if [ "${obuild_platform_exe}" = "" ] ; then
246  echo "Variable obuild_platform_exe not defined."
247  return
248fi
249obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
250if [ ${obuild_platform_result} = yes ] ; then
251  if [  "${LD_LIBRARY_PATH}" = "" ] ; then
252    LD_LIBRARY_PATH="${bhep_home}/Darwin"
253    export LD_LIBRARY_PATH
254  else
255    LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${bhep_home}/Darwin"
256    export LD_LIBRARY_PATH
257  fi
258fi
259unset obuild_platform_result
260fi
261unset obuild_platform_result
262
263if [ "${obuild_platform_exe}" = "" ] ; then
264  echo "Variable obuild_platform_exe not defined."
265  return
266fi
267obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
268if [ ${obuild_platform_result} = yes ] ; then
269if [ "${obuild_platform_exe}" = "" ] ; then
270  echo "Variable obuild_platform_exe not defined."
271  return
272fi
273obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
274if [ ${obuild_platform_result} = yes ] ; then
275  if [  "${DYLD_LIBRARY_PATH}" = "" ] ; then
276    DYLD_LIBRARY_PATH="${snova_home}/Darwin"
277    export DYLD_LIBRARY_PATH
278  else
279    DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${snova_home}/Darwin"
280    export DYLD_LIBRARY_PATH
281  fi
282fi
283unset obuild_platform_result
284else
285if [ "${obuild_platform_exe}" = "" ] ; then
286  echo "Variable obuild_platform_exe not defined."
287  return
288fi
289obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
290if [ ${obuild_platform_result} = yes ] ; then
291  if [  "${LD_LIBRARY_PATH}" = "" ] ; then
292    LD_LIBRARY_PATH="${snova_home}/Darwin"
293    export LD_LIBRARY_PATH
294  else
295    LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${snova_home}/Darwin"
296    export LD_LIBRARY_PATH
297  fi
298fi
299unset obuild_platform_result
300fi
301unset obuild_platform_result
302
303if [ "${obuild_platform_exe}" = "" ] ; then
304  echo "Variable obuild_platform_exe not defined."
305  return
306fi
307obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
308if [ ${obuild_platform_result} = yes ] ; then
309  if [  "${DYLD_LIBRARY_PATH}" = "" ] ; then
310    DYLD_LIBRARY_PATH="${obuild_snovis_path}/${obuild_dir_bin}"
311    export DYLD_LIBRARY_PATH
312  else
313    DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${obuild_snovis_path}/${obuild_dir_bin}"
314    export DYLD_LIBRARY_PATH
315  fi
316else
317  if [  "${LD_LIBRARY_PATH}" = "" ] ; then
318    LD_LIBRARY_PATH="${obuild_snovis_path}/${obuild_dir_bin}"
319    export LD_LIBRARY_PATH
320  else
321    LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${obuild_snovis_path}/${obuild_dir_bin}"
322    export LD_LIBRARY_PATH
323  fi
324fi
325unset obuild_platform_result
326
327if [  "${PATH}" = "" ] ; then
328  PATH="${obuild_snovis_path}/${obuild_dir_bin}"
329  export PATH
330else
331  PATH="${PATH}:${obuild_snovis_path}/${obuild_dir_bin}"
332  export PATH
333fi
334unset obuild_snovis_path
335
336#FIXME unset obuild_platform
337#FIXME unset obuild_dir_bin
Note: See TracBrowser for help on using the repository browser.