--- ccf-setup.csh 2014/12/11 16:43:59 1.5 +++ ccf-setup.csh 2019/11/06 09:23:09 1.14 @@ -1,58 +1,186 @@ -#! /bin/csh +#! /bin/tcsh # # ccf-setup.csh # -# Setup to build CCF from user's home +# (C) ESA 1999-2019 # -# $Id: ccf-setup.csh,v 1.4 2014/12/10 17:13:43 ccflib Exp $ +# $Id: ccf-setup.csh,v 1.13 2017/12/22 13:26:18 ccflib Exp $ -# Define CCFLIB_HOME -host=`hostname | cut -d. -f1` +set host=`hostname | cut -d. -f1` + +# CCF can be made on the following hosts: +# +# 1) user's workstations +# refhost is then a reference SAS builder like sasbld01n +# CCFLIB_HOME is set to the remote ccflib home on /xdata/ccflib +# +# 2) any SAS builder +# refhost is itself +# CCFLIB_HOME is also the ccflib home directory. +# There is one exception to these rules: xmac01 +# +# + +set GNUVER="7.1" switch ($host) - case [sasbld01]: - setenv CCFLIB_HOME "/home/ccflib" - breaksw - default : - setenv CCFLIB_HOME "/ccfbuild" - breaksw -endsw -# Add some useful perl modules + case sasbld0[1-4]n: + set refhost=$host + setenv CCFLIB_HOME "/home/ccflib" + breaksw + + case xmac01: + set refhost=$host + setenv CCFLIB_HOME /xdata/ccflib + breaksw + + default: + set refhost="sasbld01n" + setenv CCFLIB_HOME "/xdata/ccflib" + breaksw +endsw -if ( $?PERL5LIB ) then - setenv PERL5LIB ${CCFLIB_HOME}/perl\:$PERL5LIB -else - setenv PERL5LIB ${CCFLIB_HOME}/perl +if ( ! $?CCFLIB_HOME ) then + echo "Error: ccf-setup.csh: Undefined $CCFLIB_HOME - Fix it!" + exit 1 endif -# Initialises the latest SAS installed in /sas -if ( ! -f "$HOME/setsas.csh" ) then - /sas/bin/confsas +# Define where is the CCF development software + +setenv CCFDEV ${CCFLIB_HOME}/ccfdev + +if ( ! -d $CCFDEV ) then + echo "Error: ccf-setup.csh: $CCFDEV not found! - Abort" + exit 1 endif -setenv LHEASOFT 1 -source $HOME/setsas.csh + +# Set the CVS access to CCF package repository + +setenv CVSROOT ${CCFLIB_HOME}/ccfcvs + +# Heasoft and SAS. +# +# I M P O R T A N T N O T E +# +# We are using old versions of both due to a problem with deceit in latest versions +# +# Heasoft + +switch ($host) + + case xmac01: + + setenv PATH "/sasbuild/local/xmac01/GNU_CC_CXX_4.8.5_Yosemite/perl/bin:$PATH" + unsetenv PERL5LIB + setenv HEADAS "/sasbuild/local/xmac01/GNU_CC_CXX_4.8.5_Yosemite/headas/architecture" + if ( ! -d "$HEADAS" ) then + echo "Error: ccf-setup.csh: ${HEADAS} does not exist - Abort" + exit 1 + endif + source ${HEADAS}/headas-init.csh + breaksw + + # Temporary fix: The SAS 16 and 16.1 deceit and ccfextseq tasks do not work + # We must use SAS 15 which is not depending on GNUVER + + default: + # + # For the old versions of Heasoft and SAS we used a different perl + # + #setenv PATH ${CCFLIB_HOME}/perl5/perlbrew/perls/perl-5.10.1/bin:${PATH} + setenv PATH /xdata/sasbuild/local/sasbld02/perl_5.10.1/bin:$PATH + if ( $?PERL5LIB ) then + setenv PERL5LIB /xdata/sasbuild/local/sasbld02/perl_5.10.1/lib:$PERL5LIB + else + setenv PERL5LIB /xdata/sasbuild/local/sasbld02/perl_5.10.1/lib + endif + setenv HEADAS "/xdata/sasbuild/local/sasbld02/headas/architecture" + if ( ! -d $HEADAS ) then + echo "Error: ccf-setup.csh: $HEADAS does not exist! - Abort" + exit 1 + endif + source ${HEADAS}/headas-init.csh + breaksw + +endsw + +# SAS + +switch ($refhost) + + case sasbld0[1-4]n: + + source ${CCFLIB_HOME}/local/SAS/xmmsas_20160201_1833/setsas.csh >& /dev/null + + breaksw + + case xmac01: + + source /sasbuild/installed/xmac01/xmmsas_20160201_1833/setsas.csh >& /dev/null + + breaksw + + default: + echo "Please use a Linux workstation to process CCF!" + exit 1 + breaksw + +endsw setenv SAS_MEMORY_MODEL Low -# Shows SAS version and the versions of deceit and ccfextseq -sasversion -deceit -v -ccfextseq -v +# Add some useful perl modules -# Initialises the CVS environment -# Users access through the group permissions instead of using CVS_RSH +if ( $?PERL5LIB ) then + setenv PERL5LIB ${CCFLIB_HOME}/perl:${PERL5LIB} +else + setenv PERL5LIB ${CCFLIB_HOME}/perl +endif -setenv CVSROOT ${CCFLIB_HOME}/ccfcvs +# From CCFDEV/setup.csh -# Defines CCFDEV and sources some additional setup +setenv PERL5LIB ${CCFDEV}/lib/perl5:${PERL5LIB} -setenv CCFDEV ${CCFLIB_HOME}/ccfdev -source $CCFDEV/setup.csh +# Add the scripts in $CCFLIB_HOME/bin, $CCFLIB_HOME/lib (for example uploadccf) to PATH -# Add the scripts in $CCFLIB_HOME/bin to PATH +setenv PATH ${CCFLIB_HOME}/bin:${CCFLIB_HOME}/ccfdev/bin:${CCFLIB_HOME}/ccfdev/lib:${PATH} -setenv PATH ${CCFLIB_HOME}/bin\:$PATH +# Unsets MAKE if set + +if ( $?MAKE ) then + echo "WARNING: ccf-setup.csh: Your environment sets MAKE=$MAKE. It will be unset !" + unsetenv MAKE +endif + +# Show it + +echo +echo "Heasoft & SAS reference information" +echo "===================================" +echo +echo "HEADAS = $HEADAS" +echo "Heasoft version = "`fversion` +echo +echo +sasversion -V 2 + +echo +echo "CCF building tools" +echo "==================" +echo +deceit -v +ccfextseq -v +echo +echo "CCF development environment" +echo "===========================" +echo +echo "CCFLIB_HOME = $CCFLIB_HOME" +echo "CCFDEV = $CCFDEV" +echo "CCF repository = $CVSROOT" +echo +echo "*** Ready !" +echo