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

781 commits

Author SHA1 Message Date
Dan Liew 3042f0f964 Fix inconsistent emission of Java enumeration files. The ordering of emitted
enum values is not consistent between python 2 or 3. The root cause
of the problem was a dictionary's keys being iterated over which has
no defined order.

This has been fixed by iterating over the dictionary's items and
ordering by values.  We could order by key rather than the values but
seeing as these represent an enum, ordering by value makes more sense.
2016-04-17 19:03:17 +01:00
Dan Liew b3713e7496 Refactor `mk_z3consts_java() code into mk_z3consts_java_internal()`
and move that into ``mk_genfile_common.py``. Then adapt ``mk_util.py`` and
``mk_consts_files.py`` to call into the code at its new location.

The purpose of this change is to have Python code common to the Python
and CMake build systems separate from Python code that is only used for
the Python build system.
2016-04-17 19:03:17 +01:00
martin-neuhaeusser b873c6b508 Simplify OCaml API
This patch simplifies the implementation of the OCaml bindings. For example,
the applyX wrapper functions have become unnecessary in the new OCaml API.
It also removes the internal ML2C structure that was used as an intermediate
layer between the C and the OCaml layer.
2016-04-06 12:10:59 +02:00
martin-neuhaeusser f133f478c8 Translate correctly between OCaml option values and NULL pointers
This patch refactors the update_api script and the z3.ml implementation
to properly translate between OCaml options and NULL pointers. Some
unifications and simplifications (avoidance of unnecessary value allocation)
in the script that creates the native bindings.
2016-04-04 17:16:15 +02:00
martin-neuhaeusser b85516c271 Fix reference counting in the C layer of the OCaml bindings
The Z3 context and its reference counters are stored in a structure which is allocated
by the C layer outside the OCaml heap, whenever a Z3 context is created. The structure
and its Z3 context are disposed, once the last reference counter reaches zero. Reference
counters are decremented by C-level finalizers.

The OCaml representations for a Z3 context wrap only a pointer to the corresponding structure.
2016-04-03 09:41:06 +02:00
Christoph M. Wintersteiger b178420797 Merge branch 'master' of https://github.com/Z3Prover/z3 into new-ml-api 2016-03-31 18:11:30 +01:00
Martin R. Neuhaeusser feae0e8277 Use a custom block for storing a Z3_config in the ML bindings. 2016-03-31 18:31:59 +02:00
Christoph M. Wintersteiger 2eced4676f Merge pull request #539 from delcypher/cmake_dotnet_bindings
[CMake] Teach CMake to build .NET bindings
2016-03-29 13:56:35 +01:00
martin-neuhaeusser 28f9c61d76 Include *.cmx files during installation of OCaml bindings.
The *.cmx files are now installed using ocamlfind. They contain information from the
compiler that can be used during optimization (the upcoming OCaml 4.03.0 issues
warning 58 if those files are missing from a package).
2016-03-28 17:08:22 +02:00
Dan Liew 23ac66ef42 Fix inconsistent emission of `Enumerations.cs`. The ordering of emitted
enum values is not consistent between python 2 or 3. The root cause
of the problem was a dictionary's keys being iterated over which has
no defined order.

This has been fixed by iterating over the dictionary's items and
ordering by values.  We could order by key rather than the values but
seeing as these represent an enum, ordering by value makes more sense.
2016-03-26 17:59:11 +00:00
Dan Liew d3f87e44a2 Refactor `mk_z3consts_dotnet() code into mk_z3consts_dotnet_internal()`
and move that into ``mk_genfile_common.py``. Then adapt ``mk_util.py`` and
``mk_consts_files.py`` to call into the code at its new location.

The purpose of this change is to have Python code common to the Python
and CMake build systems separate from Python code that is only used for
the Python build system.
2016-03-26 17:59:11 +00:00
Bobby Powers 7bb085a565 build: allow overriding of 'ar' in mk_config
This will still use 'ar' if AR isn't set in the environment, but lets
us override the default archive tool at configure time.

Just like CC and CXX, this doesn't apply to a ./configure for Windows.
2016-03-22 10:47:51 -04:00
Nikolaj Bjorner 67dc5ce2b5 fix cmake issues
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-03-19 15:51:31 -07:00
Nikolaj Bjorner 20bbdfe31a moving remaining qsat functionality over
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-03-19 15:35:26 -07:00
Dan Liew 4814555c46 Fix inconsistent emission of `gparams_register_modules.cpp`,
``install_tactics.cpp`` and ``mem_initialiszer.cpp`` files between
the CMake and Python build systems.

The problem was that the generated files were

