TestCmsswVersion.sh 1.08 KB
Newer Older
Stefano Belforte's avatar
Stefano Belforte committed
1
2
3
4
#!/bin/sh

cmsver=$1

Andrea Sciaba's avatar
Andrea Sciaba committed
5
echo "<pre>"
Stefano Belforte's avatar
Stefano Belforte committed
6
7
8
9
10
echo "scramv1 project CMSSW $cmsver"
case $cmsver in
    CMSSW_0* | CMSSW_1_[1-4]*)
      arch=slc3_ia32_gcc323
      ;;
11
    CMSSW_1_[5678]* | CMSSW_2* | CMSSW_3_[0123]_*)
Stefano Belforte's avatar
Stefano Belforte committed
12
13
      arch=slc4_ia32_gcc345
      ;;
14
    CMSSW_3_[4-9]* | CMSSW_3_1[01]*)
15
      arch=slc5_ia32_gcc434
Stefano Belforte's avatar
Stefano Belforte committed
16
      ;;
17
18
19
    *)
      arch=slc5_amd64_gcc434
      ;;
Stefano Belforte's avatar
Stefano Belforte committed
20
21
22
23
24
esac
export SCRAM_ARCH=$arch
export BUILD_ARCH=$arch
pwd

25
scramv1 project CMSSW $cmsver
Stefano Belforte's avatar
Stefano Belforte committed
26
27
28
29
30
31
32
33
34
35
projectresult=$?
echo "</pre>"

if [ $projectresult != 0 ]
then
    echo "<p><strong>"
    echo "CMSSW version $cmsver project configuration failed"
    echo "</strong></p>"
    exit 1
else
Andrea Sciaba's avatar
Andrea Sciaba committed
36
    echo "<p>Checking version $cmsver runtime environment</p>"
Stefano Belforte's avatar
Stefano Belforte committed
37
    echo "<pre>"
38
    echo "eval \`scramv1 runtime -sh\`"
Stefano Belforte's avatar
Stefano Belforte committed
39
    cd $cmsver/src
40
    eval `scramv1 runtime -sh`
Stefano Belforte's avatar
Stefano Belforte committed
41
42
43
44
45
46
47
48
49
50
    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
Andrea Sciaba's avatar
Andrea Sciaba committed
51
	echo "<p>CMSSW version $cmsver configured correctly</p>"
Stefano Belforte's avatar
Stefano Belforte committed
52
53
54
    fi
fi
exit 0