4 |
# |
# |
5 |
# Setup to build CCF from user's home |
# Setup to build CCF from user's home |
6 |
# |
# |
7 |
# $Id: ccf-setup.csh,v 1.8 2014/12/12 14:08:16 ccflib Exp $ |
# $Id: ccf-setup.csh,v 1.11 2017/12/22 10:44:38 ccflib Exp $ |
8 |
|
|
9 |
|
|
10 |
set host=`hostname | cut -d. -f1` |
set host=`hostname | cut -d. -f1` |
11 |
|
|
12 |
# Identify machine OS name and kernel type |
# We can produce CCF on |
13 |
|
# 1) a user's workstation |
14 |
set osname=`uname -s` |
# 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 |
|
|
19 |
set cputype=`uname -m` |
set GNUVER="6.2" |
20 |
|
|
21 |
switch ($cputype) |
switch ($host) |
|
case i[3,4,5,6]86: |
|
|
set kernelbits=32 |
|
|
set refhost="sasbld01" |
|
|
breaksw |
|
|
case x86_64: |
|
|
set kernelbits=64 |
|
|
set refhost="sasbld02" |
|
|
breaksw |
|
|
case sun4u: |
|
|
set kernelbits=32 |
|
|
set refhost="xvsoc01" |
|
|
breaksw |
|
|
endsw |
|
22 |
|
|
23 |
# Define CCFLIB_HOME |
case sasbld0[1-4]n: |
24 |
|
set refhost=$host |
25 |
|
setenv CCFLIB_HOME /home/ccflib |
26 |
|
breaksw |
27 |
|
|
28 |
|
case xmac0[134]: |
29 |
|
set refhost=$host |
30 |
|
setenv CCFLIB_HOME /xdata/ccflib |
31 |
|
breaksw |
32 |
|
|
|
switch ($host) |
|
|
case sasbld01: |
|
|
setenv CCFLIB_HOME "/home/ccflib" |
|
|
breaksw |
|
33 |
case xvsoc01: |
case xvsoc01: |
34 |
setenv CCFLIB_HOME "/data/xmm/ccflib" |
set refhost=$host |
35 |
breaksw |
setenv CCFLIB_HOME /data/xmm/ccflib |
36 |
default : |
breaksw |
37 |
setenv CCFLIB_HOME "/ccfbuild" |
|
38 |
breaksw |
default: |
39 |
|
set refhost="sasbld01n" |
40 |
|
# Check that /ccfbuild is in fact available |
41 |
|
set where=`pwd` |
42 |
|
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 |
|
cd $where |
49 |
|
breaksw |
50 |
endsw |
endsw |
51 |
|
|
52 |
|
if ( ! $?CCFLIB_HOME ) then |
53 |
|
echo "Error: Undefined $CCFLIB_HOME - Fix your environment!" |
54 |
|
exit 1 |
55 |
|
endif |
56 |
|
|
57 |
# Define where is the CCF development software |
# Define where is the CCF development software |
58 |
|
|
59 |
setenv CCFDEV ${CCFLIB_HOME}/ccfdev |
setenv CCFDEV ${CCFLIB_HOME}/ccfdev |
60 |
|
|
61 |
if ( ! -d $CCFDEV ) then |
if ( ! -d $CCFDEV ) then |
62 |
echo "ccf-setup.csh: $CCFDEV not found! - Abort" |
echo "Error: ccf-setup.csh: $CCFDEV not found! - Abort" |
63 |
return |
exit 1 |
64 |
endif |
endif |
65 |
|
|
66 |
|
|
68 |
|
|
69 |
setenv CVSROOT ${CCFLIB_HOME}/ccfcvs |
setenv CVSROOT ${CCFLIB_HOME}/ccfcvs |
70 |
|
|
71 |
# Heasoft |
# Heasoft |
72 |
|
|
73 |
switch ($host) |
switch ($host) |
74 |
case xvsoc01: |
|
75 |
setenv LHEASOFT=1 |
case xvsoc01: |
76 |
breaksw |
# Heasoft is not available in xvsoc01 |
77 |
default: |
setenv LHEASOFT=1 |
78 |
setenv HEADAS "/sasbuild/local/${refhost}/headas/architecture" |
breaksw |
79 |
if ( ! -d $HEADAS ) then |
|
80 |
echo "ccf-setup.csh: $HEADAS does not exist! - Abort" |
case xmac0[134]: |
81 |
return |
|
82 |
endif |
setenv PATH "/sasbuild/local/${host}/GNU_CC_CXX_4.8.5_Yosemite/perl/bin:$PATH" |
83 |
source ${HEADAS}/headas-init.csh |
unsetenv PERL5LIB |
84 |
breaksw |
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 |
|
exit 1 |
88 |
|
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 |
|
exit 1 |
100 |
|
endif |
101 |
|
source ${HEADAS}/headas-init.csh |
102 |
|
breaksw |
103 |
|
|
104 |
endsw |
endsw |
105 |
|
|
106 |
# SAS |
# SAS |
107 |
|
|
108 |
switch ($host) |
switch ($refhost) |
109 |
case xvsoc01: |
case xvsoc01: |
110 |
setenv SAS_DIR ${CCFLIB_HOME}/xmmsas_20020413_2031 |
setenv SAS_DIR ${CCFLIB_HOME}/xmmsas_20020413_2031 |
111 |
setenv SAS_PATH ${SAS_DIR} |
setenv SAS_PATH ${SAS_DIR} |
112 |
source $SAS_DIR/sas-setup.csh |
source $SAS_DIR/sas-setup.csh |
113 |
breaksw |
breaksw |
114 |
default: |
|
115 |
if ( ! -f "$HOME/setsas.csh" ) then |
case sasbld0[1-4]n: |
116 |
/sas/bin/confsas |
|
117 |
endif |
source ${CCFLIB_HOME}/local/SAS/xmmsas_20160201_1833/setsas.csh 1> /dev/null |
118 |
source $HOME/setsas.csh > /dev/null |
|
119 |
breaksw |
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 |
|
exit 1 |
130 |
|
breaksw |
131 |
|
|
132 |
endsw |
endsw |
133 |
|
|
134 |
setenv SAS_MEMORY_MODEL Low |
setenv SAS_MEMORY_MODEL Low |
136 |
# Add some useful perl modules |
# Add some useful perl modules |
137 |
|
|
138 |
if ( $?PERL5LIB ) then |
if ( $?PERL5LIB ) then |
139 |
setenv PERL5LIB ${CCFLIB_HOME}/perl\:$PERL5LIB |
setenv PERL5LIB ${CCFLIB_HOME}/perl:${PERL5LIB} |
140 |
else |
else |
141 |
setenv PERL5LIB ${CCFLIB_HOME}/perl |
setenv PERL5LIB ${CCFLIB_HOME}/perl |
142 |
endif |
endif |
145 |
|
|
146 |
setenv PERL5LIB ${CCFDEV}/lib/perl5:${PERL5LIB} |
setenv PERL5LIB ${CCFDEV}/lib/perl5:${PERL5LIB} |
147 |
|
|
148 |
# Add the scripts in $CCFLIB_HOME/bin to PATH |
# Add the scripts in $CCFLIB_HOME/bin, $CCFLIB_HOME/lib (for example uploadccf) to PATH |
149 |
|
|
150 |
setenv PATH ${CCFLIB_HOME}/bin\:$PATH |
setenv PATH ${CCFLIB_HOME}/bin:${CCFLIB_HOME}/lib:${PATH} |
151 |
|
|
152 |
# Unsets MAKE if set |
# Unsets MAKE if set |
153 |
|
|
159 |
# Show it |
# Show it |
160 |
|
|
161 |
echo |
echo |
162 |
echo "SAS build reference information" |
echo "Heasoft & SAS reference information" |
163 |
echo "===============================" |
echo "===================================" |
164 |
|
echo |
165 |
|
echo "HEADAS = $HEADAS" |
166 |
|
echo "Heasoft version = "`fversion` |
167 |
|
echo |
168 |
echo |
echo |
169 |
sasversion -V 2 |
sasversion -V 2 |
170 |
|
|