* Senstive to the order component directories were traversed
* For CMake there are two directories (a source and build directory)
  for every component rather than a single directory like the
  Python build system has.

To fix this a new function ``sorted_headers_by_component()`` has been
added which defines a order that is consistent between both build
systems. This function is then used on lists of paths to discovered
header files.
2016-03-13 23:00:40 +00:00
Dan Liew 75af362b25 Fix inconsistent emission of `z3consts.py`. The ordering of emitted
enum values is not consistent between python 2 or 3. The root cause
of the problem was a dictionary's keys being iterated over which has
no defined order.

This has been fixed by iterating over the dictionary's items and
ordering by values.  We could order by key rather than the values but
seeing as these represent an enum, ordering by value makes more sense.
2016-03-12 23:27:26 +00:00
Dan Liew a2376b1016 Try to fix #510. The breakage was caused by #498.
The issue here is that in Python2 ``exec`` is a statement and
``exec`` is a function in Python3. For the ``exec`` statement to
work we would need to write

```
exec line.strip(' \n') in  exec_globals, None
```

We could write a wrapper function to do the right thing depending
on the Python version but a better approach is to actually just
use ``eval()`` rather than ``exec()`` because

* ``eval()`` is less "evil" than ``exec()`` because it only evaluates
  a single expression. My testing so far seems to indicate that this is
  sufficient.

* ``eval()`` is function in both Python 2 and 3 so we don't need
  to specialise the code based on Python version.
2016-03-12 22:22:20 +00:00
Dan Liew b3f6a3c4af Remove use of global data structures in
``mk_install_tactic_cpp_internal()``
2016-03-09 11:22:49 +00:00
Dan Liew 87e99cd734 Move the code for generating `*.hpp files from *.pyg from mk_util.py` to
``mk_genfile_common.py``. A new function ``mk_hpp_from_pyg()`` has been added
which provides a more sensible interface (hides the nasty ``exec()`` stuff)
to create the ``*.hpp`` files from ``*.pyg`` files.

Both ``mk_util.py`` and ``pyg2hpp.py`` have been modified to use the new
interface.

Whilst I'm here reindent ``pyg2hpp.py``.

The purpose of this change is to have Python code common to the Python
and CMake build systems separate from Python code that is only used for
the Python build system.

I've tested this change by making sure that the all the ``*.hpp``
files generated from ``*.pyg`` files match the files generated
before this change.
2016-03-09 11:22:49 +00:00
Dan Liew 8840e5a00f Move `mk_pat_db_internal() from mk_util.py` to
``mk_genfile_common.py`` and adapt ``mk_util.py`` and
``mk_pat_db.py`` to use the code at its new location.

Whilst I'm here reindent ``mk_mem_initializer_cpp.py``.

The purpose of this change is to have Python code common to the Python
and CMake build systems separate from Python code that is only used for
the Python build system.
2016-03-09 11:22:48 +00:00
Dan Liew 114e165fad Move `mk_mem_initializer_cpp_internal() from mk_util.py` to
``mk_genfile_common.py`` and adapt ``mk_util.py`` and
``mk_mem_initializer_cpp.py`` to use the code at its new location. The interface
has been changed slightly so that ``mk_mem_initializer_cpp_internal()`` now
returns the path the generated file. The motivation behind this is so that
clients of the function know the path of the generated file.

Whilst I'm here reindent ``mk_mem_initializer_cpp.py`` and the relevant
code in ``mk_util.py``.

The purpose of this change is to have Python code common to the Python
and CMake build systems separate from Python code that is only used for
the Python build system.
2016-03-09 11:22:48 +00:00
Dan Liew f4e98a4fe5 Move `mk_install_tactic_cpp_internal() from mk_util.py` to
``mk_genfile_common.py`` and adapt ``mk_util.py`` and
``mk_install_tactic_cpp.py`` to use the code at its new location. The interface
has been changed slightly so that ``mk_install_tactic_cpp_internal()`` now
returns the path the generated file. The motivation behind this is so that
clients of the function know the path of the generated file.

Whilst I'm here reindent ``mk_install_tactic_cpp.py`` and the relevant
code in ``mk_util.py``.

The purpose of this change is to have Python code common to the Python
and CMake build systems separate from Python code that is only used for
the Python build system.
2016-03-09 11:22:48 +00:00
Dan Liew 404aa2a5a0 Move `mk_gparams_register_modules_internal() from mk_util.py`
to ``mk_genfile_common.py`` and adapt ``mk_util.py`` and
``mk_gparams_register_modules_cpp.py`` to use the code at its new
location. The interface has been changed slightly so that
``mk_gparams_register_modules_internal()`` now returns the path
to the generated file. The motivation behind this so that clients
of the function know the path to the generated file.

