1 |
ccflib |
1.1 |
#!/bin/bash |
2 |
|
|
# |
3 |
|
|
# ccf-setup.sh |
4 |
|
|
# |
5 |
ccflib |
1.10 |
# (C) ESA 1999-2019 |
6 |
ccflib |
1.1 |
# |
7 |
ccflib |
1.10 |
# $Id: ccf-setup.sh,v 1.9 2017/12/22 13:25:04 ccflib Exp $ |
8 |
ccflib |
1.1 |
|
9 |
|
|
|
10 |
ccflib |
1.3 |
host=`hostname | cut -d. -f1` |
11 |
|
|
|
12 |
ccflib |
1.10 |
|
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 |
ccflib |
1.8 |
# |
24 |
ccflib |
1.4 |
|
25 |
ccflib |
1.10 |
GNUVER="7.1" |
26 |
ccflib |
1.4 |
|
27 |
ccflib |
1.3 |
case "$host" in |
28 |
ccflib |
1.8 |
sasbld0[1,4]n) |
29 |
|
|
refhost=$host |
30 |
|
|
export CCFLIB_HOME=/home/ccflib |
31 |
|
|
;; |
32 |
ccflib |
1.10 |
xmac01) |
33 |
ccflib |
1.8 |
refhost=$host |
34 |
ccflib |
1.7 |
export CCFLIB_HOME=/xdata/ccflib |
35 |
ccflib |
1.8 |
;; |
36 |
|
|
*) |
37 |
|
|
refhost="sasbld01n" |
38 |
ccflib |
1.10 |
export CCFLIB_HOME=/xdata/ccflib |
39 |
ccflib |
1.7 |
;; |
40 |
ccflib |
1.1 |
esac |
41 |
|
|
|
42 |
ccflib |
1.8 |
if [ -z "$CCFLIB_HOME" ] ; then |
43 |
ccflib |
1.10 |
echo "Error: ccf-setup.sh: Undefined $CCFLIB_HOME - Fix it!" |
44 |
ccflib |
1.8 |
return |
45 |
|
|
fi |
46 |
ccflib |
1.7 |
|
47 |
ccflib |
1.4 |
# Define where is the CCF development software |
48 |
|
|
|
49 |
|
|
export CCFDEV=${CCFLIB_HOME}/ccfdev |
50 |
|
|
|
51 |
ccflib |
1.5 |
if [ ! -d "${CCFDEV}" ] ; then |
52 |
ccflib |
1.8 |
echo "Error: ccf-setup.sh: ${CCFDEV} not found ! - Abort" |
53 |
ccflib |
1.4 |
return |
54 |
|
|
fi |
55 |
|
|
|
56 |
|
|
# Set the CVS access to CCF package repository |
57 |
|
|
|
58 |
|
|
export CVSROOT=${CCFLIB_HOME}/ccfcvs |
59 |
|
|
|
60 |
ccflib |
1.7 |
|
61 |
ccflib |
1.10 |
# 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 |
ccflib |
1.4 |
|
70 |
ccflib |
1.6 |
case "$host" in |
71 |
ccflib |
1.8 |
|
72 |
|
|
|
73 |
|
|
# For the time being we force to use the Heasoft installation used for SAS 15 |
74 |
|
|
|
75 |
ccflib |
1.10 |
xmac01) |
76 |
|
|
export PATH=/sasbuild/local/xmac01/GNU_CC_CXX_4.8.5_Yosemite/perl/bin:$PATH |
77 |
ccflib |
1.8 |
unset PERL5LIB |
78 |
ccflib |
1.10 |
export HEADAS=/sasbuild/local/xmac01/GNU_CC_CXX_4.8.5_Yosemite/headas/architecture |
79 |
ccflib |
1.8 |
if [ ! -d "$HEADAS" ] ; then |
80 |
ccflib |
1.10 |
echo "Error: ccf-setup.sh: ${HEADAS} does not exist - Abort" |
81 |
ccflib |
1.8 |
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 |
ccflib |
1.10 |
# |
91 |
|
|
# For the old versions of Heasoft and SAS we used a different perl |
92 |
|
|
# |
93 |
ccflib |
1.8 |
#export HEADAS=/sasbuild/local/${refhost}/GNU_CC_CXX_${GNUVER}/headas/architecture |
94 |
ccflib |
1.10 |
#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 |
ccflib |
1.8 |
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 |
ccflib |
1.4 |
|
107 |
|
|
# SAS |
108 |
|
|
|
109 |
ccflib |
1.7 |
|
110 |
ccflib |
1.10 |
case "$refhost" in |
111 |
ccflib |
1.8 |
|
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 |
1.10 |
. ${CCFLIB_HOME}/local/SAS/xmmsas_20160201_1833/setsas.sh 1> /dev/null |
120 |
ccflib |
1.8 |
;; |
121 |
|
|
|
122 |
|
|
xmac01) |
123 |
ccflib |
1.10 |
. /sasbuild/installed/xmac01/xmmsas_20160201_1833/setsas.sh 1> /dev/null |
124 |
ccflib |
1.8 |
;; |
125 |
|
|
|
126 |
|
|
*) |
127 |
|
|
echo "Please use a Linux workstation to process CCF!" |
128 |
|
|
return |
129 |
|
|
;; |
130 |
|
|
|
131 |
ccflib |
1.6 |
esac |
132 |
|
|
|
133 |
ccflib |
1.4 |
export SAS_MEMORY_MODEL=Low |
134 |
|
|
|
135 |
ccflib |
1.1 |
# Adds some useful perl modules. |
136 |
ccflib |
1.7 |
# |
137 |
|
|
# PERL5LIB includes so far the HEADAS and SAS perl5 subdirs |
138 |
ccflib |
1.1 |
|
139 |
|
|
if [ ! -z $PERL5LIB ]; then |
140 |
ccflib |
1.7 |
export PERL5LIB=${CCFLIB_HOME}/perl:${PERL5LIB} |
141 |
ccflib |
1.1 |
else |
142 |
|
|
export PERL5LIB=${CCFLIB_HOME}/perl |
143 |
|
|
fi |
144 |
|
|
|
145 |
ccflib |
1.4 |
# From CCFDEV/setup.sh |
146 |
ccflib |
1.1 |
|
147 |
ccflib |
1.7 |
export PERL5LIB=${CCFDEV}/lib/perl5:${PERL5LIB} |
148 |
ccflib |
1.1 |
|
149 |
|
|
|
150 |
ccflib |
1.8 |
# Add the scripts in $CCFLIB_HOME/bin and $CCFLIB_HOME/lib (for example uploadccf) to PATH |
151 |
ccflib |
1.1 |
|
152 |
ccflib |
1.9 |
export PATH=${CCFLIB_HOME}/bin:${CCFLIB_HOME}/ccfdev/bin:${CCFLIB_HOME}/ccfdev/lib:${PATH} |
153 |
ccflib |
1.1 |
|
154 |
ccflib |
1.4 |
# Unset MAKE if set |
155 |
ccflib |
1.1 |
|
156 |
ccflib |
1.4 |
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 |
ccflib |
1.1 |
|
161 |
ccflib |
1.4 |
# Show it |
162 |
ccflib |
1.1 |
|
163 |
ccflib |
1.4 |
echo |
164 |
ccflib |
1.7 |
echo "Heasoft & SAS reference information" |
165 |
|
|
echo "===================================" |
166 |
|
|
echo |
167 |
|
|
echo "HEADAS = $HEADAS" |
168 |
|
|
echo "Heasoft version = "`fversion` |
169 |
|
|
echo |
170 |
ccflib |
1.4 |
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 |