-
Notifications
You must be signed in to change notification settings - Fork 4
/
falcaun
executable file
·66 lines (59 loc) · 1.84 KB
/
falcaun
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
#!/bin/sh -u
#****h* FalCAuN/falcaun
# NAME
# falcaun
# DESCRIPTION
# the script to launch FalCAuN
#
# USAGE
# ./falcaun [OPTIONS] --stl=[STLFormula] --input-mapper=[InputMapperFile] --output-mapper=[OutputMapperFile] --equiv=[ga|hc|random|wp]
#
#******
readonly JAR_NAME=net/maswag/falcaun/FalCAuN-matlab/1.0-SNAPSHOT/FalCAuN-matlab-1.0-SNAPSHOT-jar-with-dependencies.jar
if [ -z "$MATLAB_HOME" ]; then
echo "Error: environment variable MATLAB_HOME is not set"
exit 1
fi
# Check the MATLAB version
MATLAB_VERSION=$(echo "$MATLAB_HOME" | grep -o 'R[0-9]\+[ab]')
if expr "$MATLAB_VERSION" \< R2021a > /dev/null 2>&1; then
printf "Warning: You are using MATLAB %s. This may be too old\n" "$MATLAB_VERSION"
fi
case "$(uname)" in
Darwin)
if [ "$(arch)" = arm64 ]; then
arch=maca64
else
arch=maci64
fi
if java="$(/usr/libexec/java_home -v '17')/bin/java"; then
echo "Java 17 found at $java"
elif java="$(/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java_home -v '17')/bin/java"; then
echo "Java 17 found at $java"
else
echo "Error: Java 17 did not found"
exit 1
fi
;;
Linux)
arch=glnxa64
if java=$(find /usr/lib/jvm/java-17-openjdk* -name java -type f) 2>/dev/null; then
echo "Java 17 found at $java"
elif java=$(find /usr/lib/jvm/java-1.17.0-openjdk* -name java -type f | head -n 1) 2>/dev/null; then
echo "Java 17 found at $java"
else
echo "Error: Java 17 did not found"
exit 1
fi
;;
*)
echo "Error: Unknown architecture $(uname)"
exit 1
;;
esac
if ! (command -v mvn >/dev/null 2>&1); then
echo "Error: Maven must be installed"
exit 1
fi
maven_repo_path="$(mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout)"
$java -Djava.awt.headless=true -Djava.library.path="$MATLAB_HOME/bin/$arch" -jar "${maven_repo_path}/${JAR_NAME}" "$@"