check_platform.svn-base

Go to the documentation of this file.
00001 #!/bin/bash
00002 
00003 # Find platform.
00004 #
00005 #check_platform () {
00006 
00007 export ARCH="`uname`"
00008 
00009 gcc_major=$(g++ --version | sed '2,$d;s/^[^ ]\+[ ]\+[^ ]\+[ ]\+\([0-9]\+\)\..*$/\1/')
00010 gcc_minor=$(g++ --version | sed '2,$d;s/^.*GCC)[ ]\+[0-9]\+\.\([0-9]\+\)\.\([0-9]\+\).*$/\1\2/')
00011 
00012 slc_major=""
00013 
00014 echo -n  "Checking for OS ... " >&2
00015 if [ ! -s /etc/redhat-release ] ; then
00016    echo " not RedHat-derived. Stop." >&2
00017    exit 1
00018 fi
00019 if [ "x$(grep "Scientific Linux" /etc/redhat-release)" = "x" ] && [ "x$(grep "CentOS" /etc/redhat-release)" = "x" ] ; then   
00020    echo "not SLC! Scientific Linux [34] expected. Stop." >&2
00021    exit 1
00022 fi
00023 
00024 slc_major=$(sed 's/^.*[Rr]elease[ ]\+\([0-9]\+\)\..*$/\1/' < /etc/redhat-release)
00025 echo "SLC "$slc_major >&2
00026 
00027 echo -n "Checking for machine ... " >&2
00028 machine=$(uname -m | grep -E "i[3456]86")
00029 if [ "x$machine" = "x" ] ; then
00030         machine=$(uname -m)
00031         case "X${machine}" in 
00032                 "Xx86_64") machine="amd64" ;; 
00033         esac
00034 else
00035         machine="ia32"
00036 fi
00037 echo $machine >&2
00038 
00039 platform="slc${slc_major}_${machine}_gcc${gcc_major}${gcc_minor}"
00040 platform=$(echo ${platform} | sed 's/gcc34[0-9]*$/gcc34/')
00041 
00042 #echo "Platform is "${platform}
00043 echo ${platform}
00044 export SYSNAME=${platform}

Generated on Mon Jan 4 15:22:33 2010 for HepMCAnalysis by  doxygen 1.4.7