###################################################################
#                                                                 #
#  g4setup.env - Geant4 environment setup file                    #
#                                                                 #
#  Author: Dennis Wright (SLAC)                                   #
#  Date:   21 May 2010                                            #
#                                                                 #
###################################################################
#
setenv G4BASE_DIR /afs/slac/package/geant4
#
# Define the architecture and set the platform:
# rhel4-32, rhel4-64, rhel5-32 or rhel5-64
#
setenv G4SYSTEM
if ($OSTYPE == linux) then

  setenv G4SYSTEM Linux-g++

  set proc=`uname -p`
  set rhel=`uname -r | cut -c 5-6`

  if ("$proc" == "athlon") then
    if ("$rhel" == "18") then
      set platform=rhel5-32
    else
      set platform=rhel4-32
    endif    
  else if ("$proc" == "x86_64") then
    if ("$rhel" == "18") then
      set platform=rhel5-64
    else
      set platform=rhel4-64
    endif
  else
    set platform=none
  endif
#
# Link to Geant4 and CLHEP
#
  echo Setting links to $platform libraries of Geant4 and CLHEP

  if ("$platform" == "rhel4-32") then
    source $G4BASE_DIR/9.3.p01/env-rhel4-32.csh
  else if ("$platform" == "rhel4-64") then
    source $G4BASE_DIR/9.3.p01/env-rhel4-64.csh
  else if ("$platform" == "rhel5-32") then
    source $G4BASE_DIR/9.3.p01/env-rhel5-32.csh
  else if ("$platform" == "rhel5-64") then
    source $G4BASE_DIR/9.3.p01/env-rhel5-64.csh
  else
    echo Unknown platform
  endif

else
  echo No architecture for this system
endif

#
# Set compiler to optimize
#
setenv G4OPTIMIZE 1