Whilst I'm here reindent ``mk_gparams_register_modules_cpp.py``
and the relevant code in ``mk_util.py``.

Also remove duplicated code that is now available in
``mk_genfile_common.py``.

The purpose of this change is to have Python code common to the Python
and CMake build systems separate from Python code that is only used for
the Python build system.
2016-03-09 11:22:48 +00:00
Dan Liew 8a35f744c7 Move `mk_def_file_internal() out of mk_util.py` into
``mk_genfile_common.py`` and adapt ``mk_util.py`` and
``mk_def_file.py`` to use the code at its new location.

Whilst I'm here also reindent ``mk_def_file.py`` and make it
use some of the code in ``mk_genfile_common.py`` to avoid code
duplication.

The purpose of this change is to have Python code common to the Python
and CMake build systems separate from Python code that is only used for
the Python build system.
2016-03-09 11:22:48 +00:00
Dan Liew 2b64729b21 Move `mk_z3consts_py_internal() out of mk_util.py` into
``mk_genfile_common.py`` and adapt ``mk_util.py`` and
``mk_consts_files.py`` to use the code at its new location. The
interface has been changed slightly so that
``mk_z3consts_py_internal()`` now returns the path to the generated
file. The motivation behind this is so that clients of the function
know the path to the generated file.

Whilst I'm here also reindent ``mk_consts_files.py`` and move some of
its code into ``mk_genfile_common.py`` so it can be shared.

Also update Z3_GENERATED_FILE_EXTRA_DEPENDENCIES in the CMake build
so it knows about ``mk_genfile_common.py``.

The purpose of this change is to have Python code common to the Python
and CMake build systems separate from Python code that is only used for
the Python build system.
2016-03-09 11:22:48 +00:00
Christoph M. Wintersteiger cfda8e9e03 Merge branch 'master' of https://github.com/Z3Prover/z3 into new-ml-api 2016-03-08 14:32:30 +00:00
Dan Liew 589227235e Try to improve some of the comments in `scripts/update_api.py`
based on discussion in #461.
2016-03-07 18:45:34 +00:00
Christoph M. Wintersteiger 3968423c26 build fix for ML API 2016-03-07 15:35:25 +00:00
Christoph M. Wintersteiger 0ea2ac3f28 API script fix 2016-03-07 14:21:33 +00:00
Christoph M. Wintersteiger 027331aef2 resolved merge conflicts 2016-03-07 14:20:10 +00:00
Christoph M. Wintersteiger a9ffc258d0 Merge branch 'cmake_build_system4' of https://github.com/delcypher/z3-1 into delcypher-cmake_build_system4 2016-03-07 13:12:04 +00:00
Christoph M. Wintersteiger eccf03aaac build fix for non-windows platforms 2016-03-07 11:21:06 +00:00
Christoph M. Wintersteiger 03a8ef2795 Fixed non-Windows preprocessor options.
Fixes #463
2016-03-05 17:14:19 +00:00
Christoph M. Wintersteiger 09832ca807 Fixed static Windows binary build. 2016-03-05 13:58:28 +00:00
Christoph M. Wintersteiger 40c5152075 Added --staticbin option.
Relates to #456
2016-03-04 18:32:45 +00:00
Dan Liew 1d9a7dcf47 Add missing shebang in `scripts/update_api.py`. The script
was already marked as executable but it wasn't possible to execute
from a shell due to the missing shebang.
2016-03-04 15:31:56 +00:00
Dan Liew d54d6b50f0 Teach the Python build system to use the `version.h.in` template file used
by the CMake build and use the existing ``configre_file()`` function
to generate the ``version.h`` file needed by the build.
2016-03-04 15:26:09 +00:00
Dan Liew 8bc7d319c7 Refactor `mk_z3consts_py()` to that is usable externally via a new
function ``mk_z3consts_py_internal()`` which called by a new
``mk_consts_files.py`` script. This will script will allow the const
declarations for the different Z3 language bindings to be generated.
Right now only support for python is implemented but more can be added
in the future.
2016-03-04 15:26:09 +00:00
Dan Liew f6e946443e Made emission of the API module files `api_log_macros.h`,
``api_log_macros.cpp`` and ``api_commands.cpp`` optional in
``update_api.py``. This is required to implement support for
building and installing Z3's API bindings with CMake.
2016-03-04 15:26:09 +00:00
Dan Liew 46ac368f86 Refactor `mk_def_file()` so that it is usable externally via a new
function ``mk_def_file_internal()`` which is called by a
new ``mk_def_file.py`` script. This will allow other build systems to
generate the ``api_dll.def`` file.
2016-03-04 15:26:09 +00:00
Dan Liew db34baa979 Partially refactor the code in `update_api.py` so that it can
be used as a script for other build systems and is callable via
a new ``generate_files()`` function from ``mk_util.py``. This removes
the horrible ``_execfile()`` hack that was previously in ``mk_util.py``.

