diff --git a/README.md b/README.md index fe5483d51f..fcf6e4cec6 100644 --- a/README.md +++ b/README.md @@ -61,20 +61,20 @@ Only a few SMT solvers provide support for theories like Arrays, Floating Point, JavaSMT supports several SMT solvers (see [Getting Started](doc/Getting-started.md) for installation): -| SMT Solver | Linux x64 | Linux arm64 | Windows x64 | Windows arm64 | MacOS x64 | MacOS arm64 | Description | -|-------------------------------------------------------------------------|:-------------------:|:-------------------:|:------------------:|:------------------:|:-------------------------------------------------------:|:------------------:|:----------------------------------------------------------------------------| -| [Bitwuzla](https://bitwuzla.github.io/) | :heavy_check_mark:² | :heavy_check_mark:² | :heavy_check_mark: | | | | a fast solver for bitvector logic | -| [Boolector](https://boolector.github.io/) | :heavy_check_mark: | | | | | | a fast solver for bitvector logic, misses formula introspection, deprecated | -| [CVC4](https://cvc4.github.io/) | :heavy_check_mark: | | | | | | | -| [CVC5](https://cvc5.github.io/) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | -| [MathSAT5](http://mathsat.fbk.eu/) | :heavy_check_mark:³ | :heavy_check_mark:³ | :heavy_check_mark: | | [maybe](https://github.com/sosy-lab/java-smt/pull/430)⁴ | | | -| [OpenSMT](https://verify.inf.usi.ch/opensmt) | :heavy_check_mark:² | :heavy_check_mark:² | | | | | | -| [OptiMathSAT](http://optimathsat.disi.unitn.it/) | :heavy_check_mark: | | | | | | based on MathSAT5, with support for optimization queries | -| [Princess](http://www.philipp.ruemmer.org/princess.shtml) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | Java-based SMT solver | -| [SMTInterpol](https://ultimate.informatik.uni-freiburg.de/smtinterpol/) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | Java-based SMT solver | -| [Yices2](https://yices.csl.sri.com/) | :heavy_check_mark: | | :heavy_check_mark: | | [maybe](https://github.com/sosy-lab/java-smt/pull/400)⁴ | | | -| [Z3](https://github.com/Z3Prover/z3) | :heavy_check_mark:³ | :heavy_check_mark:³ | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | mature and well-known solver | -| [Z3_WITH_INTERPOLATION](https://github.com/Z3Prover/z3) | :heavy_check_mark: | :heavy_check_mark: | | | | | an older version of Z3 that still provides interpolation support | +| SMT Solver | Linux x64 | Linux arm64 | Windows x64 | Windows arm64 | MacOS x64 | MacOS arm64 | Description | +|-------------------------------------------------------------------------|:-------------------:|:-------------------:|:------------------:|:------------------:|:-------------------------------------------------------:|:-----------------------------------------:|:----------------------------------------------------------------------------| +| [Bitwuzla](https://bitwuzla.github.io/) | :heavy_check_mark:² | :heavy_check_mark:² | :heavy_check_mark: | | | | a fast solver for bitvector logic | +| [Boolector](https://boolector.github.io/) | :heavy_check_mark: | | | | | | a fast solver for bitvector logic, misses formula introspection, deprecated | +| [CVC4](https://cvc4.github.io/) | :heavy_check_mark: | | | | | | | +| [CVC5](https://cvc5.github.io/) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | +| [MathSAT5](http://mathsat.fbk.eu/) | :heavy_check_mark:³ | :heavy_check_mark:³ | :heavy_check_mark: | | [maybe](https://github.com/sosy-lab/java-smt/pull/430)⁴ | | | +| [OpenSMT](https://verify.inf.usi.ch/opensmt) | :heavy_check_mark:² | :heavy_check_mark:² | | | | | | +| [OptiMathSAT](http://optimathsat.disi.unitn.it/) | :heavy_check_mark: | | | | | | based on MathSAT5, with support for optimization queries | +| [Princess](http://www.philipp.ruemmer.org/princess.shtml) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | Java-based SMT solver | +| [SMTInterpol](https://ultimate.informatik.uni-freiburg.de/smtinterpol/) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | Java-based SMT solver | +| [Yices2](https://yices.csl.sri.com/) | :heavy_check_mark: | | :heavy_check_mark: | | [partial](doc/How-to-build-for-macOS.md)⁴ | [partial](doc/How-to-build-for-macOS.md)⁴ | | +| [Z3](https://github.com/Z3Prover/z3) | :heavy_check_mark:³ | :heavy_check_mark:³ | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | mature and well-known solver | +| [Z3_WITH_INTERPOLATION](https://github.com/Z3Prover/z3) | :heavy_check_mark: | :heavy_check_mark: | | | | | an older version of Z3 that still provides interpolation support | We support a reasonable list of operating systems and versions. - Our main target is Linux (mainly Ubuntu or comparable Linux distributions). diff --git a/build/build-publish-solvers/solver-yices.xml b/build/build-publish-solvers/solver-yices.xml index 55bdf88f0b..2500d7c5af 100644 --- a/build/build-publish-solvers/solver-yices.xml +++ b/build/build-publish-solvers/solver-yices.xml @@ -50,6 +50,13 @@ SPDX-License-Identifier: Apache-2.0 + + + + + + + @@ -89,6 +96,23 @@ SPDX-License-Identifier: Apache-2.0 + + + + + + + + + + + + + + + + + @@ -129,6 +153,23 @@ SPDX-License-Identifier: Apache-2.0 + + + + + + + + + + + + + + + + + @@ -183,6 +224,33 @@ SPDX-License-Identifier: Apache-2.0 + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -235,6 +303,25 @@ SPDX-License-Identifier: Apache-2.0 + + + + + + + + + + + + + + + + + @@ -246,6 +333,15 @@ SPDX-License-Identifier: Apache-2.0 + + + + + + + + diff --git a/doc/How-to-build-for-macOS.md b/doc/How-to-build-for-macOS.md new file mode 100644 index 0000000000..9ae95b20f6 --- /dev/null +++ b/doc/How-to-build-for-macOS.md @@ -0,0 +1,43 @@ + + +# Building solver binaries for macOS + +We currently can't provide binaries for all supported solvers on macOS. However, it's often +possible to build the necessary binaries from source, and we try to include a simple build +script wherever possible + +## Yices + +To build the Yices binaries, we first need some build dependencies and GMP, which can all be +installed via Homebrew: + +```shell +brew update +brew install gperf lcov autoconf automake libtool +brew install gmp +``` + +Then, we build the Yices2 binaries by running the build script included with JavaSMT: + +```shell +git clone git@github.com:sosy-lab/java-smt.git +cd java-smt +ant publish-yices2-macOS +``` + +The script will build several dependencies before compiling Yices and may run for up to 10 +minutes. Once it's finished the binary `libyices2java.dylib` can be found under `lib/native`. +Depending on your system architecture, it will be either in the `arm64-macos` (ARM) or +`x64_64-macos` (Intel) folder + +You can then either copy the binary to your project folder, or +set `DYLD_LIBRARY_PATH` to include the binary folder to make sure Yices will be found when +running JavaSMT \ No newline at end of file diff --git a/lib/native/source/yices2/jni.patch b/lib/native/source/yices2/jni.patch index 6e1338ac6c..9acfd6e406 100644 --- a/lib/native/source/yices2/jni.patch +++ b/lib/native/source/yices2/jni.patch @@ -52,9 +52,13 @@ diff --git a/src/main/java/com/sri/yices/Makefile b/src/main/java/com/sri/yices/ +LIBS := -lyices -lcudd -lpoly -lgmpxx -lgmp CXX ?= g++ - -@@ -86,7 +94,10 @@ - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -dynamiclib -o $@ yicesJNI.o $(LIBS) + +@@ -83,10 +91,13 @@ + $(CXX) $(CPPFLAGS) $(CXXFLAGS) -Wall -c yicesJNI.cpp + + libyices2java.dylib: yicesJNI.o +- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -dynamiclib -o $@ yicesJNI.o $(LIBS) ++ $(CXX) $(CFLAGS) $(LDFLAGS) -o $@ yicesJNI.o -dynamiclib $(YICES_PATH)/lib/libyices.a $(CUDD_PATH)/lib/libcudd.a $(POLY_PATH)/lib/libpoly.a $(GMP_PATH)/lib/libgmpxx.a $(GMP_PATH)/lib/libgmp.a -lc -lm libyices2java.so: yicesJNI.o - $(CXX) $(CFLAGS) $(LDFLAGS) -shared -o $@ yicesJNI.o $(LIBS)