TestCmsswVersion.sh 957 Bytes
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
      arch=slc4_ia32_gcc345
      ;;
13
    CMSSW_3_[4-9]* | CMSSW_3_1[01]*)
14
      arch=slc5_ia32_gcc434
Stefano Belforte's avatar
Stefano Belforte committed
15
      ;;
16
    CMSSW_4* | CMSSW_5_0*)
17
18
      arch=slc5_amd64_gcc434
      ;;
19
20
21
    *)
      arch=slc5_amd64_gcc462
      ;;
Stefano Belforte's avatar
Stefano Belforte committed
22
23
24
25
esac
export SCRAM_ARCH=$arch
export BUILD_ARCH=$arch

26
scramv1 project CMSSW $cmsver
Stefano Belforte's avatar
Stefano Belforte committed
27
28
29
30
31
32
33
projectresult=$?

if [ $projectresult != 0 ]
then
    echo "CMSSW version $cmsver project configuration failed"
    exit 1
else
Andrea Sciaba's avatar
Andrea Sciaba committed
34
    echo "Checking version $cmsver runtime environment"
Stefano Belforte's avatar
Stefano Belforte committed
35
    cd $cmsver/src
36
    eval `scramv1 runtime -sh`
Stefano Belforte's avatar
Stefano Belforte committed
37
38
39
40
41
42
43
    runtresult=$?
    cd ../..
    if [ $runtresult != 0 ]
    then
	echo "CMSSW version $cmsver runtime environment configuration failed"
	exit 1
    else
Andrea Sciaba's avatar
Andrea Sciaba committed
44
	echo "CMSSW version $cmsver configured correctly"
Stefano Belforte's avatar
Stefano Belforte committed
45
46
47
    fi
fi
exit 0