Unfortunately lots of bad code is still in ``update_api.py`` but
fixing all of its problems is too much work right now.
2016-03-04 15:26:09 +00:00
Dan Liew 2b3fe3d02c Refactor `mk_gparams_register_modules()` so that it is usable externally via a new
function ``mk_gparams_register_modules_internal()`` which is called by a
new ``mk_gparams_register_modules_cpp.py`` script. This will allow other build systems to
generate the ``gparams_register_modules.cpp`` files.
2016-03-04 15:22:00 +00:00
Dan Liew 2f7f022605 Refactor `mk_mem_initializer_cpp()` so that it is usable externally via a new
function ``mk_mem_initializer_cpp_internal()`` which is called by a
new ``mk_mem_initializer_cpp.py`` script. This will allow other build systems to
generate the ``mem_initializer.cpp`` files.
2016-03-04 15:22:00 +00:00
Dan Liew a13438818f Refactor `mk_install_tactic_cpp()` so that it is usable externally via a new
function ``mk_install_tactic_cpp_internal()`` which is called by a
new ``mk_install_tactic_cpp.py`` script. This will allow other build systems to
generate the ``install_tactic.cpp`` files.
2016-03-04 15:22:00 +00:00
Dan Liew ef58179462 Refactor `mk_pat_db()` so that it is usable externally via a new function
``mk_pat_db_internal()`` which is called by a new ``mk_pat_db.py`` script. This
will allow other build systems to generate the ``database.h`` file.
2016-03-04 15:22:00 +00:00
Dan Liew 9558dc14fb Refactor `exec_pyg_scripts()` so that it is usable externally
via a new ``pyg2hpp.py`` script. This will allow other build systems to
take ``pyg`` files and generate the corresponding ``hpp`` files.
2016-03-04 15:22:00 +00:00
Christoph M. Wintersteiger c9a5676346 Merge branch 'master' of https://github.com/Z3Prover/z3 into new-ml-api 2016-03-04 15:15:16 +00:00
Christoph M. Wintersteiger cf5910e041 typos 2016-03-04 15:08:03 +00:00
Christoph M. Wintersteiger b27977ea90 Merge branch 'master' of https://github.com/Z3Prover/z3 into new-ml-api 2016-03-02 15:14:12 +00:00
Christoph M. Wintersteiger 4fe4db6657 build fix for static libray on Windows 2016-03-01 17:34:45 +00:00
Nikolaj Bjorner 4cf72e23e6 fix python 3 compat
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-02-27 09:58:45 -08:00
Nikolaj Bjorner ce8862d415 fix bug in conflict clause generation in seq-branch-variable
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-02-26 18:15:45 -08:00
Christoph M. Wintersteiger 0930cfc53f ML API build fixes for cygwin 2016-02-15 15:44:46 +00:00
Christoph M. Wintersteiger 62cae4186b ML API bug fixes 2016-02-15 12:54:05 +00:00
Christoph M. Wintersteiger 18c0a3bfaf removed comments 2016-02-14 19:57:21 +00:00
Christoph M. Wintersteiger b99fcb9c8a More new OCaml API 2016-02-14 19:56:22 +00:00
Christoph M. Wintersteiger 824169da0a New OCaml API 2016-02-13 22:09:45 +00:00
Nikolaj Bjorner e484fc365d add outline of bv bounds tactic
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-02-12 22:57:47 +00:00
Christoph M. Wintersteiger c01f0323c3 Merge branch 'lackr' of https://github.com/MikolasJanota/z3 into MikolasJanota-lackr 2016-02-10 14:26:04 +00:00
Christoph M. Wintersteiger a16f524eae Install target fix for ocamlfind_install on Windows.
Relates to #409
2016-02-09 19:58:52 +00:00
Mikolas Janota b614e7732b Merge remote-tracking branch 'upstream/master' into lackr 2016-02-08 12:54:22 +00:00
Dan Liew 508d2e32c8 Fix a bug in Python build scripts where an extra ending slash in the
build directory would cause REV_BUILD_DIR to be set incorrectly and
would lead to a broken Makefile being generated.

What would happen before:

```
$ python scripts/mk_make.py --build FOO_1
...
REV_BUILD_DIR='..'
```

