#!/bin/csh -f
######################################################
# Sets ROOTSYS and PYTHONPATH depending on
# architecture (32 vs 64 bit). Then call profile_plot
######################################################

set myLinux = `/bin/uname -m`
if ($myLinux == "i686") then
    setenv ROOTSYS /triumfcs/trshare/olchansk/root/root_v5.16.00_SL44_32
    setenv PYTHONPATH $ROOTSYS/lib/
    setenv PYTHONPATH /home/alexg/python-modules-i686:$PYTHONPATH
    setenv PYTHONPATH /home/alexg/python-modules-i686/Numeric:$PYTHONPATH
    /bin/rm fg_nla.so
    /bin/ln -s fg_nla_32.so fg_nla.so
else if ($myLinux == "x86_64") then
    setenv ROOTSYS /triumfcs/trshare/olchansk/root/root_v5.16.00_SL44_64
    setenv PYTHONPATH $ROOTSYS/lib/
    setenv PYTHONPATH /home/alexg/python-modules-x86_64:$PYTHONPATH
    setenv PYTHONPATH /home/alexg/python-modules-x86_64/Numeric:$PYTHONPATH
    /bin/rm fg_nla.so
    /bin/ln -s fg_nla_64.so fg_nla.so
else
    echo "Didn't understand your architecture. Didn't set up ROOTSYS"
endif

#inform user
echo "--------------------------------------"
echo "Architecture =  " $myLinux
echo "ROOTSYS =       " $ROOTSYS
echo "PYTHONPATH =    " $PYTHONPATH
echo "--------------------------------------"

#start the program
/usr/bin/python profile_plot.py $argv
