3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-08 18:31:49 +00:00
Commit graph

38 commits

Author SHA1 Message Date
Dan Liew 9b48b5ca83 When building with OpenMP make sure libz3 passes extra linker
flags. This is necessary for libz3 to be usable from the Python
bindings when libz3 is built with gcc or clang.
2016-03-04 15:26:09 +00:00
Dan Liew ca6c41e411 Don't append ${OpenMP_CXX_FLAGS} to Z3_DEPENDENT_LIBS. This is wrong
because this is passed to ``target_link_libraries()``. It just so
happens that ``target_link_libraries()`` will interpret arguments
starting with a dash as a flag to pass to the linker (i.e. in this
case ``-fopenmp``). However in the case of MSVC that flag is ``/openmp``
which is the interpreted as a file path which will lead to a linker
failure later because the linker can't find the file ``\openmp.obj``.
2016-03-04 15:26:09 +00:00
Dan Liew 251527603d Implement a CMake build system.
This is a large rework of my first attempt at this (#459).

This implementation calls into the recently implemented python scripts
to generate the necessary generated ``.h`` and ``.cpp`` files but is
independent from Python building system otherwise.  Unlike the Python
build system, the generated files are emitted into the build tree to
avoid polluting the source tree. The build system is setup to refuse to
configure if it detects generated files in the source tree. If your
source tree is dirty you can run ``git clean -fx`` to clean your working
directory.

Currently the build succeeds on Linux using CMake 3.4.3 using
the "Unix Makefiles" generator with gcc or clang.

The following notable features are implemented:

* Building of the C and C++ examples and the ``test-z3`` executable.
  These are included from the ``all`` target so you have to tell the
  build system (e.g. make) to build them manually.

* Install (``make install``) and uninstall (``make uninstall``) of libz3
  and its header files. This supports ``DESTDIR`` out of the box because
  CMake supports it.

* An option (``BUILD_LIBZ3_SHARED``) to build libz3 as a static or dynamic library.

* Support for using/not using OpenMP (``USE_OPENMP``)

* Support for using/not using libgmp (``USE_LIB_GMP``)

* Setting the SOVERSION for libz3. I'm not sure if I'm setting the
* number correctly though. This is required by Linux distrubtions that
  wills ship libz3. This needs discussion.

The following notable features are currently not implemented
and are left for future work.

* Support for ARM.
* Support for the foci2 library.
* Support for creating/installing/uninstalling the dotnet, java, python and ml
  bindings.
* Full support for MSVC. Although I've tried to write the CMake code
  with MSVC in mind not all the correct flags are passed to it.
* Support for using the git hash.

This new build system has several advantages other the old build system.

* It is easier for outside contributors to contribute to Z3 when the
  build system is something more standard.
* Incremental builds work properly. With the old build system when
  new code is pulled down the old build directory would need to thrown
  out and a new fresh build had to be performed because the build system
  didn't know how to correctly rebuild the project (e.g. couldn't handle
  new sources being added/removed, compiler flags changing, generated
  files changing, etc...). This is a MASSIVE boost to productivity!
* We now have access rich array of features that CMake provides for
  building C/C++ projects. This means less time spent implementing
  custom build system logic in Python that is already supported by
  CMake.
* CMake supports many IDEs out of the box so it should be fairly
  straight forward to build Z3 with Visual Studio (once support for MSVC
  is added), Xcode, Eclipse CDT, CLion, ..etc.