```
$ python scripts/mk_make.py --build FOO_1/
...
REV_BUILD_DIR='../..'
```
^^^^^ that's wrong. It should be REV_BUILD_DIR='..'

To fix this the ``reverse_path()`` function has been taught to ignore empty
components in ``p.split(os.sep)``.
2016-02-05 14:51:15 +00:00
Dan Liew 33f676ef6b Do not hardcode default build directory name. 2016-02-05 14:39:27 +00:00
Dan Liew 6112ea2ec7 Fix typo 2016-02-05 14:38:41 +00:00
mikolas faa620f673 Further refactoring ackermannization. 2016-02-03 17:31:19 +00:00
mikolas 2679b74543 refactoring 2016-02-03 13:53:52 +00:00
Mikolas Janota 2141a075ba Refactoring ackermannization functionality. 2016-01-28 18:24:54 +00:00
Mikolas Janota e7477e2f6a Moving things around. Adding tactic just for ackermannization. 2016-01-26 17:02:51 +00:00
Mikolas Janota 094d357b07 Merge remote-tracking branch 'upstream/master' into lackr 2016-01-13 12:10:36 +00:00
Dan Liew 250c8d028d Fix bug when configuring when building OCaml bindings is enabled
when using Python2.

The output from ``check_output()`` has ``unicode`` type under
Python 2 but type ``str`` under Python 3. This type ended up being
used inside the ``MakeRuleCmd`` class which asserts that it receives
paths of type ``str``. To fix the problem under Python 2 the asserts
have been made weaker by also allowing the paths to be of type
``unicode``.
2016-01-12 19:38:43 +00:00
Dan Liew cb106d71cf Teach the OCaml bindings install rule to respect the DESTDIR makefile
variable. Previously it would try to install into the system (e.g.
``/usr/lib/ocaml``) regardless of the value of DESTDIR.

Unfortunately it looks like packagers who use DESTDIR to do staged
installs will need to have their packages patch their user's OCaml
``ld.conf`` file manually at package install time (not ``make install``
time) with the extra path to the Z3 Ocaml package directory. We could
use the ``touch`` command to create an empty ``ld.conf`` before running
``ocamlfind install`` but that adds the wrong path to ``ld.conf``
because it contains DESTDIR.
2016-01-11 21:13:25 +00:00
Dan Liew f038291293 Don't silently fail if ocamlfind cannot be found when building the Ocaml
bindings is enabled. That is really unhelpful behaviour. Instead emit a
warning. I would prefer an error message but apparently being able to
build but not install the OCaml bindings is desirable.

