1 |
ccflib |
1.8 |
#! /bin/tcsh |
2 |
ccflib |
1.1 |
# |
3 |
|
|
# ccf-setup.csh |
4 |
|
|
# |
5 |
|
|
# Setup to build CCF from user's home |
6 |
|
|
# |
7 |
ccflib |
1.13 |
# $Id: ccf-setup.csh,v 1.12 2017/12/22 11:11:43 ccflib Exp $ |
8 |
ccflib |
1.1 |
|
9 |
|
|
|
10 |
ccflib |
1.6 |
set host=`hostname | cut -d. -f1` |
11 |
ccflib |
1.5 |
|
12 |
ccflib |
1.11 |
# We can produce CCF on |
13 |
|
|
# 1) a user's workstation |
14 |
|
|
# 2) a SAS builder |
15 |
|
|
# 3) the XMM-Newton external web server xvsoc01 |
16 |
|
|
# |
17 |
|
|
# For SAS we take for all cases the latest SAS, unless is not working |
18 |
ccflib |
1.7 |
|
19 |
ccflib |
1.11 |
set GNUVER="6.2" |
20 |
ccflib |
1.7 |
|
21 |
ccflib |
1.11 |
switch ($host) |
22 |
|
|
|
23 |
ccflib |
1.12 |
case sasbld0[1-4]n: |
24 |
ccflib |
1.11 |
set refhost=$host |
25 |
|
|
setenv CCFLIB_HOME /home/ccflib |
26 |
|
|
breaksw |
27 |
ccflib |
1.7 |
|
28 |
ccflib |
1.11 |
case xmac0[134]: |
29 |
|
|
set refhost=$host |
30 |
|
|
setenv CCFLIB_HOME /xdata/ccflib |
31 |
|
|
breaksw |
32 |
ccflib |
1.7 |
|
33 |
ccflib |
1.9 |
case xvsoc01: |
34 |
ccflib |
1.11 |
set refhost=$host |
35 |
|
|
setenv CCFLIB_HOME /data/xmm/ccflib |
36 |
|
|
breaksw |
37 |
|
|
|
38 |
|
|
default: |
39 |
|
|
set refhost="sasbld01n" |
40 |
|
|
# Check that /ccfbuild is in fact available |
41 |
|
|
set where=`pwd` |
42 |
ccflib |
1.10 |
cd /ccfbuild >& /dev/null |
43 |
|
|
if ( $status != 0 ) then |
44 |
|
|
setenv CCFLIB_HOME "/xdata/ccflib" |
45 |
|
|
else |
46 |
|
|
setenv CCFLIB_HOME "/ccfbuild" |
47 |
|
|
endif |
48 |
ccflib |
1.11 |
cd $where |
49 |
ccflib |
1.10 |
breaksw |
50 |
ccflib |
1.1 |
endsw |
51 |
|
|
|
52 |
ccflib |
1.11 |
if ( ! $?CCFLIB_HOME ) then |
53 |
|
|
echo "Error: Undefined $CCFLIB_HOME - Fix your environment!" |
54 |
ccflib |
1.12 |
exit 1 |
55 |
ccflib |
1.11 |
endif |
56 |
|
|
|
57 |
ccflib |
1.7 |
# Define where is the CCF development software |
58 |
|
|
|
59 |
|
|
setenv CCFDEV ${CCFLIB_HOME}/ccfdev |
60 |
|
|
|
61 |
ccflib |
1.8 |
if ( ! -d $CCFDEV ) then |
62 |
ccflib |
1.11 |
echo "Error: ccf-setup.csh: $CCFDEV not found! - Abort" |
63 |
ccflib |
1.12 |
exit 1 |
64 |
ccflib |
1.7 |
endif |
65 |
|
|
|
66 |
|
|
|
67 |
|
|
# Set the CVS access to CCF package repository |
68 |
|
|
|
69 |
ccflib |
1.8 |
setenv CVSROOT ${CCFLIB_HOME}/ccfcvs |
70 |
ccflib |
1.7 |
|
71 |
ccflib |
1.11 |
# Heasoft |
72 |
|
|
|
73 |
ccflib |
1.9 |
switch ($host) |
74 |
ccflib |
1.11 |
|
75 |
|
|
case xvsoc01: |
76 |
|
|
# Heasoft is not available in xvsoc01 |
77 |
|
|
setenv LHEASOFT=1 |
78 |
|
|
breaksw |
79 |
|
|
|
80 |
|
|
case xmac0[134]: |
81 |
|
|
|
82 |
|
|
setenv PATH "/sasbuild/local/${host}/GNU_CC_CXX_4.8.5_Yosemite/perl/bin:$PATH" |
83 |
|
|
unsetenv PERL5LIB |
84 |
|
|
setenv HEADAS "/sasbuild/local/${host}/GNU_CC_CXX_4.8.5_Yosemite/headas/architecture" |
85 |
|
|
if ( ! -d "$HEADAS" ) then |
86 |
|
|
echo " ccf-setup.csh: ${HEADAS} does not exist - Abort" |
87 |
ccflib |
1.12 |
exit 1 |
88 |
ccflib |
1.11 |
endif |
89 |
|
|
source ${HEADAS}/headas-init.csh |
90 |
|
|
breaksw |
91 |
|
|
|
92 |
|
|
default: |
93 |
|
|
#setenv HEADAS "/sasbuild/local/${refhost}/GNU_CC_CXX_${GNUVER}/headas/architecture" |
94 |
|
|
setenv PATH ${CCFLIB_HOME}/perl5/perlbrew/perls/perl-5.18.4/bin:${PATH} |
95 |
|
|
unsetenv PERL5LIB |
96 |
|
|
setenv HEADAS "/sasbuild/local/sasbld02/headas/architecture" |
97 |
|
|
if ( ! -d $HEADAS ) then |
98 |
|
|
echo "ccf-setup.csh: $HEADAS does not exist! - Abort" |
99 |
ccflib |
1.12 |
exit 1 |
100 |
ccflib |
1.11 |
endif |
101 |
|
|
source ${HEADAS}/headas-init.csh |
102 |
|
|
breaksw |
103 |
|
|
|
104 |
ccflib |
1.9 |
endsw |
105 |
ccflib |
1.1 |
|
106 |
ccflib |
1.7 |
# SAS |
107 |
ccflib |
1.1 |
|
108 |
ccflib |
1.12 |
switch ($refhost) |
109 |
ccflib |
1.11 |
case xvsoc01: |
110 |
|
|
setenv SAS_DIR ${CCFLIB_HOME}/xmmsas_20020413_2031 |
111 |
|
|
setenv SAS_PATH ${SAS_DIR} |
112 |
|
|
source $SAS_DIR/sas-setup.csh |
113 |
|
|
breaksw |
114 |
|
|
|
115 |
ccflib |
1.12 |
case sasbld0[1-4]n: |
116 |
ccflib |
1.11 |
|
117 |
|
|
source ${CCFLIB_HOME}/local/SAS/xmmsas_20160201_1833/setsas.csh 1> /dev/null |
118 |
|
|
|
119 |
|
|
breaksw |
120 |
|
|
|
121 |
|
|
case xmac01: |
122 |
|
|
|
123 |
|
|
source /sasbuild/installed/${host}/xmmsas_20160201_1833/setsas.csh 1> /dev/null |
124 |
|
|
|
125 |
|
|
breaksw |
126 |
|
|
|
127 |
|
|
default: |
128 |
|
|
echo "Please use a Linux workstation to process CCF!" |
129 |
ccflib |
1.12 |
exit 1 |
130 |
ccflib |
1.11 |
breaksw |
131 |
|
|
|
132 |
ccflib |
1.9 |
endsw |
133 |
ccflib |
1.1 |
|
134 |
|
|
setenv SAS_MEMORY_MODEL Low |
135 |
|
|
|
136 |
ccflib |
1.7 |
# Add some useful perl modules |
137 |
ccflib |
1.1 |
|
138 |
ccflib |
1.7 |
if ( $?PERL5LIB ) then |
139 |
ccflib |
1.10 |
setenv PERL5LIB ${CCFLIB_HOME}/perl:${PERL5LIB} |
140 |
ccflib |
1.7 |
else |
141 |
|
|
setenv PERL5LIB ${CCFLIB_HOME}/perl |
142 |
|
|
endif |
143 |
ccflib |
1.1 |
|
144 |
ccflib |
1.7 |
# From CCFDEV/setup.csh |
145 |
ccflib |
1.1 |
|
146 |
ccflib |
1.7 |
setenv PERL5LIB ${CCFDEV}/lib/perl5:${PERL5LIB} |
147 |
ccflib |
1.1 |
|
148 |
ccflib |
1.11 |
# Add the scripts in $CCFLIB_HOME/bin, $CCFLIB_HOME/lib (for example uploadccf) to PATH |
149 |
ccflib |
1.1 |
|
150 |
ccflib |
1.13 |
setenv PATH ${CCFLIB_HOME}/bin:${CCFLIB_HOME}/ccfdev/bin:${CCFLIB_HOME}/ccfdev/lib:${PATH} |
151 |
ccflib |
1.7 |
|
152 |
|
|
# Unsets MAKE if set |
153 |
|
|
|
154 |
|
|
if ( $?MAKE ) then |
155 |
|
|
echo "ccf-setup.csh, WARNING: Your environment sets MAKE=$MAKE. It will be unset" |
156 |
|
|
unsetenv MAKE |
157 |
|
|
endif |
158 |
|
|
|
159 |
|
|
# Show it |
160 |
|
|
|
161 |
|
|
echo |
162 |
ccflib |
1.10 |
echo "Heasoft & SAS reference information" |
163 |
|
|
echo "===================================" |
164 |
|
|
echo |
165 |
|
|
echo "HEADAS = $HEADAS" |
166 |
|
|
echo "Heasoft version = "`fversion` |
167 |
|
|
echo |
168 |
ccflib |
1.7 |
echo |
169 |
|
|
sasversion -V 2 |
170 |
|
|
|
171 |
|
|
echo |
172 |
|
|
echo "CCF building tools" |
173 |
|
|
echo "==================" |
174 |
|
|
echo |
175 |
|
|
deceit -v |
176 |
|
|
ccfextseq -v |
177 |
|
|
echo |
178 |
|
|
echo "CCF development environment" |
179 |
|
|
echo "===========================" |
180 |
|
|
echo |
181 |
|
|
echo "CCFLIB_HOME = $CCFLIB_HOME" |
182 |
|
|
echo "CCFDEV = $CCFDEV" |
183 |
|
|
echo "CCF repository = $CVSROOT" |
184 |
|
|
echo |
185 |
|
|
echo "*** Ready !" |
186 |
|
|
echo |