TestCmsswVersion.sh 1.05 KB
Newer Older
Stefano Belforte's avatar
Stefano Belforte committed
1
2
3
4
5
6
7
8
9
#!/bin/sh

cmsver=$1

echo "scramv1 project CMSSW $cmsver"
case $cmsver in
    CMSSW_0* | CMSSW_1_[1-4]*)
      arch=slc3_ia32_gcc323
      ;;
10
    CMSSW_1_[5678]* | CMSSW_2* | CMSSW_3_[0123]*)
Stefano Belforte's avatar
Stefano Belforte committed
11
12
13
      arch=slc4_ia32_gcc345
      ;;
    *)
14
      arch=slc5_ia32_gcc434
Stefano Belforte's avatar
Stefano Belforte committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
      ;;
esac
export SCRAM_ARCH=$arch
export BUILD_ARCH=$arch
pwd

echo "<pre>"
scramv1 project CMSSW $cmsver
projectresult=$?
echo "</pre>"

if [ $projectresult != 0 ]
then
    echo "<p><strong>"
    echo "CMSSW version $cmsver project configuration failed"
    echo "</strong></p>"
    exit 1
else
    #echo "<p>"
    echo "Checking version $cmsver runtime environment"
    echo "<br>"
    echo "<pre>"
    echo "eval \`scramv1 runtime -sh\`"
    cd $cmsver/src
    eval `scramv1 runtime -sh`
    runtresult=$?
    echo "</pre>"
    cd ../..
    if [ $runtresult != 0 ]
    then
        echo "<p><strong>"
	echo "CMSSW version $cmsver runtime environment configuration failed"
	echo "</strong></p>"
	exit 1
    else
	#echo "<p>"
	echo "CMSSW version $cmsver configured correctly"
	echo "<br>"
    fi
fi
exit 0