about summary refs log tree commit diff homepage
path: root/scripts/build/solver-z3.sh
blob: c6c3381dc1f142e049d413b0c5369d7c9d844bb6 (plain) (blame)
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
#!/bin/bash -x

# Make sure we exit if there is a failure
set -e
DIR="$(cd "$(dirname "$0")" && pwd)"
source "${DIR}/common-defaults.sh"

if [[ -z "${Z3_VERSION}" ]] ; then
  echo "Z3_VERSION is not defined"
  exit 1
fi

if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
  mkdir -p "${BASE}/z3-${Z3_VERSION}"
  cd "${BASE}/z3-${Z3_VERSION}"
  wget -qO- https://github.com/Z3Prover/z3/archive/z3-${Z3_VERSION}.tar.gz | tar xz --strip-components=1
  LDFLAGS="${SANITIZER_LD_FLAGS}" \
  CXXFLAGS="${SANITIZER_CXX_FLAGS}" \
  python scripts/mk_make.py --prefix "${BASE}/z3-${Z3_VERSION}-install"
  cd build
  make -j$(nproc)
  make install
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
  set +e
  brew install python@2
  if [[ "X$?" != "X0" ]]; then
     brew link --overwrite python@2
  fi
  set -e
  brew install z3
else
  echo "Unhandled TRAVIS_OS_NAME \"${TRAVIS_OS_NAME}\""
  exit 1
fi