[Soot-list] Soot bootstrap helper shell script

Wei Peng pengw at umail.iu.edu
Mon Dec 29 00:31:42 EST 2014


A hotfix. The last line of the script should be:

[ -f ${THE_JAR} ] && java ${JVM_OPTS*-*$(free | awk '($7) {printf "-Xmx%d",
$7/2}')} -jar ${THE_JAR} "$@"

i.e., a dash, instead of a colon, should be between "JVM_OPTS" and "$".

The github version has been updated:
```sh
wget https://raw.githubusercontent.com/pw4ever/dev-env/master/bin/soot -O
$HOME/soot && chmod +x $HOME/soot
```

Attached is the correct script.

I apologize for the error.

Wei.

Wei Peng
Department of Computer and Information Science
Indiana University-Purdue University, Indianapolis (IUPUI)
pengw at iupui.edu  |  www.cs.iupui.edu/~pengw/


On Sun, Dec 28, 2014 at 11:13 PM, Wei Peng <pengw at umail.iu.edu> wrote:

> I write this because I have not found similar instructions on Soot's page.
>
> Motivation: Soot is released as a Java jar, which requires using "java
> -jar soot-trunk.jar" or "java -cp soot-trunk.jar soot.Main" to launch. I
> write the following small helper Bash script (attached at the end) to save
> some bootstrap trouble.
>
> installation:
>
> * Automatic on Shell with "wget" to $HOME/soot
> ```sh
> wget https://raw.githubusercontent.com/pw4ever/dev-env/master/bin/soot -O
> $HOME/soot && chmod +x $HOME/soot
> ```
>
> Then use "soot" to (optionally) download "soot-trunk.jar" and execute it.
> Of course, "java" must be available on your exec path.
>
> * Manual setup and details. Put the script in a "soot" file and "chmod +x
> soot;" then drop "soot" somewhere on your $PATH where you have write
> permission ($HOME/bin is a good place), and it will automatically fetch
> "soot-trunk.jar" (if it is not available) and execute it, with default JVM
> maximal heap (-Xmx) set to be half of your available RAM (JVM options can
> be tuned with environment variable "JVM_OPTS").
>
> NB I write and test this in a Linux environment; the script requires GNU
> coreutils, procps-ng, bash, wget, and java to function properly. But it
> should be adaptable to other environments.
>
> Hope someone finds this useful.
>
> Wei.
>
> Wei Peng
> Department of Computer and Information Science
> Indiana University-Purdue University, Indianapolis (IUPUI)
> pengw at iupui.edu  |  www.cs.iupui.edu/~pengw/
>
> ===== the script "soot"
> #! /bin/bash
> # Soot (https://sable.github.io/soot/) start-up script
> # author: Wei Peng <4pengw at gmail.com>
> # version: 20141228
> # deps: bash, GNU coreutils, wget, procps-ng
>
> WGET='wget'
>
> # http://stackoverflow.com/a/246128
> DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
>
> THE_URL='https://ssebuild.cased.de/nightly/soot/lib/soot-trunk.jar'
> THE_JAR=${DIR}/'soot-trunk.jar'
>
> # download the jar if it is missing
> if ! [ -f "${THE_JAR}" ]; then
>     ${WGET} "${THE_URL}" -O "${THE_JAR}"
> fi
>
> # by default, JVM maximal heap size (-Xmx) is set to be up to half of
> available memory
> [ -f ${THE_JAR} ] && java ${JVM_OPTS:$(free | awk '($7) {printf "-Xmx%d",
> $7/2}')} -jar ${THE_JAR} "$@"
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20141229/ae99de8b/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: soot
Type: application/octet-stream
Size: 679 bytes
Desc: not available
Url : http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20141229/ae99de8b/attachment.obj 


More information about the Soot-list mailing list