4 |
# |
# |
5 |
# Setup to build CCF from user's home |
# Setup to build CCF from user's home |
6 |
# |
# |
7 |
# $Id: ccf-setup.sh,v 1.5 2014/12/12 13:49:27 ccflib Exp $ |
# $Id: ccf-setup.sh,v 1.6 2016/03/18 15:59:17 ccflib Exp $ |
8 |
|
|
9 |
|
|
10 |
host=`hostname | cut -d. -f1` |
host=`hostname | cut -d. -f1` |
15 |
|
|
16 |
cputype=`uname -m` |
cputype=`uname -m` |
17 |
|
|
18 |
case "$cputype" in |
# Select where to work and define CCFLIB_HOME accordingly |
|
i[3,4,5,6]86) kernelbits=32 ; refhost="sasbld01" ;; |
|
|
x86_64) kernelbits=64 ; refhost="sasbld02" ;; |
|
|
sunu4u) kernelbits=32 ; refhost="xvsoc01" ;; |
|
|
esac |
|
|
|
|
|
# Define CCFLIB_HOME |
|
19 |
|
|
20 |
case "$host" in |
case "$host" in |
21 |
sasbld01) export CCFLIB_HOME=/home/ccflib ;; |
# Exclude these hosts permanently |
22 |
xvsoc01) export CCFLIB_HOME=/data/xmm/ccflib ;; |
sasbld01|sasbld02|sasdmz01|sasdmz02) |
23 |
*) export CCFLIB_HOME=/ccfbuild ;; |
echo "$host can not be used to build CCFs" |
24 |
|
echo "Please log in instead either on sasbld01n/sasbld02n or use your own Linux WS" |
25 |
|
exit ;; |
26 |
|
# If you want to work on the servers |
27 |
|
sasbld01n|sasbld02n|sasbld12) |
28 |
|
kernelbits="64" |
29 |
|
refhost=$host |
30 |
|
GNUVER="6.2" |
31 |
|
export CCFLIB_HOME=/home/ccflib ;; |
32 |
|
# To work on the external server |
33 |
|
xvsoc01) |
34 |
|
kernelbits="32" |
35 |
|
refhost="xvsoc01" |
36 |
|
export CCFLIB_HOME=/data/xmm/ccflib ;; |
37 |
|
# Just to work on any Linux WS |
38 |
|
*) |
39 |
|
kernelbits="64" |
40 |
|
refhost="sasbld01n" |
41 |
|
GNUVER="6.2" |
42 |
|
cd /ccfbuild 2> /dev/null |
43 |
|
if [ "$?" != "0" ] ; then |
44 |
|
export CCFLIB_HOME=/xdata/ccflib |
45 |
|
else |
46 |
|
export CCFLIB_HOME=/ccfbuild |
47 |
|
fi |
48 |
|
;; |
49 |
esac |
esac |
50 |
|
|
51 |
|
|
52 |
# Define where is the CCF development software |
# Define where is the CCF development software |
53 |
|
|
54 |
export CCFDEV=${CCFLIB_HOME}/ccfdev |
export CCFDEV=${CCFLIB_HOME}/ccfdev |
62 |
|
|
63 |
export CVSROOT=${CCFLIB_HOME}/ccfcvs |
export CVSROOT=${CCFLIB_HOME}/ccfcvs |
64 |
|
|
65 |
|
|
66 |
# Heasoft |
# Heasoft |
67 |
|
|
68 |
case "$host" in |
case "$host" in |
69 |
|
# There is not Heasoft in xvsoc01 |
70 |
xvsoc01) export LHEASOFT=1 ;; |
xvsoc01) export LHEASOFT=1 ;; |
71 |
sasdmz01) export HEADAS=/sasbuild/local/sasdmz01/headas/architecture |
# For the time being we force to use the Heasoft installation used for SAS 15 |
72 |
if [ ! -d "$HEADAS" ] ; then |
|
73 |
echo "ccf-setup.sh: ${HEADAS} does not exist - Abort" |
*) |
74 |
return |
#export HEADAS=/sasbuild/local/${refhost}/GNU_CC_CXX_${GNUVER}/headas/architecture |
75 |
fi |
export PATH=${CCFLIB_HOME}/perl5/perlbrew/perls/perl-5.18.4/bin:${PATH} |
76 |
. ${HEADAS}/headas-init.sh ;; |
unset PERL5LIB |
77 |
sasdmz02) export HEADAS=/sasbuild/local/sasdmz02/headas/architecture |
export HEADAS="/sasbuild/local/sasbld02/headas/architecture" |
|
if [ ! -d "$HEADAS" ] ; then |
|
|
echo "ccf-setup.sh: ${HEADAS} does not exist - Abort" |
|
|
return |
|
|
fi |
|
|
. ${HEADAS}/headas-init.sh ;; |
|
|
*) export HEADAS=/sasbuild/local/${refhost}/headas/architecture |
|
78 |
if [ ! -d "$HEADAS" ] ; then |
if [ ! -d "$HEADAS" ] ; then |
79 |
echo "ccf-setup.sh: ${HEADAS} does not exist - Abort" |
echo "ccf-setup.sh: ${HEADAS} does not exist - Abort" |
80 |
return |
return |
84 |
|
|
85 |
# SAS |
# SAS |
86 |
|
|
87 |
|
|
88 |
case "$host" in |
case "$host" in |
89 |
|
# Use an old SAS which still works fine! |
90 |
xvsoc01) export SAS_DIR=${CCFLIB_HOME}/xmmsas_20020413_2031 |
xvsoc01) export SAS_DIR=${CCFLIB_HOME}/xmmsas_20020413_2031 |
91 |
export SAS_PATH=$SAS_DIR |
export SAS_PATH=$SAS_DIR |
92 |
. $SAS_DIR/sas-setup.sh ;; |
. $SAS_DIR/sas-setup.sh ;; |
93 |
*) [ ! -f "$HOME/setsas.sh" ] && /sas/bin/confsas |
# For the time being we force to use SAS 15 given that deceit does not work on SAS 16 |
94 |
. $HOME/setsas.sh 1> /dev/null ;; |
*) |
95 |
|
#/sas/bin/confsas |
96 |
|
#. $HOME/setsas.sh 1> /dev/null |
97 |
|
# For the time being we force to use SAS 15 given that deceit does not work on SAS 16 |
98 |
|
# The installation of SAS is local to CCFLIB_HOME under local/SAS |
99 |
|
# This installation has been made with perl 5.18.4 as SAS_PERL so we use it. |
100 |
|
. ${CCFLIB_HOME}/local/SAS/xmmsas_20160201_1833/setsas.sh 1> /dev/null |
101 |
|
;; |
102 |
esac |
esac |
103 |
|
|
104 |
export SAS_MEMORY_MODEL=Low |
export SAS_MEMORY_MODEL=Low |
105 |
|
|
106 |
# Adds some useful perl modules. |
# Adds some useful perl modules. |
107 |
|
# |
108 |
|
# PERL5LIB includes so far the HEADAS and SAS perl5 subdirs |
109 |
|
|
110 |
if [ ! -z $PERL5LIB ]; then |
if [ ! -z $PERL5LIB ]; then |
111 |
export PERL5LIB=${CCFLIB_HOME}/perl\:$PERL5LIB |
export PERL5LIB=${CCFLIB_HOME}/perl:${PERL5LIB} |
112 |
else |
else |
113 |
export PERL5LIB=${CCFLIB_HOME}/perl |
export PERL5LIB=${CCFLIB_HOME}/perl |
114 |
fi |
fi |
115 |
|
|
116 |
# From CCFDEV/setup.sh |
# From CCFDEV/setup.sh |
117 |
|
|
118 |
export PERL5LIB=${CCFDEV}/lib/perl5:$PERL5LIB |
export PERL5LIB=${CCFDEV}/lib/perl5:${PERL5LIB} |
119 |
|
|
120 |
|
|
121 |
# Add the scripts in $CCFLIB_HOME/bin to PATH |
# Add the scripts in $CCFLIB_HOME/bin to PATH |
122 |
|
|
123 |
export PATH=${CCFLIB_HOME}/bin\:$PATH |
export PATH=${CCFLIB_HOME}/bin:${PATH} |
124 |
|
|
125 |
# Unset MAKE if set |
# Unset MAKE if set |
126 |
|
|
132 |
# Show it |
# Show it |
133 |
|
|
134 |
echo |
echo |
135 |
echo "SAS build reference information" |
echo "Heasoft & SAS reference information" |
136 |
echo "===============================" |
echo "===================================" |
137 |
|
echo |
138 |
|
echo "HEADAS = $HEADAS" |
139 |
|
echo "Heasoft version = "`fversion` |
140 |
|
echo |
141 |
echo |
echo |
142 |
sasversion -V 2 |
sasversion -V 2 |
143 |
|
|