diff options
Diffstat (limited to 'z3/docker/build_in_docker.sh')
-rwxr-xr-x | z3/docker/build_in_docker.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/z3/docker/build_in_docker.sh b/z3/docker/build_in_docker.sh new file mode 100755 index 00000000..549e823d --- /dev/null +++ b/z3/docker/build_in_docker.sh | |||
@@ -0,0 +1,25 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | # SPDX-FileCopyrightText: 2023 The Refinery Authors <https://refinery.tools/> | ||
4 | # | ||
5 | # SPDX-License-Identifier: Apache-2.0 | ||
6 | |||
7 | set -euo pipefail | ||
8 | |||
9 | z3_version="$1" | ||
10 | target_uid="$2" | ||
11 | target_gid="$3" | ||
12 | |||
13 | apt-get update | ||
14 | apt-get install -y python3 make gcc-aarch64-linux-gnu g++-aarch64-linux-gnu unzip | ||
15 | wget "https://github.com/Z3Prover/z3/archive/refs/tags/z3-${z3_version}.zip" | ||
16 | unzip "z3-${z3_version}.zip" | ||
17 | cd "z3-z3-${z3_version}" | ||
18 | export CC=aarch64-linux-gnu-gcc | ||
19 | export CXX=aarch64-linux-gnu-g++ | ||
20 | # See https://docs.aws.amazon.com/linux/al2023/ug/performance-optimizations.html | ||
21 | export CFLAGS="-march=armv8.2-a+crypto -mtune=neoverse-n1 -ftree-vectorize" | ||
22 | export CXXFLAGS="${CFLAGS}" | ||
23 | python3 scripts/mk_unix_dist.py -f --nodotnet --arch=arm64 | ||
24 | cp --preserve=all "./dist/z3-${z3_version}-arm64-glibc-2.31/bin"/*.so /data/out/ | ||
25 | chown "${target_uid}:${target_gid}" /data/out/* | ||