3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-07 18:05:21 +00:00
Commit graph

216 commits

Author SHA1 Message Date
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
Christoph M. Wintersteiger 3b92128ed8 Fixed old-style C variable declaration problem in interpolation C example. 2016-02-16 12:12:59 +00:00
Christoph M. Wintersteiger 9dbb8057ca Merge pull request #449 from kenmcmil/issue243
fixed logging on return of Z3_compute_interpolant...
2016-02-12 12:40:01 +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
Ken McMillan 8b90bc9e91 fixed logginf on return of Z3_compute_interpolant and added interpolation example to test_capi.c 2016-02-11 16:09:54 -08:00
Nikolaj Bjorner 6c6da44f8f removing const qualifiers, perhaps this helps for #420 and adding assert to enable Clang analysis earlier for issue #440
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-02-09 22:24:37 +00:00
Nikolaj Bjorner 5ce85aba40 removing const qualifiers, perhaps this helps for #420 and adding assert to enable Clang analysis earlier for issue #440
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-02-09 22:23:37 +00:00
Christoph M. Wintersteiger 7e3676e24a bugfix for ML example 2016-01-08 13:25:14 +00:00
Christoph M. Wintersteiger de3cb7e5dc More FPA exponent/siginficand order consistency 2016-01-05 18:05:21 +00:00
Dan Liew 83e2b1c6e5 Typo in comment in C api example. 2015-12-15 11:52:35 +00:00
Christoph M. Wintersteiger 134b93b43e ML API build fixes for Windows. 2015-12-14 14:41:19 +00:00
Christoph M. Wintersteiger 771caba9db update ML example readme 2015-12-13 17:44:50 +00:00
Nikolaj Bjorner 64b9a301ed add python visitor example in response to Stackoverflow question
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-12-06 20:09:13 -08:00
Christoph M. Wintersteiger cbda38ee80 Added finite domain expressions and numerals to the .NET, Java, and Python APIs.
Relates to #318
2015-12-02 17:01:52 +00:00
Christoph M. Wintersteiger 52bbd67cd3 Whitespace 2015-12-02 14:40:47 +00:00
Nikolaj Bjorner 436a51d8f0 fix build of maxsat.c
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-11-22 22:10:22 -08:00
Nikolaj Bjorner 3be279dc29 fix build break on maxsat.c example
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-11-21 10:36:24 -08:00
Nikolaj Bjorner 995e112a18 fix examples
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-11-20 08:01:59 -08:00
Nikolaj Bjorner 1d4b996765 merge
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-11-18 16:39:51 -08:00
Nikolaj Bjorner 9cba63c31f remove deprecated iz3 example. Remove deprecated process control
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-11-18 12:32:15 -08:00
Nikolaj Bjorner d7c3e77b66 port test_capi.c to use mostly essentially non-deprecated APIs
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-11-17 18:59:43 -08:00
Nikolaj Bjorner 0f602d652a remove deprecated API functionality
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-11-14 13:47:41 -08:00
Christoph M. Wintersteiger 88b027ecce Eliminated unused variable from C example. 2015-10-29 13:32:58 +00:00
Christoph M. Wintersteiger 2818e977b6 Fixed unused variable warnings in examples. 2015-10-29 13:20:56 +00:00
Christoph M. Wintersteiger bd5b455c46 Refactored iz3 example to avoid compiler warnings. 2015-10-29 13:03:19 +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
Christoph M. Wintersteiger 114f9834dd Adjusted copyright notice. 2015-10-02 19:51:06 +01:00
Nikolaj Bjorner a0894ac7bf add basic example of using optimizaiton context to Java as raised in issue #179
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-07-30 11:32:14 -03:00
Nikolaj Bjorner 21201371ed add reference equality to Symbols for .NET
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-07-11 00:53:13 -07:00
Nikolaj Bjorner 1657cdd8b4 add missing copyright
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-06-17 12:47:19 -07:00
Nikolaj Bjorner e0068e4065 C/right on python scripts
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-06-10 12:01:47 -07: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 e3b1ce1fdc also allw n-ary distrinct
Signed-off-by: Nikolaj Bjorner <nbjorner@hotmail.com>
2015-05-27 10:07:09 -07:00
Nikolaj Bjorner 4f02d380aa make use of uninterpreted_sort shorthand
Signed-off-by: Nikolaj Bjorner <nbjorner@hotmail.com>
2015-05-27 09:34:47 -07:00
Christoph M. Wintersteiger e9f7d558e3 tabs, indentation 2015-05-19 12:40:41 +01:00
Nikolaj Bjorner 0e32c87dc3 fix examples and C++ API - build failure
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-05-15 15:43:05 +01: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 839e3fbb7c add ddnf tests, add facility to solve QF_NRA + QF_UF(and other theories) in joint solver to allow broader use of QF_NRA core
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-05-09 19:40:34 -07: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
Nikolaj Bjorner 3ba2e712b2 merge with unstable branch
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-04-12 15:54:52 -07:00
Christoph M. Wintersteiger 8862cb4833 Java example: Removed throws declarations for Z3Exception. 2015-04-09 14:52:50 +01: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 e456af142e fix complex.py example with power prompted by suggestion of smilliken
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-03-27 02:42:08 -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