Skip to content

Commit

Permalink
Merge pull request #1448 from jumormt/patch-1
Browse files Browse the repository at this point in the history
brew install z3
  • Loading branch information
yuleisui authored Apr 28, 2024
2 parents fcfe1a2 + ca788c0 commit ab594ab
Showing 1 changed file with 12 additions and 9 deletions.
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

0 comments on commit ab594ab

Please sign in to comment.