Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brew install z3 #1448

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ LLVMVer=${MajorLLVMVer}.0.0
UbuntuArmLLVM="https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVMVer}/clang+llvm-${LLVMVer}-aarch64-linux-gnu.tar.xz"
UbuntuLLVM="https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVMVer}/clang+llvm-${LLVMVer}-x86_64-linux-gnu-ubuntu-18.04.tar.xz"
SourceLLVM="https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-${LLVMVer}.zip"
MacZ3="https://github.com/Z3Prover/z3/releases/download/z3-4.8.8/z3-4.8.8-x64-osx-10.14.6.zip"
MacArmZ3="https://github.com/Z3Prover/z3/releases/download/z3-4.9.1/z3-4.9.1-arm64-osx-11.0.zip"
UbuntuZ3="https://github.com/Z3Prover/z3/releases/download/z3-4.8.8/z3-4.8.8-x64-ubuntu-16.04.zip"
SourceZ3="https://github.com/Z3Prover/z3/archive/refs/tags/z3-4.8.8.zip"

Expand Down Expand Up @@ -151,10 +149,8 @@ OSDisplayName=""
if [[ $sysOS == "Darwin" ]]; then
check_and_install_brew
if [[ "$arch" == "arm64" ]]; then
urlZ3="$MacArmZ3"
OSDisplayName="macOS arm64"
else
urlZ3="$MacZ3"
OSDisplayName="macOS x86"
fi
elif [[ $sysOS == "Linux" ]]; then
Expand Down Expand Up @@ -211,18 +207,25 @@ if [[ ! -d "$Z3_DIR" ]]; then
if [[ "$sysOS" = "Linux" && "$arch" = "aarch64" ]]; then
# only linux arm build from source
build_z3_from_source
elif [[ "$sysOS" = "Darwin" ]]; then
echo "Downloading Z3 binary for $OSDisplayName"
brew install z3
if [ $? -eq 0 ]; then
echo "z3 binary installation completed."
else
echo "z3 binary installation failed."
exit 1
fi
mkdir -p $SVFHOME/$Z3Home
ln -s $(brew --prefix z3)/* $SVFHOME/$Z3Home
else
# everything else downloads pre-built lib includ osx "arm64"
# everything else downloads pre-built lib
echo "Downloading Z3 binary for $OSDisplayName"
generic_download_file "$urlZ3" z3.zip
check_unzip
echo "Unzipping z3 package..."
unzip -q "z3.zip" && mv ./z3-* ./$Z3Home
rm z3.zip
if [[ "$sysOS" == "Darwin" ]]; then
# Fix missing rpath information in libz3
install_name_tool -id @rpath/libz3.dylib "$Z3Home/bin/libz3.dylib"
fi
fi
fi

Expand Down
Loading