1 |
#! /bin/csh |
#! /bin/tcsh |
2 |
# |
# |
3 |
# ccf-setup.csh |
# ccf-setup.csh |
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.2 2014/12/10 10:01:55 ccflib Exp $ |
# $Id: ccf-setup.csh,v 1.8 2014/12/12 14:08:16 ccflib Exp $ |
8 |
|
|
9 |
|
|
10 |
|
set host=`hostname | cut -d. -f1` |
11 |
|
|
12 |
|
# Identify machine OS name and kernel type |
13 |
|
|
14 |
|
set osname=`uname -s` |
15 |
|
|
16 |
|
set cputype=`uname -m` |
17 |
|
|
18 |
|
switch ($cputype) |
19 |
|
case i[3,4,5,6]86: |
20 |
|
set kernelbits=32 |
21 |
|
set refhost="sasbld01" |
22 |
|
breaksw |
23 |
|
case x86_64: |
24 |
|
set kernelbits=64 |
25 |
|
set refhost="sasbld02" |
26 |
|
breaksw |
27 |
|
case sun4u: |
28 |
|
set kernelbits=32 |
29 |
|
set refhost="xvsoc01" |
30 |
|
breaksw |
31 |
|
endsw |
32 |
|
|
33 |
# Define CCFLIB_HOME |
# Define CCFLIB_HOME |
34 |
|
|
35 |
switch ($USER) |
switch ($host) |
36 |
case [ccflib]: |
case sasbld01: |
37 |
setenv CCFLIB_HOME "/home/ccflib" |
setenv CCFLIB_HOME "/home/ccflib" |
38 |
breaksw |
breaksw |
39 |
|
case xvsoc01: |
40 |
|
setenv CCFLIB_HOME "/data/xmm/ccflib" |
41 |
|
breaksw |
42 |
default : |
default : |
43 |
setenv CCFLIB_HOME "/ccfbuild" |
setenv CCFLIB_HOME "/ccfbuild" |
44 |
breaksw |
breaksw |
45 |
endsw |
endsw |
46 |
|
|
47 |
# Add some useful perl modules |
# Define where is the CCF development software |
48 |
|
|
49 |
if ( $?PERL5LIB ) then |
setenv CCFDEV ${CCFLIB_HOME}/ccfdev |
50 |
setenv PERL5LIB /home/ccflib/perl\:$PERL5LIB |
|
51 |
else |
if ( ! -d $CCFDEV ) then |
52 |
setenv PERL5LIB /home/ccflib/perl |
echo "ccf-setup.csh: $CCFDEV not found! - Abort" |
53 |
|
return |
54 |
endif |
endif |
55 |
|
|
|
# Initialises the latest SAS installed in /sas |
|
56 |
|
|
57 |
if ( ! -f "$HOME/setsas.csh" ) then |
# Set the CVS access to CCF package repository |
|
/sas/bin/confsas |
|
|
endif |
|
58 |
|
|
59 |
setenv LHEASOFT 1 |
setenv CVSROOT ${CCFLIB_HOME}/ccfcvs |
|
source $HOME/setsas.csh |
|
60 |
|
|
61 |
setenv SAS_MEMORY_MODEL Low |
# Heasoft |
62 |
|
switch ($host) |
63 |
|
case xvsoc01: |
64 |
|
setenv LHEASOFT=1 |
65 |
|
breaksw |
66 |
|
default: |
67 |
|
setenv HEADAS "/sasbuild/local/${refhost}/headas/architecture" |
68 |
|
if ( ! -d $HEADAS ) then |
69 |
|
echo "ccf-setup.csh: $HEADAS does not exist! - Abort" |
70 |
|
return |
71 |
|
endif |
72 |
|
source ${HEADAS}/headas-init.csh |
73 |
|
breaksw |
74 |
|
endsw |
75 |
|
|
76 |
# Shows SAS version and the versions of deceit and ccfextseq |
# SAS |
|
sasversion |
|
|
deceit -v |
|
|
ccfextseq -v |
|
77 |
|
|
78 |
# Initialises the CVS environment |
switch ($host) |
79 |
# Users access through the group permissions instead of using CVS_RSH |
case xvsoc01: |
80 |
|
setenv SAS_DIR ${CCFLIB_HOME}/xmmsas_20020413_2031 |
81 |
|
setenv SAS_PATH ${SAS_DIR} |
82 |
|
source $SAS_DIR/sas-setup.csh |
83 |
|
breaksw |
84 |
|
default: |
85 |
|
if ( ! -f "$HOME/setsas.csh" ) then |
86 |
|
/sas/bin/confsas |
87 |
|
endif |
88 |
|
source $HOME/setsas.csh > /dev/null |
89 |
|
breaksw |
90 |
|
endsw |
91 |
|
|
92 |
setenv CVSROOT ${CCFLIB_HOME}/ccfcvs |
setenv SAS_MEMORY_MODEL Low |
93 |
|
|
94 |
# Defines CCFDEV and sources some additional setup |
# Add some useful perl modules |
95 |
|
|
96 |
setenv CCFDEV ${CCFLIB_HOME}/ccfdev |
if ( $?PERL5LIB ) then |
97 |
source $CCFDEV/setup.csh |
setenv PERL5LIB ${CCFLIB_HOME}/perl\:$PERL5LIB |
98 |
|
else |
99 |
|
setenv PERL5LIB ${CCFLIB_HOME}/perl |
100 |
|
endif |
101 |
|
|
102 |
|
# From CCFDEV/setup.csh |
103 |
|
|
104 |
|
setenv PERL5LIB ${CCFDEV}/lib/perl5:${PERL5LIB} |
105 |
|
|
106 |
# Add the scripts in $CCFLIB_HOME/bin to PATH |
# Add the scripts in $CCFLIB_HOME/bin to PATH |
107 |
|
|
108 |
setenv PATH ${CCFLIB_HOME}/bin\:$PATH |
setenv PATH ${CCFLIB_HOME}/bin\:$PATH |
109 |
|
|
110 |
|
# Unsets MAKE if set |
111 |
|
|
112 |
|
if ( $?MAKE ) then |
113 |
|
echo "ccf-setup.csh, WARNING: Your environment sets MAKE=$MAKE. It will be unset" |
114 |
|
unsetenv MAKE |
115 |
|
endif |
116 |
|
|
117 |
|
# Show it |
118 |
|
|
119 |
|
echo |
120 |
|
echo "SAS build reference information" |
121 |
|
echo "===============================" |
122 |
|
echo |
123 |
|
sasversion -V 2 |
124 |
|
|
125 |
|
echo |
126 |
|
echo "CCF building tools" |
127 |
|
echo "==================" |
128 |
|
echo |
129 |
|
deceit -v |
130 |
|
ccfextseq -v |
131 |
|
echo |
132 |
|
echo "CCF development environment" |
133 |
|
echo "===========================" |
134 |
|
echo |
135 |
|
echo "CCFLIB_HOME = $CCFLIB_HOME" |
136 |
|
echo "CCFDEV = $CCFDEV" |
137 |
|
echo "CCF repository = $CVSROOT" |
138 |
|
echo |
139 |
|
echo "*** Ready !" |
140 |
|
echo |