/[CCFs]/ccf-setup.sh
ViewVC logotype

Diff of /ccf-setup.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by ccflib, Fri Dec 12 13:47:39 2014 UTC revision 1.9 by ccflib, Fri Dec 22 13:25:04 2017 UTC
# Line 4  Line 4 
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.3 2014/12/11 16:43:54 ccflib Exp $  # $Id: ccf-setup.sh,v 1.8 2017/12/22 10:44:11 ccflib Exp $
8    
9    
10  host=`hostname | cut -d. -f1`  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  osname=`uname -s`  #    2) a SAS builder
15    #    3) the XMM-Newton external web server xvsoc01
16  cputype=`uname -m`  #
17    # For SAS we take for all cases the latest SAS, unless is not working
 case "$cputype" in  
   i[3,4,5,6]86) kernelbits=32 ; refhost="sasbld01" ;;  
   x86_64)       kernelbits=64 ; refhost="sasbld02" ;;  
 esac  
18    
19  # Define CCFLIB_HOME  GNUVER="6.2"
20    
21  case "$host" in  case "$host" in
22     sasbld01) export CCFLIB_HOME=/home/ccflib ;;          sasbld0[1,4]n)
23     *)        export CCFLIB_HOME=/ccfbuild    ;;                  refhost=$host
24                    export CCFLIB_HOME=/home/ccflib
25            ;;
26            xmac01|xmac03|xmc04)
27                    refhost=$host
28                    export CCFLIB_HOME=/xdata/ccflib
29            ;;
30            xvsoc01)
31                    refhost=$host
32                    export CCFLIB_HOME=/data/xmm/ccflib
33            ;;
34            *)  
35                    refhost="sasbld01n"
36                    # Check that /ccfbuild is in fact available
37                    where=`pwd`
38                    cd /ccfbuild 2> /dev/null
39                    if [ "$?" != "0" ] ; then
40                            export CCFLIB_HOME=/xdata/ccflib
41                    else
42                            export CCFLIB_HOME=/ccfbuild
43                    fi
44                    cd $where
45           ;;
46  esac  esac
47    
48    if [ -z "$CCFLIB_HOME" ] ; then
49            echo "Error: Undefined $CCFLIB_HOME - Fix your environment!"
50            return
51    fi
52    
53  # Define where is the CCF development software  # Define where is the CCF development software
54    
55  export CCFDEV=${CCFLIB_HOME}/ccfdev  export CCFDEV=${CCFLIB_HOME}/ccfdev
56    
57  if [ ! -d "${CCFDEV}"] ; then  if [ ! -d "${CCFDEV}" ] ; then
58     echo "ccf-setup.sh: ${CCFDEV} not found ! - Abort"     echo "Error: ccf-setup.sh: ${CCFDEV} not found ! - Abort"
59     return     return
60  fi  fi
61    
# Line 40  fi Line 63  fi
63    
64  export CVSROOT=${CCFLIB_HOME}/ccfcvs  export CVSROOT=${CCFLIB_HOME}/ccfcvs
65    
66    
67  # Heasoft  # Heasoft
68    
69  export HEADAS=/sasbuild/local/${refhost}/headas/architecture  case "$host" in
70  if [ ! -d "$HEADAS" ] ; then  
71     echo "ccf-setup.sh: ${HEADAS} does not exist - Abort"          # Heasoft is not available in xvsoc01
72     return  
73  fi          xvsoc01)  export LHEASOFT=1
74  . ${HEADAS}/headas-init.sh          ;;
75            
76    
77            # For the time being we force to use the Heasoft installation used for SAS 15
78    
79            xmac01|xmac03|xmac04)
80                    export PATH=/sasbuild/local/${host}/GNU_CC_CXX_4.8.5_Yosemite/perl/bin:$PATH
81                    unset PERL5LIB
82                    export HEADAS=/sasbuild/local/${host}/GNU_CC_CXX_4.8.5_Yosemite/headas/architecture
83                    if [ ! -d "$HEADAS" ] ; then
84                            echo "ccf-setup.sh: ${HEADAS} does not exist - Abort"
85                            return
86                    fi
87                    . ${HEADAS}/headas-init.sh  ;;
88    
89                    
90            # Temporary fix: The SAS 16 and 16.1 deceit and ccfextseq tasks do not work
91            # We must use SAS 15 which is not depending on GNUVER
92    
93            *)
94            
95            #export HEADAS=/sasbuild/local/${refhost}/GNU_CC_CXX_${GNUVER}/headas/architecture
96            export PATH=${CCFLIB_HOME}/perl5/perlbrew/perls/perl-5.18.4/bin:${PATH}
97            unset PERL5LIB
98            export HEADAS="/sasbuild/local/sasbld02/headas/architecture"
99                    if [ ! -d "$HEADAS" ] ; then
100                            echo "ccf-setup.sh: ${HEADAS} does not exist - Abort"
101                            return
102                    fi
103                    . ${HEADAS}/headas-init.sh
104            ;;
105    
106    esac
107    
108  # SAS  # SAS
109    
110  [ ! -f "$HOME/setsas.sh" ] && /sas/bin/confsas  
111  . $HOME/setsas.sh  case "$refhost" in
112            # Use an old SAS which still works fine!
113            xvsoc01) export SAS_DIR=${CCFLIB_HOME}/xmmsas_20020413_2031
114                    export SAS_PATH=$SAS_DIR
115                    . $SAS_DIR/sas-setup.sh
116            ;;
117    
118            # For the time being we force to use SAS 15 given that deceit does not work on SAS 16
119            # For Linux, the installation of SAS is local to CCFLIB_HOME under local/SAS
120            # This installation has been made with perl 5.18.4 as SAS_PERL so we use it.    
121    
122            sasbld01n|sasbld02n|sasbld03n|sasbld04n)
123            
124            #/sas/bin/confsas
125            #. $HOME/setsas.sh 1> /dev/null
126            # For the time being we force to use SAS 15 given that deceit does not work on SAS 16
127            # The installation of SAS is local to CCFLIB_HOME under local/SAS
128            # This installation has been made with perl 5.18.4 as SAS_PERL so we use it.
129    
130            . ${CCFLIB_HOME}/local/SAS/xmmsas_20160201_1833/setsas.sh 1> /dev/null
131            ;;
132    
133            xmac01)
134            .  
135            ;;
136            
137            *)
138                    echo "Please use a Linux workstation to process CCF!"
139                    return
140            ;;
141            
142    esac
143    
144  export SAS_MEMORY_MODEL=Low  export SAS_MEMORY_MODEL=Low
145    
146  # Adds some useful perl modules.  # Adds some useful perl modules.
147    #
148    # PERL5LIB includes so far the HEADAS and SAS perl5 subdirs
149    
150  if [ ! -z $PERL5LIB ]; then  if [ ! -z $PERL5LIB ]; then
151    export PERL5LIB=${CCFLIB_HOME}/perl\:$PERL5LIB    export PERL5LIB=${CCFLIB_HOME}/perl:${PERL5LIB}
152  else  else
153    export PERL5LIB=${CCFLIB_HOME}/perl    export PERL5LIB=${CCFLIB_HOME}/perl
154  fi  fi
155    
156  # From CCFDEV/setup.sh  # From CCFDEV/setup.sh
157    
158  export PERL5LIB=${CCFDEV}/lib/perl5:$PERL5LIB  export PERL5LIB=${CCFDEV}/lib/perl5:${PERL5LIB}
159    
160    
161  # Add the scripts in $CCFLIB_HOME/bin to PATH  # Add the scripts in $CCFLIB_HOME/bin and $CCFLIB_HOME/lib (for example uploadccf) to PATH
162    
163  export PATH=${CCFLIB_HOME}/bin\:$PATH  export PATH=${CCFLIB_HOME}/bin:${CCFLIB_HOME}/ccfdev/bin:${CCFLIB_HOME}/ccfdev/lib:${PATH}
164    
165  # Unset MAKE if set  # Unset MAKE if set
166    
# Line 82  fi Line 172  fi
172  # Show it  # Show it
173    
174  echo  echo
175  echo "SAS build reference information"  echo "Heasoft & SAS reference information"
176  echo "==============================="  echo "==================================="
177    echo
178    echo "HEADAS          = $HEADAS"
179    echo "Heasoft version = "`fversion`
180    echo
181  echo  echo
182  sasversion -V 2  sasversion -V 2
183    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.27