#!/bin/bash # Uses the tool uname to check on which system # the script is run # The script is inspired by the configure script # from ROOT arch=`uname -s | tr '[A-Z]' '[a-z]'` chip=`uname -m | tr '[A-Z]' '[a-z]'` #------------------------------------------------------------------ #Check if the required programs are already installed on the system is_in_path patch result=$? if [ "$result" = "0" ]; then install_patch=yes else echo "patch found in PATH" | tee -a $logfile fi is_in_path wget result=$? if [ "$result" = "0" ]; then install_wget=yes else echo "wget found in PATH" | tee -a $logfile fi is_in_path svn result=$? if [ "$result" = "0" ]; then install_svn=yes else echo "Subversion client found in PATH" | tee -a $logfile fi #------------------------------------------------------------------ if [ "$install_patch" = "yes" ]; then echo "patch not found in PATH, need to install it" | tee -a $logfile stop=yes fi if [ "$install_wget" = "yes" ]; then echo "wget not found in PATH, need to install it" | tee -a $logfile stop=yes fi if [ "$install_svn" = "yes" ]; then echo "SVN not found in PATH, it is recomanded to install it" | tee -a $logfile stop=no fi if [ "$stop" = "yes" ]; then echo "missing packages .............stop installation" | tee -a $logfile exit 1 fi #work around for using icecc ncpu=`echo $NCPU` if [ "$ncpu" != "" ]; then number_of_processors=$ncpu echo "Number of proccessors = $NCPU " # get the number of processors elif [ "$arch" = "linux" ]; then number_of_processors=$(cat /proc/cpuinfo | grep processor | wc -l) elif [ "$arch" = "darwin" ]; then number_of_processors=$(sysctl -n hw.ncpu) elif [ "$arch" = "sunos" ]; then number_of_processors=$(/usr/sbin/psrinfo | wc -l) fi number_of_processes=$number_of_processors case "$arch:$chip:$compiler" in linux:ia64:gcc) arch=linuxia64gcc platform=linux PLATFORM=$platform system=64bit MAKE_command=make ;; linux:ia64:intel) echo "The Intel compiler is not supported for Itanium" exit 1 #arch=linuxia64gcc #platform=linux #PLATFORM=$platform #system=64bit #MAKE_command=make ;; linux:x86_64:gcc) arch=linuxx8664gcc platform=linux PLATFORM=$platform system=64bit MAKE_command=make ;; linux:x86_64:intel) arch=linuxx8664icc platform=linux PLATFORM=$platform system=64bit MAKE_command=make ;; linux:i*86:gcc) arch=linux platform=linux PLATFORM=$platform system=32bit MAKE_command=make ;; linux:i*86:intel) arch=linuxicc platform=linux PLATFORM=$platform system=32bit MAKE_command=make ;; darwin:*86*:gcc) arch=macosx platform=macosx PLATFORM=$platform system=32bit MAKE_command=make ;; sunos:*86*:CC) arch=solarisCC5 platform=solaris PLATFORM=$platform system=64bit MAKE_command=gmake ;; sunos:*86*:gcc) arch=solarisgcc platform=solaris PLATFORM=$platform system=64bit MAKE_command=gmake ;; *) echo "This architecture is not supported up to now" echo "Please contact the FairRoot team at GSI" echo "http://fairroot.gsi.de" exit 1 ;; esac if [ "$arch" = "macosx" ]; then if [ `sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2` = 5 ]; then if `sysctl machdep.cpu.extfeatures | grep "64" > /dev/null 2>&1` ; then arch=macosx64 platform=macosx PLATFORM=$platform system=64bit MAKE_command=make fi fi fi return 1