From d706d43712cdc715123ee67037d56a915e60206a Mon Sep 17 00:00:00 2001 From: ahumenberger Date: Wed, 13 May 2020 04:34:47 +0200 Subject: [PATCH] Update README with infos about Julia bindings (#4298) * Update README for Julia bindings * Fix links in readme * Add hash of z3_jll * Fix typo --- README.md | 15 ++++++++------- src/api/julia/README.md | 26 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 src/api/julia/README.md diff --git a/README.md b/README.md index 33c6b25f4..e3a63afae 100644 --- a/README.md +++ b/README.md @@ -202,7 +202,7 @@ See [``examples/python``](examples/python) for examples. ### ``Julia`` -[Julia bindings](src/api/julia) can be enabled using the build option `Z3_BUILD_JULIA_BINDINGS` from the CMake system. +The Julia package [Z3.jl](https://github.com/ahumenberger/Z3.jl) wraps the C++ API of Z3. Information about updating and building the Julia bindings can be found in [src/api/julia](src/api/julia). ### ``Web Assembly`` @@ -217,11 +217,12 @@ See [``examples/python``](examples/python) for examples. * Default input format is [SMTLIB2](http://smtlib.cs.uiowa.edu) * Other native foreign function interfaces: - * [C++ API](https://z3prover.github.io/api/html/group__cppapi.html) - * [.NET API](https://z3prover.github.io/api/html/namespace_microsoft_1_1_z3.html) - * [Java API](https://z3prover.github.io/api/html/namespacecom_1_1microsoft_1_1z3.html) - * [Python API](https://z3prover.github.io/api/html/namespacez3py.html) (also available in [pydoc format](https://z3prover.github.io/api/html/z3.html)) - * C - * OCaml +* [C++ API](https://z3prover.github.io/api/html/group__cppapi.html) +* [.NET API](https://z3prover.github.io/api/html/namespace_microsoft_1_1_z3.html) +* [Java API](https://z3prover.github.io/api/html/namespacecom_1_1microsoft_1_1z3.html) +* [Python API](https://z3prover.github.io/api/html/namespacez3py.html) (also available in [pydoc format](https://z3prover.github.io/api/html/z3.html)) +* C +* OCaml +* [Julia](https://github.com/ahumenberger/Z3.jl) diff --git a/src/api/julia/README.md b/src/api/julia/README.md new file mode 100644 index 000000000..ec4b1e109 --- /dev/null +++ b/src/api/julia/README.md @@ -0,0 +1,26 @@ +# Julia bindings + +The Julia package [Z3.jl](https://github.com/ahumenberger/Z3.jl) provides and interface to Z3 by exposing its C++ API via [CxxWrap.jl](https://github.com/JuliaInterop/CxxWrap.jl). The bindings therefore consist of a [C++ part](z3jl.cpp) and a [Julia part](https://github.com/ahumenberger/Z3.jl). The C++ part defines the Z3 types/methods which are exposed. The resulting library is loaded in the Julia part via CxxWrap.jl which creates the corresponding Julia types/methods. + +## Building the C++ part + +In order to build the Julia bindings the build option `Z3_BUILD_JULIA_BINDINGS` has to be enabled via CMake and [libcxxwrap-julia](https://github.com/JuliaInterop/libcxxwrap-julia) has to be present. Infos about obtaining the libcxxwrap prefix can be found [here](https://github.com/JuliaInterop/CxxWrap.jl#compiling-the-c-code). + +``` +mkdir build && cd build +cmake -DCMAKE_BUILD_TYPE=Release -DZ3_BUILD_JULIA_BINDINGS=True -DCMAKE_PREFIX_PATH=/path/to/libcxxwrap-julia-prefix .. +make +``` + +## Julia part + +The Z3 binaries are provided to [Z3.jl](https://github.com/ahumenberger/Z3.jl) via [z3_jll.jl](https://github.com/JuliaBinaryWrappers/z3_jll.jl). That is, in order to release a new Z3 version one has to update the corresponding [build script](https://github.com/JuliaPackaging/Yggdrasil/tree/master/Z/z3) which triggers a new version of z3_jll.jl. + +### Using the compiled version of Z3 + +The binaries are managed via the JLL package z3_jll. To use your own binaries, you need to set up an overrides file, by default at `~/.julia/artifacts/Overrides.toml` with the following content: + +```toml +[1bc4e1ec-7839-5212-8f2f-0d16b7bd09bc] +z3 = "/path/to/z3/build" +```