Changeset 30296 for gs2-extensions

Show
Ignore:
Timestamp:
09.10.2015 17:03:19 (4 years ago)
Author:
jmt12
Message:

extending to support GSDL3 as well

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs2-extensions/parallel-building/trunk/src/setup.bash

    r30278 r30296  
    33 
    44full_setup=`pwd`/${BASH_SOURCE} 
    5 fulldir=${full_setup%/*} 
    6 fulldir=${fulldir%/.} 
     5fulldir="${full_setup%/*}" 
     6fulldir="${fulldir%/.}" 
    77 
    8 if [ "x$GSDLHOME" = "x" ] ; then 
    9   if [ -e ../../setup.bash ] ; then 
    10     export gsopt_noexts=1 && pushd ../.. && source setup.bash && popd 
    11     export gsopt_noexts= 
    12   elif [ -e ../../gs3-setup.sh ] ; then 
    13     export gsopt_noexts=1 && pushd ../.. && source gs3-setup.sh && popd 
    14     export gsopt_noexts= 
     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}" 
    1549  fi 
    1650 
    17 fi 
    18  
    19 if [ "x$GEXTPARALLELBUILDING" = "x" ] ; then 
    20  
    21   export PARALLELBUILDINGOS=`uname -s | tr '[A-Z]' '[a-z]' | sed 's/\([0-9]\+\)\?_.*$//'` 
    22   export GEXTPARALLELBUILDING=$fulldir 
    23   export GEXTPARALLELBUILDING_INSTALLED=$GEXTPARALLELBUILDING/$GSDLOS 
    24  
    25   export PATH=$GEXTPARALLELBUILDING_INSTALLED/bin:$fulldir/bin/script:$PATH 
    26  
    27   if [ "x$CXXFLAGS" = "x" ] ; then 
    28     export CXXFLAGS="-I$GEXTPARALLELBUILDING_INSTALLED/include" 
     51  if [ "x$LD_LIBRARY_PATH" = "x" ] 
     52  then 
     53    export LD_LIBRARY_PATH="${GEXTPARALLELBUILDING_INSTALLED}/lib" 
    2954  else 
    30     export CXXFLAGS="-I$GEXTPARALLELBUILDING_INSTALLED/include $CXXFLAGS" 
     55    export LD_LIBRARY_PATH="${GEXTPARALLELBUILDING_INSTALLED}/lib:${LD_LIBRARY_PATH}" 
    3156  fi 
    3257 
    33   if [ "x$LD_LIBRARY_PATH" = "x" ] ; then 
    34     export LD_LIBRARY_PATH=$GEXTPARALLELBUILDING_INSTALLED/lib 
     58  if [ "x$LDFLAGS" = "x" ] 
     59  then 
     60    export LDFLAGS="-L${GEXTPARALLELBUILDING_INSTALLED}/lib" 
    3561  else 
    36     export LD_LIBRARY_PATH=$GEXTPARALLELBUILDING_INSTALLED/lib:$LD_LIBRARY_PATH 
     62    export LDFLAGS="-L${GEXTPARALLELBUILDING_INSTALLED}/lib ${LDFLAGS}" 
    3763  fi 
    3864 
    39   if [ "x$LDFLAGS" = "x" ] ; then 
    40     export LDFLAGS="-L$GEXTPARALLELBUILDING_INSTALLED/lib" 
     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 
    4175  else 
    42     export LDFLAGS="-L$GEXTPARALLELBUILDING_INSTALLED/lib $LDFLAGS" 
    43   fi 
    44  
    45   extdir=${GEXTPARALLELBUILDING##*/} 
    46  
    47   if [ "x$GSDLEXTS" = "x" ] ; then 
    48     export GSDLEXTS=$extdir 
    49   else  
    50     export GSDLEXTS=$GSDLEXTS:$extdir 
     76      if [ "x$GSDLEXTS" = "x" ] 
     77      then 
     78      export GSDLEXTS="${extdir}" 
     79      else 
     80      export GSDLEXTS="${GSDLEXTS}:${extdir}" 
     81      fi 
    5182  fi 
    5283 
     
    5687  # Hadoop specific environment setup 
    5788  export HADOOP_VERSION=1.1.0 
    58   export HADOOP_PREFIX=$GEXTPARALLELBUILDING/packages/hadoop-$HADOOP_VERSION 
    59   export PATH=$PATH:$HADOOP_PREFIX/bin 
     89  export HADOOP_PREFIX="${GEXTPARALLELBUILDING}/packages/hadoop-${HADOOP_VERSION}" 
     90  export PATH="${HADOOP_PREFIX}/bin:${PATH}" 
    6091  # examples: 
    6192  #  localhost:54310 [default] 
     
    6697  echo "HDFS server expected at \"${HDFSHOST}:${HDFSPORT}\"" 
    6798 
    68   echo "+Your environment is now setup for $extdesc in Greenstone" 
     99  echo "+Your environment is now setup for $extdesc in Greenstone${GSDLVER}" 
    69100else 
    70   echo "+Your environment is already setup for $extdesc in Greenstone" 
     101  echo "+Your environment is already setup for $extdesc in Greenstone${GSDLVER}" 
    71102fi 
    72103