1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
Description: modifying the launcher script to account for Debian paths
Author: Pierre Gruet <pgt@debian.org>
Forwarded: not-needed
Last-Update: 2021-08-08
--- a/goby
+++ b/goby
@@ -1,7 +1,6 @@
-#!/bin/bash
+#!/bin/sh -e
# This script runs Goby with the specified amount of memory.
-# The script will find the Goby jar if it is located in the same directory as this script
# Usage: goby mem-requirement mode-name [param]+
# Where mem-requirement indicates how much memory Goby should be given (e.g., 1g, 500m).
@@ -18,42 +17,43 @@
shift
other_parameters=$*
set +x
-WORKING_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-if [[ $OSTYPE == "cygwin" ]]; then
- WORKING_DIR=`cygpath -m "${WORKING_DIR}"`
-fi
-export GOBY_HOME=${WORKING_DIR}
-GOBY_JAR=${GOBY_HOME}/goby.jar
+if [ ! -e ~/.goby ]; then
+ mkdir ~/.goby
+ mkdir ~/.goby/config
+fi
+export GOBY_HOME="~/.goby"
+GOBY_JAR=/usr/share/java/goby.jar
SLF4J_CONFIG=${GOBY_HOME}/config/goby-logback.xml
-if [ ! -z ${GOBY_USE_RJAVA} ]; then
- if [ "${RJAVA_HOME:-notset}" == "notset" ]; then
- #echo "Trying to set RJAVA_HOME environment variable"
- cat >/tmp/r-cmd.txt <<EOT
- system.file("jri",package="rJava")
+
+cat >/tmp/r-cmd.txt <<EOT
+system.file("jri",package="rJava")
EOT
- tmpWithQuotes=`R --no-save </tmp/r-cmd.txt|grep [1]|tail -1 |awk '{print $2}'`
- temp="${tmpWithQuotes%\"}"
- temp="${temp#\"}"
- # echo "$temp"
- export RJAVA_HOME=${temp}
- rm -f /tmp/r-cmd.txt
- fi
-fi
+tmpWithQuotes=`R --no-save </tmp/r-cmd.txt|grep "\[1\]"|tail -1 |awk '{print $2}'`
+temp="${tmpWithQuotes%\"}"
+temp="${temp#\"}"
+export RJAVA_HOME=${temp}
+rm -f /tmp/r-cmd.txt
+
DL_SOMATIC_CLASSPATH=${GOBY_HOME}/somatic.jar
if [ ! -e "${DL_SOMATIC_CLASSPATH}" ]; then
- echo "Model somatic.jar not found. It must be installed at ${GOBY_HOME}/somatic.jar"
+ echo "Model somatic.jar not found."
fi
DL_GENOTYPE_CLASSPATH=${GOBY_HOME}/genotype.jar
if [ ! -e "${DL_SOMATIC_CLASSPATH}" ]; then
- echo "Model genotype.jar not found. It must be installed at ${GOBY_HOME}/genotype.jar"
+ echo "Model genotype.jar not found."
fi
DL_FRAMEWORK_CLASSPATH=${GOBY_HOME}/framework.jar
if [ ! -e "${DL_FRAMEWORK_CLASSPATH}" ]; then
- echo "Model framework.jar not found. It must be installed at ${GOBY_HOME}/framework.jar"
+ echo "Model framework.jar not found."
fi
+
+# Needed for running Rengine.
+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$RJAVA_HOME"
+export R_HOME="/usr/lib/R"
+
#echo java -ea -Xmx${memory_requirement} -Dlog4j.configuration=${LOG4J_PROPS} -Djava.library.path=${RJAVA_HOME} -jar ${GOBY_JAR} --mode ${other_parameters}
-java -ea -Djava.ext.dirs=${GOBY_HOME}/ -Xmx${memory_requirement} -Dlogback.configurationFile=${SLF4J_CONFIG} -Djava.library.path=${RJAVA_HOME} -jar ${GOBY_JAR} --mode ${other_parameters}
+java -ea -cp "${GOBY_HOME}" -Xmx${memory_requirement} -Dlogback.configurationFile=${SLF4J_CONFIG} -Djava.library.path=${RJAVA_HOME} -jar ${GOBY_JAR} --mode ${other_parameters}
if [ $# -lt 2 ]; then
echo "The second argument must be the goby mode you want to run (i.e., goby 1g version). See list of modes in help above."
-fi
\ No newline at end of file
+fi
|