SetupMultiOnTrshare

From ATLAS-TRIUMF

Jump to: navigation, search
#!/usr/local/bin/zsh

release=12.0.2
project=AtlasOffline

echo you gave $# command line parameters: $*
if [ -n "$3" ] ; then
  echo "Script accepts at most two parameters (the release number and the project, in that order)"
  exit
fi 
if [ -n "$2" ] ; then
  project=$2
  release=$1
  shift  # don't want the parameters hanging around!
  shift  # don't want the parameters hanging around!
fi
if [ -n "$1" ] ; then
  release=$1
  shift  # don't want the parameter hanging around!
fi
echo Setting release number to $release
echo Setting project to $project

echo "Setting (or re-setting) ATLAS_ROOT to /triumfcs/trshare/atlas/AtlasSoftware/AthenaReleases/Multi"
export ATLAS_ROOT="/triumfcs/trshare/atlas/AtlasSoftware/AthenaReleases/Multi"

aliasdir=${ATLAS_ROOT}

echo "Resetting ATLAS_RELEASE_PATH"
export ATLAS_RELEASE_PATH=$ATLAS_ROOT
echo "to " $ATLAS_RELEASE_PATH

echo "Setting up release ${release} and project ${project}"

workdir=${HOME}/AthenaWork/${release}
mkdir -p $workdir

echo Working directory is $workdir

# new bit, first do the cmt setup:
echo Source cmtsite setup.sh
source ${ATLAS_RELEASE_PATH}/cmtsite/setup.sh
echo Source cmt mgr setup.sh
source ${ATLAS_RELEASE_PATH}/CMT/v1r*/mgr/setup.sh
echo Set up the requirements file in cmthome
cp ${ATLAS_RELEASE_PATH}/cmtsite/requirements ~/cmthome/requirements
cd ~/cmthome
cat >> requirements <<EOF
macro ATLAS_TEST_AREA ${HOME}/AthenaWork
EOF
echo do cmt config
cmt config
echo source setup.sh for release
source setup.sh -tag=${release}

echo Try to find $aliasdir/setup.sh
if [ ! -f ${aliasdir}/setup.sh ]; then
  echo "Dont see top level pacman setup.sh in ${aliasdir}"
  echo "(but it may not matter anymore... is there anything in that script?)"
  #exit
fi

# no evidence this has any executable lines in it now, may be waste of time:
echo "now source ${aliasdir}/setup.sh..."
source ${aliasdir}/setup.sh

echo export CMTPATH
export CMTPATH=$workdir:$CMTPATH

# this should work for AtlasOffline or AtlasProduction where release=${release}
#   but what should we do for projects with different release numbers from main release?
echo "sourcing runtime setup for ${project} - this may or may not be suitable..."
source ${ATLAS_RELEASE_PATH}/${project}/${release}/${project}RunTime/cmt/setup.sh

# let's guess that for a while at least, the "other" projects will have numbers like 2.0.2 for 12.0.2
export minorRelease=$release[2,6]
echo minorRelease=${minorRelease}


echo "now the setup for v-atlas..."
# if GeoModelDisplay checked out:

if [ -f $workdir/AtlasGeometryCommon/GeoModelDisplay/cmt/setup.sh ]; then
  source  $workdir/AtlasGeometryCommon/GeoModelDisplay/cmt/setup.sh
  echo "using checked out version of GeoModelDisplay for v-atlas scripts"
else
# if working from release (hope release numbers stay in synch...):
  source  ${ATLAS_RELEASE_PATH}/AtlasAnalysis/${minorRelease}/AtlasGeometryCommon/GeoModelDisplay/cmt/setup.sh
  echo using release version $minorRelease of GeoModelDisplay for v-atlas scripts
fi

if [[ -z $AFSUSERNAME ]] ; then
  echo "Setting AFSUSERNAME to ${USERNAME}"
  export AFSUSERNAME=${USERNAME}
fi

echo "Setting up CVS access via ssh"
export CVSROOT=":ext:${AFSUSERNAME}@atlas-sw.cern.ch:/atlascvs"
export CVS_RSH="ssh"

echo CVSROOT is:
echo $CVSROOT 
echo "and CVS_RSH is (should be ssh):" 
echo $CVS_RSH
Personal tools