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

How to use z3 ocaml bindings? #727

Closed
necto opened this issue Sep 4, 2016 · 12 comments
Closed

How to use z3 ocaml bindings? #727

necto opened this issue Sep 4, 2016 · 12 comments

Comments

@necto
Copy link

necto commented Sep 4, 2016

Hello, I was searching over the internet how to use ml bindings, and found only entries from the year 2012 and older.
The readme in examples/ml promises that the example will be compiled together, but it does not. After I do

$ python contrib/cmake/bootstrap.py create
$ mkdir build
$ cd build
$ cmake ..
$ make

I found only c, c++ and tptp examples in the build/examples. There is no trace of any OCaml binary.

@necto
Copy link
Author

necto commented Sep 4, 2016

Nevermind. I found the instruction here:
https://z3.codeplex.com/discussions/473552

It says:

$ python scripts/mk_make.py --ml
$ cd build
$ make
$ make examples
$ LD_LIBRARY_PATH=. ./ml_example

@delcypher
Copy link
Contributor

@necto Building the OCaml bindings has not been implemented for the CMake build system yet. I don't have time to do it now but contributions are welcome.

@necto
Copy link
Author

necto commented Sep 5, 2016

Why does Z3 have multiple build systems (CMake, automake configure script, custom python scripts)?
Which one do you plan to support?

@martin-neuhaeusser
Copy link
Contributor

I will try to integrate the OCaml bindings into the CMake build system once I can spare some time. They should work with the custom (python-based) build system.

@delcypher
Copy link
Contributor

@necto The python/Makefile based build sytem (scripts/mk_make.py) is Z3's original build system and the only one that is officially supported. While it is basically functional it has several flaws that really annoyed me so I started implementing a replacement that uses CMake and was first merged in #461. I've been gradually improving it by implementing missing features (e.g. adding support for building the Java bindings).

The CMake build system is not officially supported but I'm hoping it will be accepted as a replacement build system once it reaches feature parity with the old build system. Until that happens we need to have the two build systems exist in parallel with each other.

@NikolajBjorner
Copy link
Contributor

Super, I mostly use the cmake based system and i would assume many others do. Dan did a super job. For Adding missing targets it helps knowing how to operate cmake and also having use of the new target.

@wintersteiger
Copy link
Contributor

@martin-neuhaeusser: Fantastic, thanks for tackling this one! They should indeed work with the current build system, but we recently had a bug report about the bytecode version not working (#724), so something may have changed in OCaml land again.

@NikolajBjorner
Copy link
Contributor

so the status of this is still open and related to #986?

@delcypher
Copy link
Contributor

@NikolajBjorner Yes I've not had time to implement the OCaml bindings for the CMake build system. It's rather a lot of work and there's no benefit for me so I have very little motivation to do the work. I will have some free time in a few months to do this but of course if someone else wants to tackle this I'll happily review the changes.

@NikolajBjorner
Copy link
Contributor

@delcypher, of course. Martin is an ocaml user and expressed intent to do something. The cmake system has so other advantages.

@martin-neuhaeusser
Copy link
Contributor

I will have a look into this - sadly, time has been a rather limited resource :-(
But I agree that having the OCaml bindings in cmake would be nice. I see what I can do.

@delcypher
Copy link
Contributor

@martin-neuhaeusser Have you had a chance to look at implementing the OCaml bindings for CMake? I have a bit of spare time over the next few weeks so I can start implementing this if you haven't already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants