-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.sh
executable file
·123 lines (112 loc) · 2.52 KB
/
configure.sh
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/bin/bash
Z3_VERSION=4.13.0
KIND2_VERSION=2.2.0
SERVER_VERSION=0.1.10
ARCH=$(uname -m)
case "$1" in
darwin-x64)
OSTYPE=darwin
ARCH=x86_64
;;
darwin-arm64)
OSTYPE=darwin
ARCH=arm64
;;
darwin*)
OSTYPE=darwin
;;
linux-x64)
OSTYPE=linux
ARCH=x86_64
;;
linux-arm64)
OSTYPE=linux
ARCH=arm64
;;
linux*)
OSTYPE=linux
;;
*)
;;
esac
case "$OSTYPE" in
darwin*)
case "$ARCH" in
x86_64)
Z3_OS_VERSION=x64-osx-11.7.10
KIND2_OS_VERSION=macos-12-x86_64
;;
arm64)
Z3_OS_VERSION=arm64-osx-11.0
KIND2_OS_VERSION=macos-12-arm64
;;
*)
echo "unsupported ARCH: $ARCH";
exit 2;;
esac ;;
linux*)
case "$ARCH" in
x86_64)
Z3_OS_VERSION=x64-glibc-2.31
KIND2_OS_VERSION=linux-x86_64
;;
arm64)
Z3_OS_VERSION=arm64-glibc-2.35
KIND2_OS_VERSION=linux-arm64
;;
*)
echo "unsupported ARCH: $ARCH";
exit 2;;
esac ;;
*)
echo "unsupported OS: $OSTYPE";
exit 1;;
esac
Z3_ZIP_NAME=z3-$Z3_VERSION-$Z3_OS_VERSION
KIND2_TAR_NAME=kind2-v$KIND2_VERSION-$KIND2_OS_VERSION
# Remove old configurations
rm -rf z3 kind2 kind2-language-server
rm -f $Z3_ZIP_NAME.zip
rm -rf $Z3_ZIP_NAME z3-z3-$Z3_VERSION
rm -f $KIND2_TAR_NAME.tar.gz
rm -f kind2-language-server.zip
# Install Z3
case "$2" in
# z3-static)
# wget https://github.com/Z3Prover/z3/archive/refs/tags/z3-$Z3_VERSION.tar.gz
# tar xvf z3-$Z3_VERSION.tar.gz
# rm z3-$Z3_VERSION.tar.gz
# pushd z3-z3-$Z3_VERSION/
# python3 scripts/mk_make.py --staticbin
# pushd build/
# make -j4
# popd
# popd
# cp z3-z3-$Z3_VERSION/build/z3 .
# strip z3
# rm -r z3-z3-$Z3_VERSION/
# ;;
*)
wget https://github.com/Z3Prover/z3/releases/download/z3-$Z3_VERSION/$Z3_ZIP_NAME.zip
unzip -o $Z3_ZIP_NAME.zip
rm $Z3_ZIP_NAME.zip
cp $Z3_ZIP_NAME/bin/z3 .
rm -r $Z3_ZIP_NAME;;
esac
# Install Kind 2
wget https://github.com/kind2-mc/kind2/releases/download/v$KIND2_VERSION/$KIND2_TAR_NAME.tar.gz
tar -xf $KIND2_TAR_NAME.tar.gz
rm $KIND2_TAR_NAME.tar.gz
# Install language server for Kind 2
wget https://github.com/kind2-mc/kind2-language-server/releases/download/$SERVER_VERSION/kind2-language-server.zip
unzip kind2-language-server.zip
rm kind2-language-server.zip
# Install interpreter
pushd interpreter
npm install
npm run build
popd
mkdir -p out
cp -r interpreter/dist/interpreter out/interpreter
# Install Node depedencies
npm install