aboutsummaryrefslogtreecommitdiffstats
path: root/z3/docker/build_in_docker.sh
diff options
context:
space:
mode:
Diffstat (limited to 'z3/docker/build_in_docker.sh')
-rwxr-xr-xz3/docker/build_in_docker.sh25
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
7set -euo pipefail
8
9z3_version="$1"
10target_uid="$2"
11target_gid="$3"
12
13apt-get update
14apt-get install -y python3 make gcc-aarch64-linux-gnu g++-aarch64-linux-gnu unzip
15wget "https://github.com/Z3Prover/z3/archive/refs/tags/z3-${z3_version}.zip"
16unzip "z3-${z3_version}.zip"
17cd "z3-z3-${z3_version}"
18export CC=aarch64-linux-gnu-gcc
19export CXX=aarch64-linux-gnu-g++
20# See https://docs.aws.amazon.com/linux/al2023/ug/performance-optimizations.html
21export CFLAGS="-march=armv8.2-a+crypto -mtune=neoverse-n1 -ftree-vectorize"
22export CXXFLAGS="${CFLAGS}"
23python3 scripts/mk_unix_dist.py -f --nodotnet --arch=arm64
24cp --preserve=all "./dist/z3-${z3_version}-arm64-glibc-2.31/bin"/*.so /data/out/
25chown "${target_uid}:${target_gid}" /data/out/*