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