1 |
#!/bin/bash |
2 |
# |
3 |
# ccf-setup.sh |
4 |
# |
5 |
# (C) ESA 1999-2019 |
6 |
# |
7 |
# $Id: ccf-setup.sh,v 1.9 2017/12/22 13:25:04 ccflib Exp $ |
8 |
|
9 |
|
10 |
host=`hostname | cut -d. -f1` |
11 |
|
12 |
|
13 |
# CCF can be made on the following hosts: |
14 |
# |
15 |
# 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 |
# |
24 |
|
25 |
GNUVER="7.1" |
26 |
|
27 |
case "$host" in |
28 |
sasbld0[1,4]n) |
29 |
refhost=$host |
30 |
export CCFLIB_HOME=/home/ccflib |
31 |
;; |
32 |
xmac01) |
33 |
refhost=$host |
34 |
export CCFLIB_HOME=/xdata/ccflib |
35 |
;; |
36 |
*) |
37 |
refhost="sasbld01n" |
38 |
export CCFLIB_HOME=/xdata/ccflib |
39 |
;; |
40 |
esac |
41 |
|
42 |
if [ -z "$CCFLIB_HOME" ] ; then |
43 |
echo "Error: ccf-setup.sh: Undefined $CCFLIB_HOME - Fix it!" |
44 |
return |
45 |
fi |
46 |
|
47 |
# Define where is the CCF development software |
48 |
|
49 |
export CCFDEV=${CCFLIB_HOME}/ccfdev |
50 |
|
51 |
if [ ! -d "${CCFDEV}" ] ; then |
52 |
echo "Error: ccf-setup.sh: ${CCFDEV} not found ! - Abort" |
53 |
return |
54 |
fi |
55 |
|
56 |
# Set the CVS access to CCF package repository |
57 |
|
58 |
export CVSROOT=${CCFLIB_HOME}/ccfcvs |
59 |
|
60 |
|
61 |
# 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 |
|
69 |
|
70 |
case "$host" in |
71 |
|
72 |
|
73 |
# For the time being we force to use the Heasoft installation used for SAS 15 |
74 |
|
75 |
xmac01) |
76 |
export PATH=/sasbuild/local/xmac01/GNU_CC_CXX_4.8.5_Yosemite/perl/bin:$PATH |
77 |
unset PERL5LIB |
78 |
export HEADAS=/sasbuild/local/xmac01/GNU_CC_CXX_4.8.5_Yosemite/headas/architecture |
79 |
if [ ! -d "$HEADAS" ] ; then |
80 |
echo "Error: ccf-setup.sh: ${HEADAS} does not exist - Abort" |
81 |
return |
82 |
fi |
83 |
. ${HEADAS}/headas-init.sh ;; |
84 |
|
85 |
|
86 |
# Temporary fix: The SAS 16 and 16.1 deceit and ccfextseq tasks do not work |
87 |
# 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 |
94 |
#export PATH=${CCFLIB_HOME}/perl5/perlbrew/perls/perl-5.18.4/bin:${PATH} |
95 |
export PATH=/xdata/sasbuild/local/sasbld02/perl_5.10.1/bin:$PATH |
96 |
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 |
99 |
echo "ccf-setup.sh: ${HEADAS} does not exist - Abort" |
100 |
return |
101 |
fi |
102 |
. ${HEADAS}/headas-init.sh |
103 |
;; |
104 |
|
105 |
esac |
106 |
|
107 |
# SAS |
108 |
|
109 |
|
110 |
case "$refhost" in |
111 |
|
112 |
# 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 |
114 |
# This installation has been made with perl 5.18.4 as SAS_PERL so we use it. |
115 |
|
116 |
sasbld01n|sasbld02n|sasbld03n|sasbld04n) |
117 |
|
118 |
|
119 |
. ${CCFLIB_HOME}/local/SAS/xmmsas_20160201_1833/setsas.sh 1> /dev/null |
120 |
;; |
121 |
|
122 |
xmac01) |
123 |
. /sasbuild/installed/xmac01/xmmsas_20160201_1833/setsas.sh 1> /dev/null |
124 |
;; |
125 |
|
126 |
*) |
127 |
echo "Please use a Linux workstation to process CCF!" |
128 |
return |
129 |
;; |
130 |
|
131 |
esac |
132 |
|
133 |
export SAS_MEMORY_MODEL=Low |
134 |
|
135 |
# Adds some useful perl modules. |
136 |
# |
137 |
# PERL5LIB includes so far the HEADAS and SAS perl5 subdirs |
138 |
|
139 |
if [ ! -z $PERL5LIB ]; then |
140 |
export PERL5LIB=${CCFLIB_HOME}/perl:${PERL5LIB} |
141 |
else |
142 |
export PERL5LIB=${CCFLIB_HOME}/perl |
143 |
fi |
144 |
|
145 |
# From CCFDEV/setup.sh |
146 |
|
147 |
export PERL5LIB=${CCFDEV}/lib/perl5:${PERL5LIB} |
148 |
|
149 |
|
150 |
# 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}/ccfdev/bin:${CCFLIB_HOME}/ccfdev/lib:${PATH} |
153 |
|
154 |
# Unset MAKE if set |
155 |
|
156 |
if [ ! -z "$MAKE" ] ; then |
157 |
echo "ccf-setup.sh, WARNING: Your environment sets MAKE=$MAKE. It will be unset." |
158 |
unset MAKE |
159 |
fi |
160 |
|
161 |
# Show it |
162 |
|
163 |
echo |
164 |
echo "Heasoft & SAS reference information" |
165 |
echo "===================================" |
166 |
echo |
167 |
echo "HEADAS = $HEADAS" |
168 |
echo "Heasoft version = "`fversion` |
169 |
echo |
170 |
echo |
171 |
sasversion -V 2 |
172 |
|
173 |
echo |
174 |
echo "CCF building tools" |
175 |
echo "==================" |
176 |
echo |
177 |
deceit -v |
178 |
ccfextseq -v |
179 |
echo |
180 |
echo "CCF development environment" |
181 |
echo "===========================" |
182 |
echo |
183 |
echo "CCFLIB_HOME = $CCFLIB_HOME" |
184 |
echo "CCFDEV = $CCFDEV" |
185 |
echo "CCF repository = $CVSROOT" |
186 |
echo |
187 |
echo "*** Ready !" |
188 |
echo |