Whilst I'm here also print information about ocamlfind where it should
have been mentioned.
2016-01-11 19:36:02 +00:00
Mikolas Janota b26e4b1516 Merge remote-tracking branch 'upstream/master' into lackr 2016-01-11 18:27:47 +00:00
Dan Liew 49a2ed01c8 Improve error message emitting during configure when the Python
bindings are enabled and the set python package directory does
not live under the install prefix. This is the other part required
to fix issue #404.
2016-01-08 21:21:54 +00:00
Dan Liew e9ea687bb9 Disable the Python bindings by default which partially fixes issue #404.
To enable the Python bindings use the newly added ``--python`` option.
2016-01-08 21:21:54 +00:00
Mikolas Janota 743a59254e Merge remote-tracking branch 'upstream/master' into lackr 2016-01-07 16:39:43 +00:00
Christoph M. Wintersteiger 3e000d7525 build fix for libz3.vcxproj 2016-01-05 14:40:31 +00:00
Christoph M. Wintersteiger 8b47a84598 Merge branch 'master' of https://github.com/Z3Prover/z3 into jan4 2016-01-05 11:34:35 +00:00
Christoph M. Wintersteiger 4915f2da04 Added facilities for generating a libz3.vcxproj next to z3.vcxproj for simplified DLL build in VS. 2016-01-04 21:53:24 +00:00
Christoph M. Wintersteiger 25af97fb8b tabs 2016-01-04 21:04:07 +00:00
Nikolaj Bjorner 0c03a87c82 merge with master
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-01-03 14:08:29 -08:00
Christoph M. Wintersteiger 758c9cd7a0 Build fix for install dependencies 2016-01-01 17:02:31 +00:00
Christoph M. Wintersteiger d6330e157d Refactored Python API installation build. 2016-01-01 16:42:01 +00:00
Nikolaj Bjorner f414869456 add symbolic automaton
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-12-23 19:46:10 -08:00
Nikolaj Bjorner 7a9bd72e2e merge
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-12-22 17:48:47 -08:00
Nikolaj Bjorner ea876715e3 Merge branch 'master' of https://github.com/Z3Prover/z3 2015-12-22 10:46:50 -08:00
Nikolaj Bjorner 9c6271dded add debugging facilities for github issues #384 #367
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-12-22 10:43:18 -08:00
Tony Tiger e98ee6ec06 Fixing building under OS X
Previous method is_osx_hack didn't exist, possibly wasn't cleaned up. This
change has been tested and Z3 compiles successfully within a 2.7 virtualenv
running on OS X 10.10.5.
2015-12-22 13:00:55 +00:00
Christoph M. Wintersteiger a30fe1e2ec Followup to previous build fix. Relates to #357 and #361 2015-12-22 00:52:37 +01:00
Christoph M. Wintersteiger ea218da2c4 Bugfix in build scripts.
Additional fix for #357, relates to #361.
2015-12-22 00:37:27 +01:00
Christoph M. Wintersteiger 06deb07a49 Merge branch 'master' of https://github.com/Z3Prover/z3 2015-12-17 12:47:34 +00:00
Christoph M. Wintersteiger 0fe1e3248f .NET build fix 2015-12-17 12:47:24 +00:00
Christoph M. Wintersteiger 1cc2385fd2 typo 2015-12-17 12:33:45 +00:00
Mikolas Janota c6e66ebc3a Adding ackr component. 2015-12-15 18:43:36 +00:00
Christoph M. Wintersteiger 90b1b07af4 build fixes 2015-12-15 15:03:53 +00:00
Christoph M. Wintersteiger 22a77721ef Updated build options for .NET API 2015-12-15 14:20:31 +00:00
Christoph M. Wintersteiger f4e3989766 .NET API build fixes 2015-12-15 13:09:02 +00:00
Christoph M. Wintersteiger 942b6ba5ec Updated .NET build. 2015-12-15 12:24:59 +00:00
Christoph M. Wintersteiger fc5b9156cf Merge pull request #363 from delcypher/dotnet_configure_assembly_info
Refactor ``mk_all_assembly_infos()`` to use the ``configure_file()`` and misc fixes for dotnet bindings
2015-12-15 11:35:14 +00:00
Dan Liew 439d8d8afe Fix issue on non-windows systems when emitting the build rule
for the ".NET" bindings example.

