]> git.uio.no Git - u/mrichter/AliRoot.git/blob - AliGeant4/config/setup.csh
changed default to native STL, updated OGLHOME - both for HP-aCC
[u/mrichter/AliRoot.git] / AliGeant4 / config / setup.csh
1 # $Id$
2 # ----------------------------------------------------------------
3 # This script sets the default environment variables for
4 # Alice Geant4 based prototype
5 # Options: -g     verbose mode
6 #          local  recomended local configuration
7 #   
8 # csh version by I.Gonzalez  18.2.2000
9
10
11
12 #
13 # ==================================================================
14 # Alice configuration options: Please define your selection with the
15 # variables below.
16 # ==================================================================
17
18
19 #
20 # ====== AG4_VERSION
21 # Geant4 version
22 # If set: the provided Geant4 version and not the default one is set
23 #setenv AG4_VERSION 1.1
24
25 #
26 # ====== AG4_VISUALIZE
27 # Set/Unset to get/avoid Geant4 visualisation.
28 setenv AG4_VISUALIZE 1
29 #unsetenv AG4_VISUALIZE
30
31 #
32 # ====== AG4_OPACS
33 # Set/Unset to get OPACS as a Geant4 visualisation driver.
34 #setenv AG4_OPACS 1
35 unsetenv AG4_OPACS
36
37 #
38 # ====== AG4_STACKING
39 # If set: the secondary particles are not tracked immediatelly
40 #       when they are created but after the urgent stack is exhausted
41 # If not set: the G4 default stacking is used
42 setenv AG4_STACKING 1
43 #unsetenv AG4_STACKING
44
45 #
46 # ====== AG4_NOPHYSICS
47 # If set: only geantino or charged geantino can be shooted  
48 #setenv AG4_NOPHYSICS 1
49 unsetenv AG4_NOPHYSICS
50
51 #
52 # ====== AG4_MAKESHLIB
53 # If set: shared libraris are created
54 setenv AG4_MAKESHLIB 1
55 #unsetenv AG4_MAKESHLIB
56
57 #
58 # ====== AG4_ODBMS
59 # If set: the environment for using Objectivity is set. Not available on Linux?
60 #setenv AG4_ODBMS 1
61 unsetenv AG4_ODBMS
62
63
64 #
65 # Resolve input parameters
66 #
67 set VERBOSE = "NO"
68 set LOCAL = "NO"
69 foreach param ( $* )
70   switch ( $param )
71     case -g:
72       set VERBOSE="YES"; shift; breaksw;
73     case local:
74       set LOCAL="YES"; shift; breaksw;
75   endsw
76 end
77
78 #
79 # ==================================================================
80 # Key path variables
81 # ==================================================================
82 #
83
84 if ( "$LOCAL" == "NO" ) then
85   # 
86   # AFS
87   #
88
89   # ====== ALICE_BASE
90   # ALICE base directory
91   set ALICE_BASE = /afs/cern.ch/alice/offline
92
93   # ====== G4_BASE
94   # Geant4 base directory
95   set G4_BASE = ${ALICE_BASE}/geant4
96
97   # ====== LHCXX_BASE
98   # LHC++ base directory
99   set LHCXX_BASE = /afs/cern.ch/sw/lhcxx/specific/@sys
100
101   # ====== ROOT_BASE
102   # Root base directory  
103   set ROOT_BASE = /afs/cern.ch/alice/library/root
104   # to be removed after aCC support will be defined
105   # in the offline in a standard way    
106   if ( "`uname`" == "HP-UX" ) then 
107    set ROOT_BASE = /afs/cern.ch/alice/library/.hp_ux102/root.2.23.aCC
108   endif 
109
110   # ====== IRST_BASE
111   # IRST code check tool base directory
112   setenv IRST_BASE /afs/cern.ch/alice/offline/geant4/tools/IRST
113
114   # ====== OBJY_BASE
115   # Objectivity base directory
116   set OBJY_BASE = /afs/cern.ch/rd45/objectivity
117
118 else
119   # 
120   # recommended local installation
121   #
122
123   # ====== ALICE_BASE
124   # ALICE base directory
125   set ALICE_BASE = $HOME/dev
126
127   # ====== G4_BASE
128   # Geant4 base directory
129   set G4_BASE = $HOME/dev
130
131   # ====== LHCXX_BASE
132   # LHC++ base directory
133   set LHCXX_BASE = $HOME/dev
134
135   # ====== ROOT_BASE
136   # Root base directory  
137   set ROOT_BASE = $HOME/dev/root
138
139   # ====== IRST_BASE
140   # IRST code check tool base directory
141   setenv IRST_BASE $HOME/dev/tools/IRST
142
143 endif
144
145
146 #....................................... SKIP ................................
147 #
148 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
149 # You should not need to change 
150 # the lines below this one
151 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
152
153 # ====== AG4_INSTALL
154 # Alice Geant4 install directory
155 #
156 setenv AG4_INSTALL $ALICE_ROOT/AliGeant4
157
158 # Set variables depending on other variables
159 # if opacs is selected then select also visualize
160 if ( "$?AG4_OPACS" == 1 ) then
161   setenv AG4_VISUALIZE 1
162 endif
163
164 # Start the output
165 if ( "$VERBOSE" == "YES" ) then
166   echo " "
167   echo "    =========================================="
168   echo "      ALICE Geant4 environment configuration"
169   echo "    =========================================="
170
171   #
172   # Some output on the selections... 
173   #
174
175   if ("$?AG4_VISUALIZE" == 1) then
176     echo "Geant4 visualisation is     selected."
177   else
178     echo "Geant4 visualisation is NOT selected."
179   endif
180   if ("$?AG4_OPACS" == 1) then
181     echo "OPACS driver         is     selected."
182   else
183     echo "OPACS driver         is NOT selected."
184   endif
185   if ("$?AG4_TOY" == 1) then
186     echo "Toy geometry         is     selected"
187   else
188     echo "Full geometry        is     selected"
189   endif
190   if ("$?AG4_STACKING" == 1) then
191     echo "Secondaries will be tracked after the urgent stack is exhausted."
192   else
193     echo "The Geant4 default stackin will be used."
194   endif
195   if ("$?AG4_NOPHYSICS" == 1) then
196     echo "Only geantino or charged geantino can be shooted."
197   else
198     echo "Full physics has been selected."
199   endif
200   if ("$?AG4_ODBMS" == 1) then
201     echo "The environment for using Objectivity will be set."
202   else
203     echo "No Geant4 Persistency."
204   endif
205
206 endif
207
208 #
209 # ROOT Alice definitions & options
210 # ==================================
211 #
212 if ( "$?ROOTSYS" == 0 ) then
213   setenv ROOTSYS ${ROOT_BASE}
214 endif
215 if ( "$VERBOSE" == "YES" ) then
216   echo " "
217   echo "ROOT"
218   echo "===="
219   echo ROOTSYS set to $ROOTSYS
220 endif
221
222 #
223 # ODBMS Alice definitions & options
224 # ==================================
225 #
226 if ( "$VERBOSE" == "YES" ) then
227   echo " "
228   echo "ODBMS & Objectivity"
229   echo "==================="
230 endif
231 if ( "$?AG4_ODBMS" == 1 ) then
232   if ( "$VERBOSE" == "YES" ) then
233     echo Setting ODBMS Alice definitions & options...
234   endif
235   setenv G4ODBMS 1
236   unsetenv AG4_VISUALIZE
237   setenv ALBOOT_DIR $AG4_INSTALL/ObjyDatabase
238   setenv ALBOOT_NAME Alice
239   setenv ALBOOT $ALBOOT_DIR/$ALBOOT_NAME
240   if ( ! -d $ALBOOT_DIR ) then
241     echo "  Making new directory $ALBOOT_DIR ..."
242     mkdir $ALBOOT_DIR
243   endif
244 else
245   if ( "$VERBOSE" == "YES" ) then
246     echo Unsetting ODBMS Alice definitions \& options...
247   endif
248   unsetenv G4ODBMS
249   unsetenv ALBOOT_DIR
250   unsetenv ALBOOT_NAME
251   unsetenv ALBOOT
252 endif
253 #
254 # Objectivity G4 options
255 # according to run/example5/g4odbms_setup.sh
256 #
257 if ( "$?G4ODBMS" == 1 ) then
258   setenv OBJY_VERS 4.0.2
259   if ( -r $OBJY_BASE/objyenv.csh ) then
260     source $OBJY_BASE/objyenv.csh
261     if ( "$VERBOSE" == "YES" ) then
262       echo "  Environment for Objectivity has been set."
263     endif
264   endif
265   setenv HEP_ODBMS_DIR ${LHCXX_BASE}/HepODBMS/0.0
266   setenv HEP_ODBMS_INCLUDES $HEP_ODBMS_DIR/include
267 endif
268
269
270 #
271 # Geant4  
272 # ==================================
273 #
274 if ( "$VERBOSE" == "YES" ) then
275   echo " "
276   echo "Geant4 env. variables..."
277   echo "============================"
278 endif
279 if ("$?AG4_VERSION" == 0) then
280   setenv G4INSTALL ${G4_BASE}/geant4
281 else
282   setenv G4INSTALL ${G4_BASE}/g4dev/geant4.${AG4_VERSION}
283 endif
284
285 if ("$?AG4_MAKESHLIB" == 0) then
286   unsetenv G4MAKESHLIB 
287 else 
288   setenv G4MAKESHLIB ${G4INSTALL}/config/makeshlib.sh
289 endif  
290
291 # path to data files needed by hadronic processes
292 setenv G4LEVELGAMMADATA ${G4INSTALL}/data/PhotonEvaporation
293
294 # This is architecture dependent...
295 set SYSTEM = `uname`
296 if ( $SYSTEM == "HP-UX" ) then
297   setenv G4SYSTEM "HP-aCC"
298   #setenv G4USE_OSPACE 1      # compiling with Object Space STL
299   setenv G4NO_STD_NAMESPACE 1 # required when compiling with native STL
300                               # (check if needed for geant4.2.0)
301 endif 
302 if ( $SYSTEM == "Linux" ) then
303   setenv G4SYSTEM "Linux-g++"
304 endif
305 if ( "$VERBOSE" == "YES" ) then
306   echo "Architecture is $SYSTEM"
307   echo "Geant4 is istalled in $G4INSTALL"
308   echo "Geant4 architecture type is $G4SYSTEM"
309   if ( "$?G4USE_OSPACE" == 1 ) then
310     echo "ObjectSpace will be used for STL"
311   endif
312 endif
313
314
315 #
316 # CLHEP
317 # ==================================
318 #
319
320 if ( -d $LHCXX_BASE/CLHEP/new ) then
321   setenv CLHEP_BASE_DIR $LHCXX_BASE/CLHEP/new
322 else
323   echo "WARNING: CLHEP has not been found in the default path."
324   if ( "$VERBOSE" == "YES" ) then
325     echo "         Please set the variable CLHEP_BASE_DIR to its base path"
326     echo "         Example: setenv  CLHEP_BASE_DIR /afs/cern.ch/sw/lhcxx/specific/@sys/CLHEP/pro"
327   endif
328 endif
329 if ( "$VERBOSE" == "YES" ) then
330   echo "CLHEP base directory: $CLHEP_BASE_DIR"
331 endif
332
333
334 #
335 # Visualization
336 # ==================================
337 #
338
339 if ( "$?AG4_VISUALIZE" == 1 ) then
340   if ( "$VERBOSE" == "YES" ) then
341     echo "G4 Visualization env. variables..."
342   endif
343
344   #
345   # Xm UI
346   #
347   if ( "$VERBOSE" == "YES" ) then
348     echo "* X11 with Motif..."
349   endif
350   setenv G4UI_BUILD_XM_DRIVER  1
351   setenv G4UI_BUILD_XM_SESSION 1
352   setenv G4UI_USE_XM           1
353
354   #
355   # Fukui Renderer
356   #
357   if ( "$VERBOSE" == "YES" ) then
358     echo "* Fukui Renderer (DAWN)..."
359   endif
360   setenv G4VIS_BUILD_DAWN_DRIVER     1
361   setenv G4VIS_BUILD_DAWNFILE_DRIVER 1
362   setenv G4VIS_USE_DAWN              1
363   setenv G4VIS_USE_DAWNFILE          1
364   setenv G4DAWNFILE_VIEWER   david
365   setenv DAWN_HOME ${G4_BASE}/tools/bin
366   if ( "`echo ${PATH} | grep ${DAWN_HOME} `" == "" ) then
367     setenv PATH "${PATH}:${DAWN_HOME}"
368     rehash
369   endif
370   setenv G4DAWN_MULTI_WINDOW 1
371   if ( $SYSTEM == "Linux" ) then
372     setenv G4DAWN_NAMED_PIPE 1
373   endif
374
375   if ( "$VERBOSE" == "YES" ) then
376     if ("$?G4VIS_USE_DAWN" == 1) then
377       echo "  Dawn driver activated"
378     endif
379     if ("$?G4VIS_USE_DAWNFILE" == 1) then
380       echo "  Dawn file driver activated"
381     endif
382     if ("$?G4DAWNFILE_VIEWER" == 1) then
383       echo "  Dawn file viewer set to ${G4DAWNFILE_VIEWER}"
384     endif
385     if ("$?DAWN_HOME" == 1) then
386       echo "  Dawn home path set to ${DAWN_HOME}"
387     endif
388     if ("$?G4DAWN_MULTI_WINDOW" == 1) then
389       echo "  Dawn multi window selected"
390     endif
391     if ("$?G4DAWN_NAMED_PIPE" == 1) then
392       echo "  Dawn named pipe selected"
393     endif
394   endif
395
396   # David flags
397   # Set colors for overlappings
398   setenv DAVID_RAINBOW_FLAG 1
399   #setenv DAVID_HIGHLIGHT_COLOR_R  r
400   #setenv DAVID_HIGHLIGHT_COLOR_G  g
401   #setenv DAVID_HIGHLIGHT_COLOR_B  b
402
403   # If set volumes names are shown
404   setenv DAVID_DISPLAY_PVNAME   1
405   # If set supresses the call to dawn
406   #setenv DAVID_NO_VIEW  1
407   setenv DAVID_EPSILON_3D  0.001
408
409   if ( "$VERBOSE" == "YES" ) then
410     if ("$?DAVID_RAINBOW_FLAG" == 1) then
411       echo "  DAVID Rainbow mode is ON"
412     endif
413     if ("$?DAVID_HIGHLIGHT_COLOR_R" == 1) then
414       echo "  DAVID Highlight color (Red) set to ${DAVID_HIGHLIGHT_COLOR_R}"
415     endif
416     if ("$?DAVID_HIGHLIGHT_COLOR_G" == 1) then
417       echo "  DAVID Highlight color (Green) set to ${DAVID_HIGHLIGHT_COLOR_G}"
418     endif
419     if ("$?DAVID_HIGHLIGHT_COLOR_B" == 1) then
420       echo "  DAVID Highlight color (Blue) set to ${DAVID_HIGHLIGHT_COLOR_B}"
421     endif
422     if ("$?DAVID_DISPLAY_PVNAME" == 1) then
423       echo "  DAVID will display intersected volumes name"
424     endif
425     if ("$?DAVID_DISPLAY_PVNAME" == 1) then
426       echo "  Dawn will not be called from DAVID"
427     endif
428     if ("$?DAVID_EPSILON_3D" == 1) then
429       echo "  DAVID tolerance set to ${DAVID_EPSILON_3D}"
430     endif
431   endif
432
433   #
434   # OpenGL
435   #
436   if ( "$VERBOSE" == "YES" ) then
437     echo "* OpenGL..."
438   endif
439   setenv G4VIS_BUILD_OPENGLX_DRIVER  1
440   setenv G4VIS_BUILD_OPENGLXM_DRIVER 1
441   setenv G4VIS_USE_OPENGLX           1
442   setenv G4VIS_USE_OPENGLXM          1
443   setenv OGLHOME /usr/local
444   setenv OGLLIBS "-L$OGLHOME/lib -lMesaGLU -lMesaGL"
445
446   if ( "$VERBOSE" == "YES" ) then
447     if ("$?G4VIS_USE_OPENGLX" == 1) then
448       echo "  OpenGL and  X11 driver activated"
449     endif
450     if ("$?G4VIS_USE_OPENGLXM" == 1) then
451       echo "  OpenGL with Motif extension driver activated"
452     endif
453     if ("$?OGLHOME" == 1) then
454       echo "  OpenGL path set to ${OGLHOME}"
455     endif
456     if ("$?OGLLIBS" == 1) then
457       echo "  OpenGL libraries set to ${OGLLIBS}"
458     endif
459   endif
460
461   #
462   # OpenInventor
463   #
464   if ( "$VERBOSE" == "YES" ) then
465     echo "* OpenInventor..."
466   endif
467   #setenv G4VIS_USE_OPENINVENTOR 1
468   #setenv OIHOME whatever
469   #setenv HEPVISDIR something
470   if ( "$VERBOSE" == "YES" ) then
471     if ("$?G4VIS_USE_OPENINVENTOR" == 1) then
472       echo "  OpenInventor driver activated"
473       echo "  OpenInventor path is ${OIHOME}"
474       echo "  HepVis path is ${HEPVISDIR}"
475     endif
476   endif
477
478   #
479   # VRML1
480   #
481   if ( "$VERBOSE" == "YES" ) then
482     echo "* VRML..."
483   endif
484   setenv G4VIS_BUILD_VRML_DRIVER        1
485   setenv G4VIS_BUILD_VRMLFILE_DRIVER    1
486   setenv G4VIS_USE_VRML                 1
487   setenv G4VIS_USE_VRMLFILE             1
488   #Set preferred vrml viewer to be invoked in this mode
489   setenv G4VRMLFILE_VIEWER vrweb
490   #Set host name for VRML1 visualization.... the g4vrmlview machine!
491   setenv G4VRML_HOST_NAME nohost
492   #Command to run java listener for VRML driver
493   #alias javavrml "java -classpath $G4_BASE/tools/bin/java g4vrmlview vrweb"
494
495   if ( "$VERBOSE" == "YES" ) then
496     if ("$?G4VIS_USE_VRML" == 1) then
497       echo "  VRML driver activated"
498       echo "  Host Name for remote visualization is ${G4VRML_HOST_NAME}"
499     endif
500     if ("$?G4VIS_USE_VRMLFILE" == 1) then
501       echo "  VRML file driver activated"
502       echo "  VRML viewer set to ${G4VRMLFILE_VIEWER}"
503     endif
504   endif
505
506   #
507   # Ray Tracer
508   #
509   if ( "$VERBOSE" == "YES" ) then
510     echo "* Ray Tracer..."
511   endif
512   #setenv G4VIS_BUILD_RAYTRACER_DRIVER 1
513   #setenv G4VIS_USE_RAYTRACER          1
514   if ( "$VERBOSE" == "YES" ) then
515     if ("$?G4VIS_USE_RAYTRACER" == 1) then
516       echo "  Ray tracing driver activated"
517     endif
518   endif
519
520   #
521   # GAG
522   #
523   if ( "$VERBOSE" == "YES" ) then
524     echo "* Geant Adaptative GUI (GAG)..."
525   endif
526   setenv G4UI_BUILD_GAG_SESSION 1
527   setenv G4UI_USE_GAG           1
528   setenv MOMOPATH     ${G4_BASE}/tools/GAG/tcltk
529   if ( "`echo ${PATH} | grep ${MOMOPATH} `" == "" ) then
530     setenv PATH "${PATH}:${MOMOPATH}"
531     rehash
532   endif
533   set    NCLASSPATH = ".:${G4_BASE}/tools/swing-1.0.3/swingall.jar:${G4_BASE}/tools/GAG/java/GAG.jar"
534   if ("$?CLASSPATH" == 0) then
535     setenv CLASSPATH $NCLASSPATH
536   else
537     if ( "`echo ${CLASSPATH} | grep ${NCLASSPATH} `" == "" ) then
538       setenv CLASSPATH "${CLASSPATH}:${NCLASSPATH}"
539     endif
540   endif
541
542   if ( "$VERBOSE" == "YES" ) then
543     if ("$?G4UI_USE_GAG" == 1) then
544       echo "  GAG UI activated"
545       echo "  Momo path set to $MOMOPATH"
546       echo "    NOTE: Run "\'tmomo\' "to use Momo (TK/Tcl version)"
547       echo "  The path to the java GAG code was updated"
548       echo "    NOTE: Run "\'java gag\'" to use GAG (java version)"
549     endif
550   endif
551
552 else
553   if ( "$VERBOSE" == "YES" ) then
554     echo Unsetting G4 Visualization env. variables...
555   endif
556
557   #XM
558   unsetenv G4UI_BUILD_XM_DRIVER
559   unsetenv G4UI_BUILD_XM_SESSION
560   unsetenv G4UI_USE_XM
561
562   # Dawn
563   unsetenv G4VIS_BUILD_DAWN_DRIVER
564   unsetenv G4VIS_BUILD_DAWNFILE_DRIVER
565   unsetenv G4VIS_USE_DAWN
566   unsetenv G4VIS_USE_DAWNFILE
567   unsetenv G4DAWNFILE_VIEWER
568   unsetenv DAWN_HOME
569   unsetenv G4DAWN_MULTI_WINDOW
570   if ( $SYSTEM == "Linux" ) then
571     unsetenv G4DAWN_NAMED_PIPE
572   endif
573
574   # David
575   unsetenv DAVID_RAINBOW_FLAG
576   unsetenv DAVID_HIGHLIGHT_COLOR_R
577   unsetenv DAVID_HIGHLIGHT_COLOR_G
578   unsetenv DAVID_HIGHLIGHT_COLOR_B
579   unsetenv DAVID_DISPLAY_PVNAME
580   unsetenv DAVID_NO_VIEW
581   unsetenv DAVID_EPSILON_3D
582   
583   # OpenGL
584   unsetenv G4VIS_BUILD_OPENGLX_DRIVER
585   unsetenv G4VIS_BUILD_OPENGLXM_DRIVER
586   unsetenv G4VIS_USE_OPENGLX
587   unsetenv G4VIS_USE_OPENGLXM
588   unsetenv OGLHOME
589   unsetenv OGLLIBS
590
591   # OpenInventor
592   unsetenv G4VIS_USE_OPENINVENTOR
593
594   # VRML1
595   unsetenv G4VIS_BUILD_VRML_DRIVER
596   unsetenv G4VIS_BUILD_VRMLFILE_DRIVER
597   unsetenv G4VIS_USE_VRML
598   unsetenv G4VIS_USE_VRMLFILE
599   unsetenv G4VRMLFILE_VIEWER
600   unsetenv G4VRML_HOST_NAME
601
602   # GAG
603   unsetenv G4UI_BUILD_GAG_SESSION
604   unsetenv G4UI_USE_GAG
605   unsetenv MOMOPATH
606
607 endif
608
609 #
610 # OPACS
611 #
612 if ( "$?AG4_OPACS" == 1 ) then
613   if ( "$VERBOSE" == "YES" ) then
614     echo "* OPACS..."
615   endif
616   setenv AG4_VISUALIZE 1
617
618   #
619   # OpenGL: needed by OPACS
620   #
621   setenv G4VIS_BUILD_OPENGLX_DRIVER 1
622   setenv G4VIS_USE_OPENGLX          1
623   if ( $SYSTEM == "Linux" ) then
624     setenv OGLHOME /usr/local
625     setenv OGLLIBS "-L$OGLHOME/lib -lMesaGLU -lMesaGL"
626   else
627     setenv OGLHOME $LHCXX_BASE/OpenGL/pro
628   endif
629
630   #
631   # OPACS
632   #
633   setenv G4VIS_BUILD_OPACS_DRIVER 1
634   setenv G4UI_BUILD_WO_DRIVER     1
635   setenv G4UI_BUILD_WO_SESSION    1
636   setenv G4VIS_USE_OPACS          1
637   setenv G4UI_USE_WO              1
638   setenv OPACS_HOME $G4_BASE/tools/OPACS
639   #setenv OPACS_HOME /afs/cern.ch/rd44/dev/OPACS
640   if ( $SYSTEM == "Linux" ) then
641     setenv G4_OPACS_WIDGET_SET lesstif
642   else
643     setenv G4_OPACS_WIDGET_SET Xm
644   endif
645   source $OPACS_HOME/OPACS/v3/setup.csh
646   setenv WOENVIRONMENT $AG4_INSTALL/bin/Alice.odb
647   setenv OPATH "$OPATH $G4INSTALL/environments/OPACS/usr"
648   if ( "$VERBOSE" == "YES" ) then
649     if ("$?G4VIS_USE_OPACS" == 1) then
650       echo "  OPACS driver activated"
651       echo "  OPACS path set to $OPACS_HOME"
652     endif
653   endif
654 else   
655   if ( "$VERBOSE" == "YES" ) then
656     echo "* Unsetting OPACS driver env. variables ..."
657   endif
658   unsetenv G4VIS_BUILD_OPACS_DRIVER
659   unsetenv G4UI_BUILD_WO_DRIVER
660   unsetenv G4UI_BUILD_WO_SESSION
661   unsetenv G4VIS_USE_OPACS
662   unsetenv G4UI_USE_WO
663   unsetenv OPACS_HOME
664   unsetenv G4_OPACS_WIDGET_SET
665   unsetenv G4OROOT
666   unsetenv WOENVIRONMENT
667   unsetenv OPATH
668 endif
669
670 #
671 # path to Alice executable and config scripts
672 #  
673 if ( "`echo ${PATH} | grep ${AG4_INSTALL}/bin/${G4SYSTEM} `" == "" ) then
674   if ( "$VERBOSE" == "YES" ) then
675     echo Adding $AG4_INSTALL/bin/$G4SYSTEM to the path...
676   endif
677   setenv PATH "${PATH}:${AG4_INSTALL}/bin/${G4SYSTEM}"
678 endif
679 if ( "`echo ${PATH} | grep ${AG4_INSTALL}/config `" == "" ) then
680   if ( "$VERBOSE" == "YES" ) then
681     echo Adding ${AG4_INSTALL}/config to the path...
682   endif
683   setenv PATH "${PATH}:${AG4_INSTALL}/config"
684 endif
685
686 #
687 # path to shared libraries
688
689 if ( $SYSTEM == "HP-UX" ) then
690   set SHLIBVAR = $SHLIB_PATH
691   set SHLIBVARNAME = SHLIB_PATH
692 endif 
693 if ( $SYSTEM == "Linux" ) then
694   set SHLIBVAR = $LD_LIBRARY_PATH
695   set SHLIBVARNAME = LD_LIBRARY_PATH
696 endif
697 if ( "`echo ${SHLIBVAR} | grep ${AG4_INSTALL}/lib/${G4SYSTEM} `" == "" ) then
698   if ( "$VERBOSE" == "YES" ) then
699     echo Adding ${AG4_INSTALL}/lib/${G4SYSTEM} to the shared libraries path...
700   endif
701   set SHLIBVAR="${AG4_INSTALL}/lib/${G4SYSTEM}:${SHLIBVAR}"
702 endif
703
704 if ( "`echo ${SHLIBVAR} | grep ${G4INSTALL}/lib/${G4SYSTEM} `" == "" ) then
705   if ( "$VERBOSE" == "YES" ) then
706     echo Adding ${G4INSTALL}/lib/${G4SYSTEM} to the shared libraries path...
707   endif
708   set SHLIBVAR="${G4INSTALL}/lib/${G4SYSTEM}:${SHLIBVAR}"
709 endif
710
711 setenv $SHLIBVARNAME $SHLIBVAR
712
713
714 #
715 # Remove unneeded variables. If this is not done the vars. remain in the env.
716 #
717
718 unset ALICE_BASE
719 unset G4_BASE
720 unset LHCXX_BASE
721 unset OBJY_BASE
722 unset SYSTEM
723 unset NCLASSPATH
724 unset SHLIBVAR
725 unset SHLIBVARNAME
726 unset LOCAL
727 unset VERBOSE
728
729 echo "Default ALICE environment for GEANT4 has been set."