1 |
#!/bin/bash |
2 |
# |
3 |
# ccf-setup.sh |
4 |
# |
5 |
# Setup to build CCF from user's home |
6 |
# |
7 |
# $Id: ccf-setup.sh,v 1.6 2016/03/18 15:59:17 ccflib Exp $ |
8 |
|
9 |
|
10 |
host=`hostname | cut -d. -f1` |
11 |
|
12 |
# Identify machine OS name and kernel type |
13 |
|
14 |
osname=`uname -s` |
15 |
|
16 |
cputype=`uname -m` |
17 |
|
18 |
# Select where to work and define CCFLIB_HOME accordingly |
19 |
|
20 |
case "$host" in |
21 |
# Exclude these hosts permanently |
22 |
sasbld01|sasbld02|sasdmz01|sasdmz02) |
23 |
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 |
50 |
|
51 |
|
52 |
# Define where is the CCF development software |
53 |
|
54 |
export CCFDEV=${CCFLIB_HOME}/ccfdev |
55 |
|
56 |
if [ ! -d "${CCFDEV}" ] ; then |
57 |
echo "ccf-setup.sh: ${CCFDEV} not found ! - Abort" |
58 |
return |
59 |
fi |
60 |
|
61 |
# Set the CVS access to CCF package repository |
62 |
|
63 |
export CVSROOT=${CCFLIB_HOME}/ccfcvs |
64 |
|
65 |
|
66 |
# Heasoft |
67 |
|
68 |
case "$host" in |
69 |
# There is not Heasoft in xvsoc01 |
70 |
xvsoc01) export LHEASOFT=1 ;; |
71 |
# For the time being we force to use the Heasoft installation used for SAS 15 |
72 |
|
73 |
*) |
74 |
#export HEADAS=/sasbuild/local/${refhost}/GNU_CC_CXX_${GNUVER}/headas/architecture |
75 |
export PATH=${CCFLIB_HOME}/perl5/perlbrew/perls/perl-5.18.4/bin:${PATH} |
76 |
unset PERL5LIB |
77 |
export HEADAS="/sasbuild/local/sasbld02/headas/architecture" |
78 |
if [ ! -d "$HEADAS" ] ; then |
79 |
echo "ccf-setup.sh: ${HEADAS} does not exist - Abort" |
80 |
return |
81 |
fi |
82 |
. ${HEADAS}/headas-init.sh ;; |
83 |
esac |
84 |
|
85 |
# SAS |
86 |
|
87 |
|
88 |
case "$host" in |
89 |
# Use an old SAS which still works fine! |
90 |
xvsoc01) export SAS_DIR=${CCFLIB_HOME}/xmmsas_20020413_2031 |
91 |
export SAS_PATH=$SAS_DIR |
92 |
. $SAS_DIR/sas-setup.sh ;; |
93 |
# For the time being we force to use SAS 15 given that deceit does not work on SAS 16 |
94 |
*) |
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 |
103 |
|
104 |
export SAS_MEMORY_MODEL=Low |
105 |
|
106 |
# Adds some useful perl modules. |
107 |
# |
108 |
# PERL5LIB includes so far the HEADAS and SAS perl5 subdirs |
109 |
|
110 |
if [ ! -z $PERL5LIB ]; then |
111 |
export PERL5LIB=${CCFLIB_HOME}/perl:${PERL5LIB} |
112 |
else |
113 |
export PERL5LIB=${CCFLIB_HOME}/perl |
114 |
fi |
115 |
|
116 |
# From CCFDEV/setup.sh |
117 |
|
118 |
export PERL5LIB=${CCFDEV}/lib/perl5:${PERL5LIB} |
119 |
|
120 |
|
121 |
# Add the scripts in $CCFLIB_HOME/bin to PATH |
122 |
|
123 |
export PATH=${CCFLIB_HOME}/bin:${PATH} |
124 |
|
125 |
# Unset MAKE if set |
126 |
|
127 |
if [ ! -z "$MAKE" ] ; then |
128 |
echo "ccf-setup.sh, WARNING: Your environment sets MAKE=$MAKE. It will be unset." |
129 |
unset MAKE |
130 |
fi |
131 |
|
132 |
# Show it |
133 |
|
134 |
echo |
135 |
echo "Heasoft & SAS reference information" |
136 |
echo "===================================" |
137 |
echo |
138 |
echo "HEADAS = $HEADAS" |
139 |
echo "Heasoft version = "`fversion` |
140 |
echo |
141 |
echo |
142 |
sasversion -V 2 |
143 |
|
144 |
echo |
145 |
echo "CCF building tools" |
146 |
echo "==================" |
147 |
echo |
148 |
deceit -v |
149 |
ccfextseq -v |
150 |
echo |
151 |
echo "CCF development environment" |
152 |
echo "===========================" |
153 |
echo |
154 |
echo "CCFLIB_HOME = $CCFLIB_HOME" |
155 |
echo "CCFDEV = $CCFDEV" |
156 |
echo "CCF repository = $CVSROOT" |
157 |
echo |
158 |
echo "*** Ready !" |
159 |
echo |