Skip to content

Commit

Permalink
add wrapper script to run Boogie on non-Windows systems using Mono (c…
Browse files Browse the repository at this point in the history
…loses boogie-org#105)
  • Loading branch information
bkragl committed Dec 21, 2018
1 parent 2dfbf64 commit 6750a51
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
30 changes: 30 additions & 0 deletions Binaries/boogie
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

# Wrapper script to run Boogie.exe on non-Windows systems using Mono
#
# Adapted from https://github.com/Microsoft/dafny/blob/master/Binaries/dafny

MONO=$(which mono)

# find the source directory for this script even if it's been symlinked
# from https://stackoverflow.com/questions/59895/
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
BOOGIE_ROOT="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
BOOGIE="$BOOGIE_ROOT/Boogie.exe"

if [[ ! -x "$MONO" ]]; then
echo "Error: Boogie requires Mono to run on non-Windows systems."
exit 1
fi

if [[ ! -e "$BOOGIE" ]]; then
echo "Error: Boogie.exe not found at $BOOGIE."
exit 1
fi

"$MONO" "$BOOGIE" "$@"
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,19 @@ Finally make sure there is a symlink to Z3 in the Binaries directory
$ ln -s /usr/bin/z3 Binaries/z3.exe
```

You're now ready to run Boogie!
## Running

On a Windows system call the Boogie binary:

```
$ Binaries\Boogie.exe
```

On a non-Windows system use the wrapper script:

```
$ Binaries/boogie
```

## Testing

Expand Down

0 comments on commit 6750a51

Please sign in to comment.