2 |
# |
# |
3 |
# ccf-setup.sh |
# ccf-setup.sh |
4 |
# |
# |
5 |
# Setup to build CCF from user's home |
# (C) ESA 1999-2019 |
6 |
# |
# |
7 |
# $Id: ccf-setup.sh,v 1.7 2017/02/20 14:12:08 ccflib Exp $ |
# $Id: ccf-setup.sh,v 1.9 2017/12/22 13:25:04 ccflib Exp $ |
8 |
|
|
9 |
|
|
10 |
host=`hostname | cut -d. -f1` |
host=`hostname | cut -d. -f1` |
11 |
|
|
12 |
# We can produce CCF on |
|
13 |
# 1) a user's workstation |
# CCF can be made on the following hosts: |
14 |
# 2) a SAS builder |
# |
15 |
# 3) the XMM-Newton external web server xvsoc01 |
# 1) user's workstations |
16 |
|
# refhost is then a reference SAS builder like sasbld01n |
17 |
|
# CCFLIB_HOME is set to the remote ccflib home on /xdata/ccflib |
18 |
|
# |
19 |
|
# 2) any SAS builder |
20 |
|
# refhost is itself |
21 |
|
# CCFLIB_HOME is also the ccflib home directory. |
22 |
|
# There is one exception to these rules: xmac01 |
23 |
# |
# |
|
# For SAS we take for all cases the latest SAS, unless is not working |
|
24 |
|
|
25 |
GNUVER="6.2" |
GNUVER="7.1" |
26 |
|
|
27 |
case "$host" in |
case "$host" in |
28 |
sasbld0[1,4]n) |
sasbld0[1,4]n) |
29 |
refhost=$host |
refhost=$host |
30 |
export CCFLIB_HOME=/home/ccflib |
export CCFLIB_HOME=/home/ccflib |
31 |
;; |
;; |
32 |
xmac01|xmac03|xmc04) |
xmac01) |
33 |
refhost=$host |
refhost=$host |
34 |
export CCFLIB_HOME=/xdata/ccflib |
export CCFLIB_HOME=/xdata/ccflib |
35 |
;; |
;; |
|
xvsoc01) |
|
|
refhost=$host |
|
|
export CCFLIB_HOME=/data/xmm/ccflib |
|
|
;; |
|
36 |
*) |
*) |
37 |
refhost="sasbld01n" |
refhost="sasbld01n" |
38 |
# Check that /ccfbuild is in fact available |
export CCFLIB_HOME=/xdata/ccflib |
|
where=`pwd` |
|
|
cd /ccfbuild 2> /dev/null |
|
|
if [ "$?" != "0" ] ; then |
|
|
export CCFLIB_HOME=/xdata/ccflib |
|
|
else |
|
|
export CCFLIB_HOME=/ccfbuild |
|
|
fi |
|
|
cd $where |
|
39 |
;; |
;; |
40 |
esac |
esac |
41 |
|
|
42 |
if [ -z "$CCFLIB_HOME" ] ; then |
if [ -z "$CCFLIB_HOME" ] ; then |
43 |
echo "Error: Undefined $CCFLIB_HOME - Fix your environment!" |
echo "Error: ccf-setup.sh: Undefined $CCFLIB_HOME - Fix it!" |
44 |
return |
return |
45 |
fi |
fi |
46 |
|
|
58 |
export CVSROOT=${CCFLIB_HOME}/ccfcvs |
export CVSROOT=${CCFLIB_HOME}/ccfcvs |
59 |
|
|
60 |
|
|
61 |
# Heasoft |
# Heasoft and SAS |
62 |
|
# |
63 |
|
# I M P O R T A N T N O T E |
64 |
|
# |
65 |
|
# We are using old versions of both due to a problem with deceit in latest versions |
66 |
|
# |
67 |
|
# Heasoft |
68 |
|
|
|
case "$host" in |
|
69 |
|
|
70 |
# Heasoft is not available in xvsoc01 |
case "$host" in |
71 |
|
|
|
xvsoc01) export LHEASOFT=1 |
|
|
;; |
|
|
|
|
72 |
|
|
73 |
# For the time being we force to use the Heasoft installation used for SAS 15 |
# For the time being we force to use the Heasoft installation used for SAS 15 |
74 |
|
|
75 |
xmac01|xmac03|xmac04) |
xmac01) |
76 |
export PATH=/sasbuild/local/${host}/GNU_CC_CXX_4.8.5_Yosemite/perl/bin:$PATH |
export PATH=/sasbuild/local/xmac01/GNU_CC_CXX_4.8.5_Yosemite/perl/bin:$PATH |
77 |
unset PERL5LIB |
unset PERL5LIB |
78 |
export HEADAS=/sasbuild/local/${host}/GNU_CC_CXX_4.8.5_Yosemite/headas/architecture |
export HEADAS=/sasbuild/local/xmac01/GNU_CC_CXX_4.8.5_Yosemite/headas/architecture |
79 |
if [ ! -d "$HEADAS" ] ; then |
if [ ! -d "$HEADAS" ] ; then |
80 |
echo "ccf-setup.sh: ${HEADAS} does not exist - Abort" |
echo "Error: ccf-setup.sh: ${HEADAS} does not exist - Abort" |
81 |
return |
return |
82 |
fi |
fi |
83 |
. ${HEADAS}/headas-init.sh ;; |
. ${HEADAS}/headas-init.sh ;; |
87 |
# We must use SAS 15 which is not depending on GNUVER |
# We must use SAS 15 which is not depending on GNUVER |
88 |
|
|
89 |
*) |
*) |
90 |
|
# |
91 |
|
# For the old versions of Heasoft and SAS we used a different perl |
92 |
|
# |
93 |
#export HEADAS=/sasbuild/local/${refhost}/GNU_CC_CXX_${GNUVER}/headas/architecture |
#export HEADAS=/sasbuild/local/${refhost}/GNU_CC_CXX_${GNUVER}/headas/architecture |
94 |
export PATH=${CCFLIB_HOME}/perl5/perlbrew/perls/perl-5.18.4/bin:${PATH} |
#export PATH=${CCFLIB_HOME}/perl5/perlbrew/perls/perl-5.18.4/bin:${PATH} |
95 |
unset PERL5LIB |
export PATH=/xdata/sasbuild/local/sasbld02/perl_5.10.1/bin:$PATH |
96 |
export HEADAS="/sasbuild/local/sasbld02/headas/architecture" |
export PERL5LIB=/xdata/sasbuild/local/sasbld02/perl_5.10.1/lib:$PERL5LIB |
97 |
|
export HEADAS="/xdata/sasbuild/local/sasbld02/headas/architecture" |
98 |
if [ ! -d "$HEADAS" ] ; then |
if [ ! -d "$HEADAS" ] ; then |
99 |
echo "ccf-setup.sh: ${HEADAS} does not exist - Abort" |
echo "ccf-setup.sh: ${HEADAS} does not exist - Abort" |
100 |
return |
return |
107 |
# SAS |
# SAS |
108 |
|
|
109 |
|
|
110 |
case "$refhost" in |
case "$refhost" in |
|
# Use an old SAS which still works fine! |
|
|
xvsoc01) export SAS_DIR=${CCFLIB_HOME}/xmmsas_20020413_2031 |
|
|
export SAS_PATH=$SAS_DIR |
|
|
. $SAS_DIR/sas-setup.sh |
|
|
;; |
|
111 |
|
|
112 |
# For the time being we force to use SAS 15 given that deceit does not work on SAS 16 |
# For the time being we force to use SAS 15 given that deceit does not work on SAS 16 |
113 |
# For Linux, the installation of SAS is local to CCFLIB_HOME under local/SAS |
# For Linux, the installation of SAS is local to CCFLIB_HOME under local/SAS |
115 |
|
|
116 |
sasbld01n|sasbld02n|sasbld03n|sasbld04n) |
sasbld01n|sasbld02n|sasbld03n|sasbld04n) |
117 |
|
|
|
#/sas/bin/confsas |
|
|
#. $HOME/setsas.sh 1> /dev/null |
|
|
# For the time being we force to use SAS 15 given that deceit does not work on SAS 16 |
|
|
# The installation of SAS is local to CCFLIB_HOME under local/SAS |
|
|
# This installation has been made with perl 5.18.4 as SAS_PERL so we use it. |
|
118 |
|
|
119 |
. ${CCFLIB_HOME}/local/SAS/xmmsas_20160201_1833/setsas.sh 1> /dev/null |
. ${CCFLIB_HOME}/local/SAS/xmmsas_20160201_1833/setsas.sh 1> /dev/null |
120 |
;; |
;; |
121 |
|
|
122 |
xmac01) |
xmac01) |
123 |
. |
. /sasbuild/installed/xmac01/xmmsas_20160201_1833/setsas.sh 1> /dev/null |
124 |
;; |
;; |
125 |
|
|
126 |
*) |
*) |
149 |
|
|
150 |
# Add the scripts in $CCFLIB_HOME/bin and $CCFLIB_HOME/lib (for example uploadccf) to PATH |
# Add the scripts in $CCFLIB_HOME/bin and $CCFLIB_HOME/lib (for example uploadccf) to PATH |
151 |
|
|
152 |
export PATH=${CCFLIB_HOME}/bin:${CCFLIB_HOME}/lib:${PATH} |
export PATH=${CCFLIB_HOME}/bin:${CCFLIB_HOME}/ccfdev/bin:${CCFLIB_HOME}/ccfdev/lib:${PATH} |
153 |
|
|
154 |
# Unset MAKE if set |
# Unset MAKE if set |
155 |
|
|