]> git.uio.no Git - u/mrichter/AliRoot.git/blob - AliGeant4/config/setup.csh
CLHEP version changed to 1.6.0.0
[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 2.0_test
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 endif 
300 if ( $SYSTEM == "Linux" ) then
301   setenv G4SYSTEM "Linux-g++"
302 endif
303 if ( $SYSTEM == "OSF1" ) then
304   setenv G4SYSTEM "DEC-cxx"
305   #setenv G4NO_STD_NAMESPACE 1  # compiling witn non ISO/ANSI setup
306 endif 
307 if ( $SYSTEM == "SunOS" ) then
308   setenv G4SYSTEM "SUN-CC"
309   setenv G4USE_OSPACE 1         # compiling with Object Space STL
310 endif 
311 if ( "$VERBOSE" == "YES" ) then
312   echo "Architecture is $SYSTEM"
313   echo "Geant4 is istalled in $G4INSTALL"
314   echo "Geant4 architecture type is $G4SYSTEM"
315   if ( "$?G4USE_OSPACE" == 1 ) then
316     echo "ObjectSpace will be used for STL"
317   endif
318 endif
319
320
321 #
322 # CLHEP
323 # ==================================
324 #
325
326 if ( -d $LHCXX_BASE/CLHEP/1.5.0.0 ) then
327   setenv CLHEP_BASE_DIR $LHCXX_BASE/CLHEP/1.6.0.0
328 else
329   echo "WARNING: CLHEP has not been found in the default path."
330   if ( "$VERBOSE" == "YES" ) then
331     echo "         Please set the variable CLHEP_BASE_DIR to its base path"
332     echo "         Example: setenv  CLHEP_BASE_DIR /afs/cern.ch/sw/lhcxx/specific/@sys/CLHEP/pro"
333   endif
334 endif
335 if ( "$VERBOSE" == "YES" ) then
336   echo "CLHEP base directory: $CLHEP_BASE_DIR"
337 endif
338
339
340 #
341 # Visualization
342 # ==================================
343 #
344
345 if ( "$?AG4_VISUALIZE" == 1 ) then
346   if ( "$VERBOSE" == "YES" ) then
347     echo "G4 Visualization env. variables..."
348   endif
349
350   #
351   # Xm UI
352   #
353   if ( "$VERBOSE" == "YES" ) then
354     echo "* X11 with Motif..."
355   endif
356   setenv G4UI_BUILD_XM_DRIVER  1
357   setenv G4UI_BUILD_XM_SESSION 1
358   setenv G4UI_USE_XM           1
359
360   #
361   # Fukui Renderer
362   #
363   if ( "$VERBOSE" == "YES" ) then
364     echo "* Fukui Renderer (DAWN)..."
365   endif
366   setenv G4VIS_BUILD_DAWN_DRIVER     1
367   setenv G4VIS_BUILD_DAWNFILE_DRIVER 1
368   setenv G4VIS_USE_DAWN              1
369   setenv G4VIS_USE_DAWNFILE          1
370   setenv G4DAWNFILE_VIEWER   david
371   setenv DAWN_HOME ${G4_BASE}/tools/bin
372   if ( "`echo ${PATH} | grep ${DAWN_HOME} `" == "" ) then
373     setenv PATH "${PATH}:${DAWN_HOME}"
374     rehash
375   endif
376   setenv G4DAWN_MULTI_WINDOW 1
377   if ( $SYSTEM == "Linux" ) then
378     setenv G4DAWN_NAMED_PIPE 1
379   endif
380
381   if ( "$VERBOSE" == "YES" ) then
382     if ("$?G4VIS_USE_DAWN" == 1) then
383       echo "  Dawn driver activated"
384     endif
385     if ("$?G4VIS_USE_DAWNFILE" == 1) then
386       echo "  Dawn file driver activated"
387     endif
388     if ("$?G4DAWNFILE_VIEWER" == 1) then
389       echo "  Dawn file viewer set to ${G4DAWNFILE_VIEWER}"
390     endif
391     if ("$?DAWN_HOME" == 1) then
392       echo "  Dawn home path set to ${DAWN_HOME}"
393     endif
394     if ("$?G4DAWN_MULTI_WINDOW" == 1) then
395       echo "  Dawn multi window selected"
396     endif
397     if ("$?G4DAWN_NAMED_PIPE" == 1) then
398       echo "  Dawn named pipe selected"
399     endif
400   endif
401
402   # David flags
403   # Set colors for overlappings
404   setenv DAVID_RAINBOW_FLAG 1
405   #setenv DAVID_HIGHLIGHT_COLOR_R  r
406   #setenv DAVID_HIGHLIGHT_COLOR_G  g
407   #setenv DAVID_HIGHLIGHT_COLOR_B  b
408
409   # If set volumes names are shown
410   setenv DAVID_DISPLAY_PVNAME   1
411   # If set supresses the call to dawn
412   #setenv DAVID_NO_VIEW  1
413   setenv DAVID_EPSILON_3D  0.001
414
415   if ( "$VERBOSE" == "YES" ) then
416     if ("$?DAVID_RAINBOW_FLAG" == 1) then
417       echo "  DAVID Rainbow mode is ON"
418     endif
419     if ("$?DAVID_HIGHLIGHT_COLOR_R" == 1) then
420       echo "  DAVID Highlight color (Red) set to ${DAVID_HIGHLIGHT_COLOR_R}"
421     endif
422     if ("$?DAVID_HIGHLIGHT_COLOR_G" == 1) then
423       echo "  DAVID Highlight color (Green) set to ${DAVID_HIGHLIGHT_COLOR_G}"
424     endif
425     if ("$?DAVID_HIGHLIGHT_COLOR_B" == 1) then
426       echo "  DAVID Highlight color (Blue) set to ${DAVID_HIGHLIGHT_COLOR_B}"
427     endif
428     if ("$?DAVID_DISPLAY_PVNAME" == 1) then
429       echo "  DAVID will display intersected volumes name"
430     endif
431     if ("$?DAVID_DISPLAY_PVNAME" == 1) then
432       echo "  Dawn will not be called from DAVID"
433     endif
434     if ("$?DAVID_EPSILON_3D" == 1) then
435       echo "  DAVID tolerance set to ${DAVID_EPSILON_3D}"
436     endif
437   endif
438
439   #
440   # OpenGL
441   #
442   if ( "$VERBOSE" == "YES" ) then
443     echo "* OpenGL..."
444   endif
445   setenv G4VIS_BUILD_OPENGLX_DRIVER  1
446   setenv G4VIS_BUILD_OPENGLXM_DRIVER 1
447   setenv G4VIS_USE_OPENGLX           1
448   setenv G4VIS_USE_OPENGLXM          1
449   setenv OGLHOME /usr/local
450   setenv OGLLIBS "-L$OGLHOME/lib -lMesaGLU -lMesaGL"
451   if ( $SYSTEM == "HP-UX" ) then
452     setenv OGLLIBS "-L/usr/lib ${OGLLIBS}"
453   endif
454   if ( $SYSTEM == "OSF1" ) then
455     # temporarily excluded
456     # due to problems with Root
457     unsetenv G4VIS_BUILD_OPENGLX_DRIVER
458     unsetenv G4VIS_BUILD_OPENGLXM_DRIVER
459     unsetenv G4VIS_USE_OPENGLX
460     unsetenv G4VIS_USE_OPENGLXM
461     unsetenv OGLHOME
462     unsetenv OGLLIBS
463   endif
464   if ( "$VERBOSE" == "YES" ) then
465     if ("$?G4VIS_USE_OPENGLX" == 1) then
466       echo "  OpenGL and  X11 driver activated"
467     endif
468     if ("$?G4VIS_USE_OPENGLXM" == 1) then
469       echo "  OpenGL with Motif extension driver activated"
470     endif
471     if ("$?OGLHOME" == 1) then
472       echo "  OpenGL path set to ${OGLHOME}"
473     endif
474     if ("$?OGLLIBS" == 1) then
475       echo "  OpenGL libraries set to ${OGLLIBS}"
476     endif
477   endif
478
479   #
480   # OpenInventor
481   #
482   if ( "$VERBOSE" == "YES" ) then
483     echo "* OpenInventor..."
484   endif
485   #setenv G4VIS_USE_OPENINVENTOR 1
486   #setenv OIHOME whatever
487   #setenv HEPVISDIR something
488   if ( "$VERBOSE" == "YES" ) then
489     if ("$?G4VIS_USE_OPENINVENTOR" == 1) then
490       echo "  OpenInventor driver activated"
491       echo "  OpenInventor path is ${OIHOME}"
492       echo "  HepVis path is ${HEPVISDIR}"
493     endif
494   endif
495
496   #
497   # VRML1
498   #
499   if ( "$VERBOSE" == "YES" ) then
500     echo "* VRML..."
501   endif
502   setenv G4VIS_BUILD_VRML_DRIVER        1
503   setenv G4VIS_BUILD_VRMLFILE_DRIVER    1
504   setenv G4VIS_USE_VRML                 1
505   setenv G4VIS_USE_VRMLFILE             1
506   #Set preferred vrml viewer to be invoked in this mode
507   setenv G4VRMLFILE_VIEWER vrweb
508   #Set host name for VRML1 visualization.... the g4vrmlview machine!
509   setenv G4VRML_HOST_NAME nohost
510   #Command to run java listener for VRML driver
511   #alias javavrml "java -classpath $G4_BASE/tools/bin/java g4vrmlview vrweb"
512
513   if ( "$VERBOSE" == "YES" ) then
514     if ("$?G4VIS_USE_VRML" == 1) then
515       echo "  VRML driver activated"
516       echo "  Host Name for remote visualization is ${G4VRML_HOST_NAME}"
517     endif
518     if ("$?G4VIS_USE_VRMLFILE" == 1) then
519       echo "  VRML file driver activated"
520       echo "  VRML viewer set to ${G4VRMLFILE_VIEWER}"
521     endif
522   endif
523
524   #
525   # Ray Tracer
526   #
527   if ( "$VERBOSE" == "YES" ) then
528     echo "* Ray Tracer..."
529   endif
530   #setenv G4VIS_BUILD_RAYTRACER_DRIVER 1
531   #setenv G4VIS_USE_RAYTRACER          1
532   if ( "$VERBOSE" == "YES" ) then
533     if ("$?G4VIS_USE_RAYTRACER" == 1) then
534       echo "  Ray tracing driver activated"
535     endif
536   endif
537
538   #
539   # GAG
540   #
541   if ( "$VERBOSE" == "YES" ) then
542     echo "* Geant Adaptative GUI (GAG)..."
543   endif
544   setenv G4UI_BUILD_GAG_SESSION 1
545   setenv G4UI_USE_GAG           1
546   setenv MOMOPATH     ${G4_BASE}/tools/GAG/tcltk
547   if ( "`echo ${PATH} | grep ${MOMOPATH} `" == "" ) then
548     setenv PATH "${PATH}:${MOMOPATH}"
549     rehash
550   endif
551   set    NCLASSPATH = ".:${G4_BASE}/tools/swing-1.0.3/swingall.jar:${G4_BASE}/tools/GAG/java/GAG.jar"
552   if ("$?CLASSPATH" == 0) then
553     setenv CLASSPATH $NCLASSPATH
554   else
555     if ( "`echo ${CLASSPATH} | grep ${NCLASSPATH} `" == "" ) then
556       setenv CLASSPATH "${CLASSPATH}:${NCLASSPATH}"
557     endif
558   endif
559
560   if ( "$VERBOSE" == "YES" ) then
561     if ("$?G4UI_USE_GAG" == 1) then
562       echo "  GAG UI activated"
563       echo "  Momo path set to $MOMOPATH"
564       echo "    NOTE: Run "\'tmomo\' "to use Momo (TK/Tcl version)"
565       echo "  The path to the java GAG code was updated"
566       echo "    NOTE: Run "\'java gag\'" to use GAG (java version)"
567     endif
568   endif
569
570 else
571   if ( "$VERBOSE" == "YES" ) then
572     echo Unsetting G4 Visualization env. variables...
573   endif
574
575   #XM
576   unsetenv G4UI_BUILD_XM_DRIVER
577   unsetenv G4UI_BUILD_XM_SESSION
578   unsetenv G4UI_USE_XM
579
580   # Dawn
581   unsetenv G4VIS_BUILD_DAWN_DRIVER
582   unsetenv G4VIS_BUILD_DAWNFILE_DRIVER
583   unsetenv G4VIS_USE_DAWN
584   unsetenv G4VIS_USE_DAWNFILE
585   unsetenv G4DAWNFILE_VIEWER
586   unsetenv DAWN_HOME
587   unsetenv G4DAWN_MULTI_WINDOW
588   if ( $SYSTEM == "Linux" ) then
589     unsetenv G4DAWN_NAMED_PIPE
590   endif
591
592   # David
593   unsetenv DAVID_RAINBOW_FLAG
594   unsetenv DAVID_HIGHLIGHT_COLOR_R
595   unsetenv DAVID_HIGHLIGHT_COLOR_G
596   unsetenv DAVID_HIGHLIGHT_COLOR_B
597   unsetenv DAVID_DISPLAY_PVNAME
598   unsetenv DAVID_NO_VIEW
599   unsetenv DAVID_EPSILON_3D
600   
601   # OpenGL
602   unsetenv G4VIS_BUILD_OPENGLX_DRIVER
603   unsetenv G4VIS_BUILD_OPENGLXM_DRIVER
604   unsetenv G4VIS_USE_OPENGLX
605   unsetenv G4VIS_USE_OPENGLXM
606   unsetenv OGLHOME
607   unsetenv OGLLIBS
608
609   # OpenInventor
610   unsetenv G4VIS_USE_OPENINVENTOR
611
612   # VRML1
613   unsetenv G4VIS_BUILD_VRML_DRIVER
614   unsetenv G4VIS_BUILD_VRMLFILE_DRIVER
615   unsetenv G4VIS_USE_VRML
616   unsetenv G4VIS_USE_VRMLFILE
617   unsetenv G4VRMLFILE_VIEWER
618   unsetenv G4VRML_HOST_NAME
619
620   # GAG
621   unsetenv G4UI_BUILD_GAG_SESSION
622   unsetenv G4UI_USE_GAG
623   unsetenv MOMOPATH
624
625 endif
626
627 #
628 # OPACS
629 #
630 if ( "$?AG4_OPACS" == 1 ) then
631   if ( "$VERBOSE" == "YES" ) then
632     echo "* OPACS..."
633   endif
634   setenv AG4_VISUALIZE 1
635
636   #
637   # OpenGL: needed by OPACS
638   #
639   setenv G4VIS_BUILD_OPENGLX_DRIVER 1
640   setenv G4VIS_USE_OPENGLX          1
641   setenv OGLHOME /usr/local
642   setenv OGLLIBS "-L$OGLHOME/lib -lMesaGLU -lMesaGL"
643   if ( $SYSTEM == "HP-UX" ) then
644     setenv OGLLIBS "-L/usr/lib ${OGLLIBS}"
645   endif
646
647   #
648   # OPACS
649   #
650   setenv G4VIS_BUILD_OPACS_DRIVER 1
651   setenv G4UI_BUILD_WO_DRIVER     1
652   setenv G4UI_BUILD_WO_SESSION    1
653   setenv G4VIS_USE_OPACS          1
654   setenv G4UI_USE_WO              1
655   setenv OPACS_HOME $G4_BASE/tools/OPACS
656   #setenv OPACS_HOME /afs/cern.ch/rd44/dev/OPACS
657   if ( $SYSTEM == "Linux" ) then
658     setenv G4_OPACS_WIDGET_SET lesstif
659   else
660     setenv G4_OPACS_WIDGET_SET Xm
661   endif
662   source $OPACS_HOME/OPACS/v3/setup.csh
663   setenv WOENVIRONMENT $AG4_INSTALL/bin/Alice.odb
664   setenv OPATH "$OPATH $G4INSTALL/environments/OPACS/usr"
665   if ( "$VERBOSE" == "YES" ) then
666     if ("$?G4VIS_USE_OPACS" == 1) then
667       echo "  OPACS driver activated"
668       echo "  OPACS path set to $OPACS_HOME"
669     endif
670   endif
671 else   
672   if ( "$VERBOSE" == "YES" ) then
673     echo "* Unsetting OPACS driver env. variables ..."
674   endif
675   unsetenv G4VIS_BUILD_OPACS_DRIVER
676   unsetenv G4UI_BUILD_WO_DRIVER
677   unsetenv G4UI_BUILD_WO_SESSION
678   unsetenv G4VIS_USE_OPACS
679   unsetenv G4UI_USE_WO
680   unsetenv OPACS_HOME
681   unsetenv G4_OPACS_WIDGET_SET
682   unsetenv G4OROOT
683   unsetenv WOENVIRONMENT
684   unsetenv OPATH
685 endif
686
687 #
688 # path to AliGeant4 config scripts
689 #  
690 if ( "`echo ${PATH} | grep ${AG4_INSTALL}/config `" == "" ) then
691   if ( "$VERBOSE" == "YES" ) then
692     echo Adding ${AG4_INSTALL}/config to the path...
693   endif
694   setenv PATH "${PATH}:${AG4_INSTALL}/config"
695 endif
696
697 #
698 # path to shared libraries
699
700 if ( $SYSTEM == "HP-UX" ) then
701   set SHLIBVAR = $SHLIB_PATH
702   set SHLIBVARNAME = SHLIB_PATH
703 endif 
704 if ( $SYSTEM == "Linux" ) then
705   set SHLIBVAR = $LD_LIBRARY_PATH
706   set SHLIBVARNAME = LD_LIBRARY_PATH
707 endif
708 if ( $SYSTEM == "OSF1" ) then
709   set SHLIBVAR = $LD_LIBRARY_PATH
710   set SHLIBVARNAME = LD_LIBRARY_PATH
711 endif
712 if ( $SYSTEM == "SunOS" ) then
713   set SHLIBVAR = $LD_LIBRARY_PATH
714   set SHLIBVARNAME = LD_LIBRARY_PATH
715 endif
716
717 if ( "`echo ${SHLIBVAR} | grep ${G4INSTALL}/lib/${G4SYSTEM} `" == "" ) then
718   if ( "$VERBOSE" == "YES" ) then
719     echo Adding ${G4INSTALL}/lib/${G4SYSTEM} to the shared libraries path...
720   endif
721   set SHLIBVAR="${G4INSTALL}/lib/${G4SYSTEM}:${SHLIBVAR}"
722 endif
723 if ( "`echo ${SHLIBVAR} | grep ${CLHEP_BASE_DIR}/lib `" == "" ) then
724   if ( "$VERBOSE" == "YES" ) then
725     echo Adding ${CLHEP_BASE_DIR}/lib to the shared libraries path...
726   endif
727   set SHLIBVAR="${SHLIBVAR}:${CLHEP_BASE_DIR}/lib"
728 endif
729
730 setenv $SHLIBVARNAME $SHLIBVAR
731
732
733 #
734 # Remove unneeded variables. If this is not done the vars. remain in the env.
735 #
736
737 unset ALICE_BASE
738 unset G4_BASE
739 unset LHCXX_BASE
740 unset OBJY_BASE
741 unset SYSTEM
742 unset NCLASSPATH
743 unset SHLIBVAR
744 unset SHLIBVARNAME
745 unset LOCAL
746 unset VERBOSE
747
748 echo "Default ALICE environment for GEANT4 has been set."