root/gs2-extensions/parallel-building/trunk/src/setup.bash @ 30296

Revision 30296, 2.5 KB (checked in by jmt12, 5 years ago)

extending to support GSDL3 as well

Line 
1# GEXTPARALLELBUILDING
2extdesc="parallel processor enabled collection building"
3
4full_setup=`pwd`/${BASH_SOURCE}
5fulldir="${full_setup%/*}"
6fulldir="${fulldir%/.}"
7
8# Test for one of the homes, otherwise we need to source a top-level setup
9GSDLVER=0
10if [ "${GSDL3HOME}x" != "x" ]
11then
12    GSDLVER=3
13else
14    if [ "${GSDLHOME}x" != "x" ]
15    then
16    GSDLVER=2
17    fi
18fi
19
20if [ "${GSDLVER}" == "0" ]
21then
22    export gsopt_noexts=1
23    CWD=`pwd`
24    cd ../..
25    if [ -f "./gs3-setup.sh" ]
26    then
27    source ./gs3-setup.sh
28    GSDLVER=3
29    else
30    source ./setup.bash
31    GSDLVER=2
32    fi
33    cd "${CWD}"
34    unset gsopt_noexts
35fi
36
37if [ "x$GEXTPARALLELBUILDING" = "x" ]
38then
39  export PARALLELBUILDINGOS=`uname -s | tr '[A-Z]' '[a-z]' | sed 's/\([0-9]\+\)\?_.*$//'`
40  export GEXTPARALLELBUILDING="$fulldir"
41  export GEXTPARALLELBUILDING_INSTALLED="${GEXTPARALLELBUILDING}/${GSDLOS}"
42  export PATH="${GEXTPARALLELBUILDING_INSTALLED}/bin:${fulldir}/bin/script:${PATH}"
43
44  if [ "x$CXXFLAGS" = "x" ]
45  then
46    export CXXFLAGS="-I${GEXTPARALLELBUILDING_INSTALLED}/include"
47  else
48    export CXXFLAGS="-I${GEXTPARALLELBUILDING_INSTALLED}/include ${CXXFLAGS}"
49  fi
50
51  if [ "x$LD_LIBRARY_PATH" = "x" ]
52  then
53    export LD_LIBRARY_PATH="${GEXTPARALLELBUILDING_INSTALLED}/lib"
54  else
55    export LD_LIBRARY_PATH="${GEXTPARALLELBUILDING_INSTALLED}/lib:${LD_LIBRARY_PATH}"
56  fi
57
58  if [ "x$LDFLAGS" = "x" ]
59  then
60    export LDFLAGS="-L${GEXTPARALLELBUILDING_INSTALLED}/lib"
61  else
62    export LDFLAGS="-L${GEXTPARALLELBUILDING_INSTALLED}/lib ${LDFLAGS}"
63  fi
64
65  extdir="${GEXTPARALLELBUILDING##*/}"
66
67  if [ "${GSDLVER}" = "3" ]
68  then
69      if [ "x${GSDL3EXTS}" = "x" ]
70      then
71      export GSDL3EXTS="${extdir}"
72      else
73      export GSDL3EXTS="${GSDL3EXTS}:${extdir}"
74      fi
75  else
76      if [ "x$GSDLEXTS" = "x" ]
77      then
78      export GSDLEXTS="${extdir}"
79      else
80      export GSDLEXTS="${GSDLEXTS}:${extdir}"
81      fi
82  fi
83
84  # Perl specific environment setup
85  export PERL_VERSION=$(perl-version.pl)
86
87  # Hadoop specific environment setup
88  export HADOOP_VERSION=1.1.0
89  export HADOOP_PREFIX="${GEXTPARALLELBUILDING}/packages/hadoop-${HADOOP_VERSION}"
90  export PATH="${HADOOP_PREFIX}/bin:${PATH}"
91  # examples:
92  #  localhost:54310 [default]
93  #  machinename.local:9000 [rocks default]
94  export HDFSHOST=localhost
95  export HDFSPORT=54310
96
97  echo "HDFS server expected at \"${HDFSHOST}:${HDFSPORT}\""
98
99  echo "+Your environment is now setup for $extdesc in Greenstone${GSDLVER}"
100else
101  echo "+Your environment is already setup for $extdesc in Greenstone${GSDLVER}"
102fi
103
104
Note: See TracBrowser for help on using the browser.