CMT_env.sh 2.65 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# $Id: CMT_env.sh,v 1.51 2008-11-07 11:26:26 avalassi Exp $

if [ "$CMTCONFIG" == "" ] ; then
    echo "ERROR! CMTCONFIG was not set"
    return 1
    #echo "WARNING! CMTCONFIG was not set"
    #fs_sysname=`fs sysname`
    #case "$fs_sysname" in
    #    "Current sysname is 'i386_linux24'" )
    #        CMTCONFIG=slc3_ia32_gcc323
    #        ;;
    #    "Current sysname is 'i386_linux26'" )
    #        CMTCONFIG=slc4_ia32_gcc34
    #        ;;
    #    "Current sysname is 'amd64_linux26'" )
    #        CMTCONFIG=slc4_amd64_gcc34
    #        ;;
    #    #"Current sysname is 'i386_nt40'" )
    #    #    CMTCONFIG=win32_vc71_dbg
    #    #    ;;
    #    * )
    #        echo "ERROR! Cannot determine CMTCONFIG from 'fs sysname'"
    #        return 1
    #esac
fi
export CMTCONFIG

export AFS=/afs
export SITEROOT=$AFS/cern.ch
export CMTROOT=$SITEROOT/sw/contrib/CMT/v1r20p20070208

# Check that this script is being sourced in its own directory 
# (might get a false success - the sourced script does not know its location)
if [ ! -e CMT_env.sh ] ; then
    echo "ERROR! Please source CMT_env.sh in its own directory"
    return 1
fi
thePwd=`pwd`

# Hack for MacOSX O/S (not CMTCONFIG): CMT v1r20p20070208 is not supported
if [ `uname` == "Darwin" ]; then
  export CMTROOT=$SITEROOT/sw/contrib/CMT/v1r20p20070524
  # Workaround for bug #28527 in CMT v1r20p20070524
  export CMTINSTALLAREA=`cd $thePwd/../../..; pwd`
fi

# Setup CMT
. $CMTROOT/mgr/setup.sh

# Unset LD_LIBRARY_PATH
export LD_LIBRARY_PATH=""

# Set CMTPROJECTPATH and unset CMTPATH
export CMTPATH=""
export CMTPROJECTPATH=$SITEROOT/sw/lcg/app/releases

# Reset CMTPROJECTPATH to use a private copy of the latest nightlies
#if [ "$USER" == "avalassi" ] ; then
#  export CMTPROJECTPATH=/afs/cern.ch/sw/lcg/app/releases/COOL/internal/nightlies/dev1/20081106Thu
#  if [ "$CMTCONFIG" == "slc4_amd64_gcc43_dbg" ] || \
#     [ "$CMTCONFIG" == "slc4_amd64_gcc43" ] || \
#     [ "$CMTCONFIG" == "slc4_ia32_gcc43_dbg" ] || \
#     [ "$CMTCONFIG" == "slc4_ia32_gcc43" ]; then
#    export CMTPROJECTPATH=/afs/cern.ch/sw/lcg/app/releases/COOL/internal/nightlies/dev/20081106Thu
#  fi
#fi
#if [ "$USER" == "rbasset" ] ; then
#  export CMTPROJECTPATH=/afs/cern.ch/sw/lcg/app/releases/COOL/internal/nightlies/dev/20080526Mon
#fi

# Set CMTUSERCONTEXT
export CMTUSERCONTEXT=${thePwd}/USERCONTEXT/${USER}

# Unset CMTSITE
export CMTSITE=""

# Printout CMT environment variables
echo "CMTCONFIG set to '${CMTCONFIG}'"
echo "CMTROOT set to '$CMTROOT'"
echo "CMTPATH set to '$CMTPATH'"
echo "CMTPROJECTPATH set to '$CMTPROJECTPATH'"
echo "CMTUSERCONTEXT set to '$CMTUSERCONTEXT'"
echo "CMTINSTALLAREA set to '$CMTINSTALLAREA'"
echo "CMTSITE set to '$CMTSITE'"