4 function print_example(){
5 echo "##################################################################"
6 echo "# To set the required parameters as source and the build #"
7 echo "# directory for ctest, the linux flavour and the SIMPATH #"
8 echo "# put the export commands below to a separate file which is read #"
9 echo "# during execution and which is defined on the command line. #"
10 echo "# Set all parameters according to your needs. #"
11 echo "# LINUX_FLAVOUR should be set to the distribution you are using #"
12 echo "# eg Debian, SuSe etc. #"
13 echo "# An additional varibale NCPU can overwrite the default number #"
14 echo "# of parallel processes used to compile the project. #"
15 echo "# This can be usefull if one can use a distributed build system #"
16 echo "# like icecream. #"
17 echo "# For example #"
19 echo "#export LINUX_FLAVOUR=Your_System #"
20 echo "#export ROOTSYS=Path_to_ROOTSYS #"
21 echo "#export BUILDDIR=Path_To_Build_dir #"
22 echo "#export SOURCEDIR=Path_To_Source_dir #"
23 echo "##################################################################"
26 if [ "$#" -lt "2" ]; then
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)."
39 # test if a ctest model is either Experimantal or Nightly
40 if [ "$1" == "Experimental" -o "$1" == "Nightly" -o "$1" == "Continuous" ]; then
43 echo "-- Error -- This ctest model is not supported."
44 echo "-- Error -- Possible arguments are Nightly, Experimental or Continuous."
48 # test if the input file exists and execute it
52 echo "-- Error -- Input file does not exist."
53 echo "-- Error -- Please choose existing input file."
57 # set the ctest model to command line parameter
60 # test for architecture
61 arch=$(uname -s | tr '[A-Z]' '[a-z]')
62 chip=$(uname -m | tr '[A-Z]' '[a-z]')
64 # extract information about the system and the machine and set
65 # environment variables used by ctest
67 if test -z $CXX ; then
69 GCC_VERSION=$(gcc -dumpversion)
72 GCC_VERSION=$($CXX -dumpversion)
75 export LABEL1=${LINUX_FLAVOUR}-$SYSTEM-$COMPILER$GCC_VERSION
76 export LABEL=$(echo $LABEL1 | sed -e 's#/#_#g')
78 # get the number of processors
79 # and information about the host
80 if [ "$arch" = "linux" ];
84 export number_of_processors=$NCPU
86 export number_of_processors=$(cat /proc/cpuinfo | grep processor | wc -l)
88 export SITE=$(hostname -f)
89 elif [ "$arch" = "darwin" ];
93 export number_of_processors=$NCPU
95 export number_of_processors=$(sysctl -n hw.ncpu)
97 export SITE=$(hostname -s)
100 echo "************************"
102 echo "LABEL: " $LABEL
104 echo "Model: " ${ctest_model}
105 echo "Nr. of processes: " $number_of_processors
106 echo "************************"
110 ctest -S $SOURCEDIR/AliRoot_test.cmake -V --VV