2016-03-04 15:26:09 +00:00
Nikolaj Bjorner 8d61d36c3f add documentation methods to param_descrs, add C++ API and example for param_descrs. Issue #443
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-02-12 11:45:00 +00:00
Christoph M. Wintersteiger 2818e977b6 Fixed unused variable warnings in examples. 2015-10-29 13:20:56 +00:00
Christoph M. Wintersteiger a1eee6275f Bugfix for C++ examples.
Relates to #26
2015-10-19 19:03:36 +01:00
Christoph M. Wintersteiger a6f85f3932 Merge branch 'sudoku-in-c++' of https://github.com/benlaurie/z3 into benlaurie-sudoku-in-c++
# Conflicts:
#	examples/c++/example.cpp
2015-10-19 14:09:36 +01:00
Nikolaj Bjorner d469a16bb8 add more Copyright notes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-06-10 11:59:21 -07:00
Nikolaj Bjorner ab5022888c Merge branch 'opt' of https://github.com/Z3Prover/z3 into unstable 2015-05-14 12:11:17 +01:00
Nikolaj Bjorner 4a9d97bd02 add concat to z3++, codeplex request
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-05-08 21:29:48 -07:00
Ben Laurie 0f467eb599 Pull out the solver. 2015-04-05 17:57:21 +01:00
Ben Laurie e8b8393c31 Add Sudoku example. 2015-04-05 17:44:26 +01:00
Nikolaj Bjorner 52619b9dbb pull unstable
Signed-off-by: Nikolaj Bjorner <nbjorner@hotmail.com>
2015-04-01 14:57:11 -07:00
Nikolaj Bjorner 0482e7fe72 cache datatype util in context to avoid performance bug, codeplex issue 195
Signed-off-by: Nikolaj Bjorner <nbjorner@hotmail.com>
2015-03-25 11:46:28 -07:00
Nikolaj Bjorner 39892aae10 cache datatype util in context to avoid performance bug, codeplex issue 195
Signed-off-by: Nikolaj Bjorner <nbjorner@hotmail.com>
2015-03-25 11:46:17 -07:00
Nikolaj Bjorner 8059a5a0b7 cache datatype util in context to avoid performance bug, codeplex issue 195
Signed-off-by: Nikolaj Bjorner <nbjorner@hotmail.com>
2015-03-25 11:36:01 -07:00
Nikolaj Bjorner 86ac20faf6 cache datatype util in context to avoid performance bug, codeplex issue 195
Signed-off-by: Nikolaj Bjorner <nbjorner@hotmail.com>
2015-03-25 11:35:44 -07:00
Nikolaj Bjorner 2aa91eee70 cache datatype util in context to avoid performance bug, codeplex issue 195
Signed-off-by: Nikolaj Bjorner <nbjorner@hotmail.com>
2015-03-25 11:24:47 -07:00
nikolajbjorner 3ca3c948cf add bit-vector extract shortcuts to C++ API
Signed-off-by: nikolajbjorner <nbjorner@microsoft.com>
2015-02-27 11:08:49 -08:00
Nikolaj Bjorner 08cb8b8de8 address divergence in the case of shared theory symbols. Codeplex issue 147, thanks to George Karpenkov
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2014-12-09 16:04:25 +01:00
Nikolaj Bjorner b4600ffda0 add print to SMT-LIB format from solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2014-10-31 14:24:21 +01:00
Nikolaj Bjorner ce18421a7a fix box
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2014-10-15 14:29:39 -07:00
Nikolaj Bjorner 7ef1e8a3de turn friends into inliers to respect namespace for non-operator friends. Operaor friends will stil be in file scope so do not take name-space qualifier
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2014-10-05 19:04:15 -07:00
Nikolaj Bjorner 3f8083dfa6 fix push/pop bugs in optimize context, add example to c++, fix bug in arithemtic bounds axiom addition
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2014-09-02 09:32:38 -07:00
Nikolaj Bjorner d118f07e37 fix maximize name in C++ API
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2014-04-22 14:48:05 +02:00
Leonardo de Moura edb2f8554d Add new example
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-05-27 17:45:56 -07:00
Leonardo de Moura c8c5f30b49 Add new C++ APIs for creating forall/exists expressions.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-05-09 21:30:31 -07:00
Leonardo de Moura 157b5f0d9c Add expr_vector example
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-05-07 08:10:43 -07:00
Leonardo de Moura b2810592e6 Add enumeration_sort method to C++ API. Add as_expr method to goal class in C++ API. Add enum_sort_example to C++ examples/c++/example.cpp
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-02-26 08:29:01 -08:00
Leonardo de Moura c430fe26aa Add ite operator to the C++ API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-01-04 08:29:25 -08:00
Leonardo de Moura 7b1fac11e6 Add new C++ examples
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-12-19 12:33:14 -08:00
Leonardo de Moura 0ec6e2f218 adjusting examples
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-12-03 15:19:47 -08:00
Leonardo de Moura caced62f40 New API for adding 'tracked assertions'. Added wrappers for creating existential and universal quantifiers in the C++ API fronted. Added new examples for the C++ API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-11-10 15:54:31 -08:00
Leonardo de Moura a5ceff98ea cleaned exampled
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-11-08 07:11:22 -08:00
Leonardo de Moura 1cf8d61def new example
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-11-08 07:00:27 -08:00
Leonardo de Moura e08c569d8d new qe example
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-11-02 12:04:02 -07:00
Leonardo de Moura be97785253 c++ example
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-10-28 10:06:02 -07:00
Leonardo de Moura e2f4943b4e moved dll and examples
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-10-23 16:33:20 -07:00