]> git.uio.no Git - u/mrichter/AliRoot.git/blame - Dart.sh
STEER/STEER: Install AliRawDataHeaderSim.h for HMPID AMORE module
[u/mrichter/AliRoot.git] / Dart.sh
CommitLineData
ac23a950 1#!/bin/bash
2
3
4function print_example(){
5echo "##################################################################"
6echo "# To set the required parameters as source and the build #"
7echo "# directory for ctest, the linux flavour and the SIMPATH #"
8echo "# put the export commands below to a separate file which is read #"
9echo "# during execution and which is defined on the command line. #"
10echo "# Set all parameters according to your needs. #"
11echo "# LINUX_FLAVOUR should be set to the distribution you are using #"
12echo "# eg Debian, SuSe etc. #"
13echo "# An additional varibale NCPU can overwrite the default number #"
14echo "# of parallel processes used to compile the project. #"
15echo "# This can be usefull if one can use a distributed build system #"
16echo "# like icecream. #"
17echo "# For example #"
18echo "#!/bin/bash #"
6eb4b07a 19echo "#export LINUX_FLAVOUR=Your_System #"
ac23a950 20echo "#export ROOTSYS=Path_to_ROOTSYS #"
6eb4b07a 21echo "#export BUILDDIR=Path_To_Build_dir #"
22echo "#export SOURCEDIR=Path_To_Source_dir #"
ac23a950 23echo "##################################################################"
24}
25
26if [ "$#" -lt "2" ]; then
27 echo ""
28 echo "-- Error -- Please start script with two parameters"
29 echo "-- Error -- The first parameter is the ctest model."
30 echo "-- Error -- Possible arguments are Nightly and Experimental ."
31 echo "-- Error -- The second parameter is the file containg the"
32 echo "-- Error -- Information about the setup at the client"
33 echo "-- Error -- installation (see example below)."
34 echo ""
35 print_example
36 exit 1
37fi
38
39# test if a ctest model is either Experimantal or Nightly
40if [ "$1" == "Experimental" -o "$1" == "Nightly" -o "$1" == "Continuous" ]; then
41 echo ""
42else
43 echo "-- Error -- This ctest model is not supported."
44 echo "-- Error -- Possible arguments are Nightly, Experimental or Continuous."
45 exit 1
46fi
47
48# test if the input file exists and execute it
49if [ -e "$2" ];then
50 source $2
51else
52 echo "-- Error -- Input file does not exist."
53 echo "-- Error -- Please choose existing input file."
54 exit 1
55fi
56
57# set the ctest model to command line parameter
58export ctest_model=$1
59
60# test for architecture
61arch=$(uname -s | tr '[A-Z]' '[a-z]')
62chip=$(uname -m | tr '[A-Z]' '[a-z]')
63
64# extract information about the system and the machine and set
65# environment variables used by ctest
66SYSTEM=$arch-$chip
67if test -z $CXX ; then
68 COMPILER=gcc;
69 GCC_VERSION=$(gcc -dumpversion)
70else
71 COMPILER=$CXX;
72 GCC_VERSION=$($CXX -dumpversion)
73fi
74
6eb4b07a 75export LABEL1=${LINUX_FLAVOUR}-$SYSTEM-$COMPILER$GCC_VERSION
ac23a950 76export LABEL=$(echo $LABEL1 | sed -e 's#/#_#g')
77
78# get the number of processors
79# and information about the host
80if [ "$arch" = "linux" ];
81then
82 if [ "$NCPU" != "" ];
83 then
84 export number_of_processors=$NCPU
85 else
86 export number_of_processors=$(cat /proc/cpuinfo | grep processor | wc -l)
87 fi
88 export SITE=$(hostname -f)
89elif [ "$arch" = "darwin" ];
90then
91 if [ "$NCPU" != "" ];
92 then
93 export number_of_processors=$NCPU
94 else
95 export number_of_processors=$(sysctl -n hw.ncpu)
96 fi
97 export SITE=$(hostname -s)
98fi
99
100echo "************************"
101date
102echo "LABEL: " $LABEL
103echo "SITE: " $SITE
104echo "Model: " ${ctest_model}
105echo "Nr. of processes: " $number_of_processors
106echo "************************"
107
108cd $SOURCEDIR
109
110ctest -S $SOURCEDIR/AliRoot_test.cmake -V --VV