Previously there was a hack that would to path separator replacement
( '/' -> '\' ) which breaks paths under non-windows platforms. The hack
has been made slightly better by doing ( '/' -> os.path.sep). This
preserves the existing behaviour under Windows and unbreaks the build
on non-windows platforms.

I'm not entirely sure why the path replacement needs to be done in
the first place. I thought Windows was supposed to support using
'/' as a path separator (as well as '/'). Maybe ``csc.exe`` doesn't
support these kind of paths?
2015-12-15 08:56:47 +00:00
Dan Liew 44393b37de Emit dependency of phony target `examples on _ex_dotnet_example`
when building of the ".NET" bindings is enabled.
2015-12-15 08:46:47 +00:00
Christoph M. Wintersteiger edb1f4d896 ML API build fix 2015-12-14 14:55:38 +00:00
Christoph M. Wintersteiger 134b93b43e ML API build fixes for Windows. 2015-12-14 14:41:19 +00:00
Dan Liew d3d10490ea Fix bug in `Makefile` generation when emitting the command to build
the ".NET" bindings when in debug mode.

``;`` is a shell command separator so it needs to be quoted when
emitting ``/define:DEBUG;TRACE``.
2015-12-14 09:56:03 +00:00
Dan Liew 81c98cf3ee Refactor `mk_all_assembly_infos() to use the configure_file()`
function. The old implementation was buggy under Python 3.5 and
unsafe (not using with statements on calls to ``open()``).
2015-12-14 09:51:45 +00:00
Christoph M. Wintersteiger 5a357097c0 ML API Windows build fixes 2015-12-12 20:01:52 +00:00
Christoph M. Wintersteiger d456400f93 Merge branch 'new_ocaml_install' of https://github.com/wintersteiger/z3 into new_ocaml_install 2015-12-12 19:34:02 +00:00
Christoph M. Wintersteiger d5f79c1f17 build fix for ML API 2015-12-12 19:30:25 +00:00
Dan Liew 140b3de3aa Make warnings that are emitted when installing Python bindings outside
the install prefix on OSX less aggressive by not stating that this might
lead to a broken install (even though it might!).

Also emit a similar warning during the configuration step.

This partially addresses #361
2015-12-12 19:30:24 +00:00
Christoph M. Wintersteiger 325d516825 ocaml build fix 2015-12-12 19:30:22 +00:00
Christoph M. Wintersteiger 02f7ae4a4d updated ocaml build and installation 2015-12-12 19:30:22 +00:00
Dan Liew 948df47027 Make warnings that are emitted when installing Python bindings outside
the install prefix on OSX less aggressive by not stating that this might
lead to a broken install (even though it might!).

Also emit a similar warning during the configuration step.

This partially addresses #361
2015-12-12 09:34:50 +00:00
Christoph M. Wintersteiger f164f17190 ocaml build fix 2015-12-11 20:01:55 +00:00
Christoph M. Wintersteiger 50f17e403c updated ocaml build and installation 2015-12-11 19:56:23 +00:00
Nikolaj Bjorner 8949790c16 Merge branch 'master' of https://github.com/Z3Prover/z3 2015-12-09 07:37:51 -08:00
Nikolaj Bjorner 820fb10ef8 create .so impages for OpenBSD
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-12-09 07:37:40 -08:00
Nikolaj Bjorner d11022cf2d Merge pull request #362 from NikolajBjorner/master
Combined updates to seq, add openbsd cases to build script.
2015-12-09 07:30:51 -08:00
Christoph M. Wintersteiger 84291825e6 Resolved conflicts 2015-12-09 13:07:25 +00:00
Christoph M. Wintersteiger a0f9f461f8 Build fix 2015-12-09 13:01:42 +00:00
Nikolaj Bjorner aebdc8950a Merge branch 'master' of https://github.com/Z3Prover/z3 2015-12-09 00:40:36 -08:00
Dan Liew 0a1c645b5e Don't emit install commands and dependencies if ML bindings are
disabled!
2015-12-08 23:20:39 +00:00
Dan Liew edf5ed27df Attempt to allow (but warn about) installation of Python bindings
under OSX when the Python ``site-packages`` directory doesn't live
under the install prefix. Also disallow installing under Windows
as it doesn't really make sense.
2015-12-08 23:10:48 +00:00
Dan Liew d98d392aac Try unbreak OSX build when Python installation doesn't live under
PREFIX. In this case it is not safe to call ``strip_path_prefix()``
due to the assertion error it will raise.
2015-12-08 23:10:48 +00:00
Dan Liew 0a8cd3ae19 Refactor the install and uninstall commands for the python bindings
out of ``DLLComponent`` and into ``PythonInstallComponent`` where they
belong.
2015-12-08 23:10:48 +00:00
Dan Liew 38b45919b5 Unbreak running `make install. The python site-package` directory
was not created before trying to create files in it.

The ``install_deps()`` method was also dead. It looks like that
should have been named ``mk_install_deps()`` but even if we give it
the right name it does the wrong thing. That method is supposed
emit target names (i.e. dependencies) not commands.
2015-12-08 23:10:48 +00:00
Dan Liew e2546d2b95 Refactor references to `pythonPkgDirWithoutPrefix` to a object
attribute.
2015-12-08 23:08:23 +00:00
Christoph M. Wintersteiger 83db19654f refactored ocamlfind_install target 2015-12-08 18:57:17 +00:00
Nikolaj Bjorner 895d032996 seq
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-12-08 10:33:09 -08:00
Christoph M. Wintersteiger ea79d0eacd Bugfix for Python installation on linuxes 2015-12-08 13:45:55 +00:00
Christoph M. Wintersteiger f6a10b0b82 tabs 2015-12-07 19:28:04 +00:00
Nikolaj Bjorner 34a0d7dfed remove python_install target from all
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-12-07 09:59:46 -08:00
Nikolaj Bjorner 70b10d53cf fix build break - remove tabs
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-12-06 22:17:36 -08:00
Nikolaj Bjorner e1ab2370e1 fix python w.o. proper intallation, #338, #340
Signed-off-by: Nikolaj Bjorner <nbjorner@z3-mac.local>
2015-12-07 03:32:58 +00:00
Nikolaj Bjorner 92a4ac9eb7 make dotnet optional and recover from python installation mismatch. Pull requests #338, #340
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-12-06 19:28:39 -08:00
Nikolaj Bjorner febd83912e make dotnet optional and recover from python installation mismatch. Pull requests #338, #340
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-12-06 19:25:18 -08:00
Nikolaj Bjorner a940230301 make dotnet optional and recover from python installation mismatch. Pull requests #338, #340
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-12-06 19:14:53 -08:00
Nikolaj Bjorner 6c73c176b3 make dotnet optional and recover from python installation mismatch. Pull requests #338, #340
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-12-06 19:10:11 -08:00
Nikolaj Bjorner b5fcbd7099 Merge branch 'mono_dotnet_bindings' of https://github.com/delcypher/z3-1 2015-12-06 13:51:43 -08:00
Nikolaj Bjorner 4ec6bc0825 Merge branch 'better_packaging' of https://github.com/delcypher/z3-1 2015-12-06 12:31:55 -08:00
Dan Liew c8a2b6645a Teach the build system to generate and install a pkg-config file for the
".NET" bindings. This file is required for Monodevelop to find the
bindings because Monodevelop uses pkg-config to find packages
(it doesn't use the GAC).

For lack of a better name the GAC (and pkg-config) package name is now
``Microsoft.Z3.Sharp``. I don't want to call it ``Microsoft.Z3`` because
someone may want to create a ``Microsoft.Z3.pc`` file in the future for
the native Z3 library (i.e. C++ or C bindings).

In addition there is a new utility function ``configure_file()``
which reads a template file, applies some substitutions and writes
the result to another file. This very similar to what CMake does.

There is a new environment variable ``Z3_INSTALL_PKGCONFIG_DIR``
which allows pkgconfig directory to be controlled for the install.
2015-12-05 07:52:31 +00:00
Dan Liew 61d1cd524e Teach the build system to build and install the ".NET bindings"
under non Windows systems (i.e. Using mono).

Building these bindings is unfortunately on by default because
I didn't want to change the command line interface (i.e. ``--nodotnet``)
which people might be relying on. This should really be changed to
match the other binding flags (e.g. ``--java``) but I will leave
this for now.

To perform the build a C# compiler and the GAC utility are required.
The script will try to automatically detect them but the user can
override this by setting the ``CSC`` and ``GACUTIL`` environment
variables.

In order for the ".NET bindings" to be installed the assembly
(``Microsoft.Z3.dll``) needs to have a strong name which means
we need a Strong name key file which is what the
``Microsoft.Z3.mono.snk`` is for. This is the public and private
key so this key **must never** be used for checking integrity. Instead its
only purpose is to avoid any name clashes in the GAC.

It is also worth noting that slightly different flags needs to
be passed to the C# compiler on non Windows platforms. I don't
understand why some of the flags are being used on Windows but I left
a comment there that hopefully someone can fix...
2015-12-05 07:52:31 +00:00
Dan Liew 6884d3a245 Fix references to non existent function and variable due to a refactor
in 041c02feb7. Spotted by @NikolajBjorner
2015-12-05 07:50:33 +00:00
Christoph M. Wintersteiger 00271e5531 C API cleanup. Mainly removal of ML-specific macros that are not used anymore and inline documentation fixes. 2015-12-03 17:33:25 +00:00
Dan Liew d2ba6f0ebf Provide a way to customise the install directories via environment
variables:

Z3_INSTALL_BIN_DIR - defaults to "bin"
Z3_INSTALL_LIB_DIR - defaults to "lib"
Z3_INSTALL_INCLUDE_DIR - defaults to "include"

This has two advantages

* We no longer hard code strings like "bin" all over the place
* Packagers can easily control where things get installed.
2015-11-28 19:11:03 +00:00
Dan Liew d205b176e8 Bug fix for `MakeRuleCmd.create_relative_symbolic_link()`.
create_relative_symbolic_link(out, '/usr/lib64/libz3.so',
'/usr/lib/python3.5/site-package/libz3.so') would create an incorrect relative
path because it would consider ``/usr/lib`` to a be a path prefix of
``/usr/lib64``.
2015-11-28 19:03:05 +00:00
Dan Liew f1d4f36ddf Refactor the use of `$(DESTDIR)$(PREFIX) in MakeRuleCmd`
class so that it is exposed via a public method (``install_root()``)
so that is can be used externally. Also refactor the existing methods
to use it.
2015-11-28 19:03:05 +00:00
Dan Liew 32c4384d48 Fix dead comment and expand on the reasons for making a symbolic link
slightly.
2015-11-28 19:03:05 +00:00
Dan Liew 684318149b Remove dead code that I accidently left behind. 2015-11-28 19:03:05 +00:00
Dan Liew 6984070b3a Fix typo (missing argument) that I missed that didn't fire because
I did not test on Windows.
2015-11-28 19:03:05 +00:00
Dan Liew d6fa0583ab Fix bug in `ExeComponent.mk_uninstall()` in the build system
which would try to uninstall components that were never installed.

This bug would cause the following line to be emitted in the
``Makefile`` under the ``uninstall`` rule even though there was
no corresponding rule to install the file under the ``install`` rule.

```
@rm -f $(DESTDIR)$(PREFIX)/bin/test-z3$(EXE_EXT)
```
2015-11-28 19:03:05 +00:00