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

627 commits

Author SHA1 Message Date
Nikolaj Bjorner a625301a41 expose incremental cubing over API
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-09-28 15:05:10 -07:00
Christoph M. Wintersteiger 9a464dded4 Removed -std=c++11 from OCaml stubs build command. Fixes #1263. 2017-09-27 14:22:59 +01:00
Nikolaj Bjorner e1d08e9526 remove reinterpret cast occurrences that require disabling strict alias analysis #987 #1210
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-08-17 20:41:29 -07:00
Nuno Lopes 4b00bc636b revert the patch to remove no-strict-aliasing
VS 2012 doesnt support C++11 unions..
2017-08-14 23:00:59 +01:00
Nuno Lopes 2473c69679 Drop no-strict-aliasing and fix 2 places where it was violated 2017-08-14 20:09:49 +01:00
Christoph M. Wintersteiger 6bc5209e26 Fixed build problems with .vcxproj 2017-08-01 15:53:55 +01:00
Daniel Perelman d57494395c Add --guardcf flag to mk_make.py to optionally enable Control Flow Guard. 2017-07-06 16:59:20 -07:00
Dan Liew d00892c9a6 [CMake] Fix dependencies for generating mem_initializer.cpp.
Previously CMake was not aware of which headers files the generation
of `mem_initializer.cpp` depended on. Consequently this could result
in broken incremental builds if

* Existing headers that declare memory initializers/finalizers change.
* New headers are added that declare memory initializers/finalizer.

Now the `z3_add_component()` CMake function has been modifed so that
it now takes an optional `MEMORY_INIT_FINALIZER_HEADERS` argument
which allows the headers that declare memory initializers/finalizers
to be explicitly listed.

With this information CMake will now regenerate `mem_initializer.cpp`
correctly.

This required the `mk_mem_initializer_cpp_internal()` function to be
changed to take a list of header files rather than a list of component
source directories. The two consumers (CMake and Python/Makefile build
systems) of this function have been modified to work with this change.

This partially fixes #1030.
2017-06-21 23:56:53 +01:00
Dan Liew 6f48a145aa [CMake] Fix dependencies for generating gparams_register_modules.cpp.
Previously CMake was not aware of which headers files the generation
of `gparams_register_modules.cpp` depended on. Consequently this could result
in broken incremental builds if

* Existing headers that declared module description/parameters change.
* New headers are added that declare module description/parameters.
* `.pyg` files that generate header files that declare module
  description/parameters change

Now the `z3_add_component()` CMake function has been modifed so that

* All header files that are generated from `.pyg` files are added as
dependencies and are scanned from module description/parameter
declarations. This implicit dependency of `gparams_register_modules.cpp`
depending on other generated header files seems unnecessary complex. We
should revisit this design decision once the Python/Makefile build
system is deprecated.

* The function now takes an optional `EXTRA_REGISTER_MODULE_HEADERS`
argument which allows the headers that declare module
description/paramters to be explicitly listed.

With this information CMake will now regenerate `gparams_register_modules.cpp`
correctly.

This required the `mk_gparams_register_modules_internal()` function to be
changed to take a list of header files rather than a list of component
source directories. The two consumers (CMake and Python/Makefile build
systems) of this function have been modified to work with this change.

This partially fixes #1030.
2017-06-21 23:56:46 +01:00
Dan Liew 229fd3dc3e [CMake] Fix dependencies for generating install_tactic.cpp.
Previously CMake was not aware of which headers files the generation
of `install_tactic.cpp` depended on. Consequently this could result
in broken incremental builds if

* Existing headers that declared tactics/probes changed.
* New tactics/probes were added to new header files.

Now the `z3_add_component()` CMake function has been modifed to take an
optional `TACTIC_HEADERS` argument which allows the headers that declare
tactics/probes to be explicitly listed. The necessary component
declarations have been modified to declare their tactic/probe header
files.

With this information CMake will now regenerate `install_tactic.cpp`
correctly.

This required the `mk_install_tactic_cpp_internal()` function to be
changed to take a list of header files rather than a list of component
source directories. The two consumers (CMake and Python/Makefile build
systems) of this function have been modified to work with this change.

This partially fixes #1030.
2017-06-21 23:03:48 +01:00
Nikolaj Bjorner 691788f449 remove stale references to foci
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-05-19 20:21:08 -07:00
Christoph M. Wintersteiger a258236229 Disabled debug output 2017-05-19 18:51:52 +01:00
Christoph M. Wintersteiger 46791047fa Fixed VS 2017 platform toolset version in .vcxproj 2017-05-12 14:28:55 +01:00
Nikolaj Bjorner a64a73255e make source directory relative to build directory
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-05-09 15:46:24 -07:00
Nikolaj Bjorner 7731163d11 use forward slash on src include
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-05-09 14:42:43 -07:00
Nikolaj Bjorner 911b24784a merge LRA
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-05-09 10:46:11 -07:00
Christoph M. Wintersteiger 79dcf03a42 Enabled C++11 in GCC and Clang 2017-05-05 15:01:10 +01:00
Christoph M. Wintersteiger 0ebce66c57 Fixed bug with .NET keyfile path containing spaces. Fixes #1003. 2017-05-05 14:22:40 +01:00
Christoph M. Wintersteiger 3bbe5eceeb fix for --get-describe 2017-03-24 15:53:46 +00:00
Michael Lowell Roberts 3415672f31 fixed bug where mk_make.py --build=... would fail to handle absolute paths correctly. 2017-02-28 08:24:35 -08:00
Christoph M. Wintersteiger 59db0bc9c4 Merge pull request #829 from legendtang/fix_utf8_conf
Fixed utf-8 version string handling for python2. Resolved #787
2017-02-04 20:38:51 +00:00
Christoph M. Wintersteiger b9bfd4ddf5 Merge pull request #854 from angr/fix/fpic-arm
Add -fpic to armv7/armv8 build
2017-01-18 21:55:52 +00:00
Andrew Dutcher 1eec0799ca Add -fpic to armv7/armv8 build 2016-12-22 14:26:41 -08:00
Dan Liew 2e74a2c54e Refactor update_api.mk_ml() so that the source and output directories
can be different. This feature will be needed by the CMake build system
to build the OCaml bindings.
2016-12-19 21:05:17 +00:00
Dan Liew 76bbecf4fe Refactor mk_z3consts_ml() code into mk_z3consts_ml_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-12-19 21:05:17 +00:00
Dan Liew 0e03fe9bf2 Fix inconsistent emission of OCaml 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-12-19 21:05:16 +00:00
Christoph M. Wintersteiger 251d1ec031 Fix for parallel builds of the OCaml API. Relates to #797. 2016-12-19 16:58:25 +00:00
Christoph M. Wintersteiger 2c32e30fed Build fix for static binaries + shared examples 2016-12-19 16:47:28 +00:00
Christoph M. Wintersteiger a1a662b23f Build fix for C/C++ example programs. 2016-12-16 04:51:07 -08:00
Christoph M. Wintersteiger 649d474686 Build fix for C++ example 2016-12-09 19:09:47 +00:00
Wensheng Tang 99d10d1224 Fixed utf-8 version string handling for python2. Resolved #787 2016-12-08 15:09:59 +08:00
Nuno Lopes 1d417f6527 fix warnings in configure script 2016-11-23 09:32:20 +00:00
Christoph M. Wintersteiger dee7c29b19 Added optional synchronization for multi-thread API logs. Relates to #798. 2016-11-22 11:32:25 +00:00
Christoph M. Wintersteiger 7f923c6a33 Include Python API files in distributions. 2016-11-07 22:00:28 +00:00
Christoph M. Wintersteiger 7bbdb7714f Added signed .NET assemblies in unix builds 2016-11-03 17:20:39 +00:00
Christoph M. Wintersteiger 6e0369036e fixed log output typo 2016-11-03 17:13:02 +00:00
Christoph M. Wintersteiger 6fb358a432 Build fix for libz3.vcxproj. 2016-10-28 13:45:10 +01:00
Christoph M. Wintersteiger 86285e1641 disabled unnecessary assertion 2016-10-26 12:59:26 +01:00
Christoph M. Wintersteiger 6ea45b4d65 fix for Python API installation 2016-10-25 14:23:55 +01:00
Nikolaj Bjorner 092c52e5b7 fix for package directory. issue #744
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-09-22 18:29:26 -07:00
Andrew Dutcher 4801a27c2d Fix up z3test to a) exist and b) work 2016-09-21 17:18:10 -07:00
Nikolaj Bjorner ef0dd74c53 try copy instead of cp
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-09-21 16:14:27 -07:00
Andrew Dutcher 02783d0bfb Minor tweaks to make things more reliable/less obnoxious 2016-09-14 01:49:37 -07:00
Andrew Dutcher cb83c42100 Make python stuff live in a python directory in the build tree 2016-09-14 01:49:16 -07:00
Andrew Dutcher 704105306c FINISH IT 2016-09-14 01:40:01 -07:00
Andrew Dutcher 0bbd172af3 First steps to a sane python build 2016-09-14 01:37:04 -07:00
Christoph M. Wintersteiger 7fefe40f21 Added/improved facilities for strong name signing of the .NET assembly. 2016-07-28 18:07:34 +01:00
Christoph M. Wintersteiger 3587baaf24 Added full version strings and associated API functions. 2016-07-28 18:06:02 +01:00
Nikolaj Bjorner 9cab896632 adding sign option if keyfile is present
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-07-26 14:31:29 -07:00
Christoph M. Wintersteiger 1fb672121c build fix for cygwin/mingw 2016-06-24 13:57:53 +01:00
Christoph M. Wintersteiger e3a41d0d98 Merge pull request #645 from martin-neuhaeusser/cross-mingw64
Extend build scripts to support MinGW64 cross-compilation on Windows.
2016-06-24 13:42:10 +01:00
Christoph M. Wintersteiger fad1dffbf0 Added PATH info to successful build message 2016-06-22 19:03:42 +01:00
Martin R. Neuhäußer 22097efd4a Extend build scripts to support MinGW64 cross-compilation on Windows. 2016-06-10 16:43:57 +02:00
Christoph M. Wintersteiger 86126e2c01 Merge branch 'master' of https://github.com/Z3Prover/z3 into new-ml-api 2016-05-03 11:52:21 +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
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
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 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
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 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 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 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 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 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 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
Christoph M. Wintersteiger a16f524eae Install target fix for ocamlfind_install on Windows.
Relates to #409
2016-02-09 19:58:52 +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
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
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
Christoph M. Wintersteiger 3e000d7525 build fix for libz3.vcxproj 2016-01-05 14:40:31 +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 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
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
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
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
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
Dan Liew 041c02feb7 Finish addressing @wintersteiger comments on `$(DESTDIR)` being
duplicated in too many places by refactoring the installation and
removal of the Python bindings to use the ``MakeRuleCmd`` class.

In order to make this change:

* ``PYTHON_PACKAGE_DIR`` no longer contains the text ``$(PREFIX)``
* ``PYTHON_PACKAGE_DIR`` **MUST BE** inside the installation prefix
2015-11-28 19:03:05 +00:00
Dan Liew 23cf7e86a9 Start to address @wintersteiger 's comments aboug `$(DESTDIR)` being
duplicated in too many places and being worried that someone might
forget to use it when installing additional components.

To acheive this the new ``MakeRuleCmd`` class provides
several class methods to generate commonly needed commands used in
make file rules.

Most of the build system has been changed to use these helper methods
apart from stuff related to the Python bindings. This can't be changed
until we fix how PYTHON_PACKAGE_DIR is handled. Right it not guaranteed
to live under the install prefix but this is a requirement when using
the ``MakeRuleCmd`` methods.
2015-11-28 19:03:05 +00:00
Dan Liew 53f0addb6b Avoid making a copy of libz3 on non Windows platforms for the
Python bindings (provided they both exist within the same install
prefix) by creating a relative symbolic link. This saves
space when packaging Z3.
2015-11-28 19:03:05 +00:00
Dan Liew e8822b1806 Add a note about using DESTDIR when building Z3 completes. 2015-11-28 19:03:05 +00:00
Dan Liew 4c11037d70 Fix setting the path to the Python package directory.
There were several problems with the existing implementation.

* When specifying ``--prefix`` the implementation would assume the
  path was ``$(PREFIX)/lib/python-<VERSION>/dist-packages``. This
  is incorrect. ``dist-packages`` is Debian (and its derivatives,
  i.e Ubuntu) specific and won't work on other Linux distributions
  such as Arch Linux.

* When generating the ``Makefile``, ``$(PREFIX)`` was only emitted
  during the Python installation when ``--prefix`` was passed on
  the command line. When ``--prefix`` was not passed the absolute
  path to the Python package directory was emitted. This is not
  very consistent.

This patch checks that the detected Python package directory lives
under the install prefix and emits an error if it does not as this
indicates that the installation will be broken. If the Python package
directory does live under the install prefix it replaces that prefix
with the ``$(PREFIX)`` variable when emitting the ``Makefile`` for
consistency with the other install commands.

If a user really wants to install to a particular Python package
directory they can force it with the newly added ``--pypkgdir=``
flag.
2015-11-28 19:03:05 +00:00
Dan Liew b285ce7cee Partially fix not being able to do a staged install (using `DESTDIR`)
when installing the Python bindings.

If ``DESTDIR`` is set the bindings will now be installed under this
path but ``$(PREFIX)`` only appears in the ``Makefile`` if ``--prefix``
was set which seems a little broken (we'll fix this soon).

The creation of the Python ``site-packages`` (and ``__pycache__`` for Python
3) directories has been moved to build time instead of configure time
because we don't know what ``DESTDIR`` will be set to at configure time.
2015-11-28 19:03:05 +00:00
Dan Liew 9489665ddc Partially fix not being able to do a staged package install of Z3 using the
DESTDIR make file variable (https://www.gnu.org/prep/standards/html_node/DESTDIR.html)
for ``install`` and ``uninstall`` targets.

Typically packagers build packages like so

```
$ ./configure --prefix=/usr/
$ make
$ make DESTDIR=/some/path/ install
```

Doing this installs the files into a directory ``/some/path`` but places
files inside that directory using the layout in ``--prefix`` (e.g.
``/some/path/usr/bin/z3``).  The ``/some/path`` directory can then be
packaged (e.g. tarballed) for later installation.

The ``DESTDIR`` is not set in the Makefile and thus is empty by default
which maintains the existing ``make install`` behaviour.

Unfortunately this situation isn't fixed for the Python bindings (and
possibly others) yet as more invasive changes are needed here. I'll fix
this in later commits.
2015-11-28 19:03:05 +00:00
Christoph M. Wintersteiger 3ed5945cb2 Fixed Python 2.x vs 3.x issues.
Fixes Z3Prover/bin#2.
2015-11-19 23:27:12 +01:00
Christoph M. Wintersteiger fc05eb65bd Fixed regular expressions in build scripts to expect cross-platform newlines. 2015-11-17 13:55:16 +00:00
Nikolaj Bjorner 6e1c246454 avoid exception in Ratul's environment
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-11-16 23:06:04 -08:00
Christoph M. Wintersteiger 05eb78ccac fix for string decoding in build scripts 2015-11-14 15:42:49 +00:00
Christoph M. Wintersteiger 639dfc4b30 fix for string decoding in build scripts 2015-11-14 15:06:55 +00:00
Christoph M. Wintersteiger 27dcd8c5b6 Fix for python decoding of command line output strings
Fixes #302
2015-11-13 17:15:04 +00:00
Christoph M. Wintersteiger 2f216ee5c1 Fixed PREFIX for OSX installation. Fixes #124. 2015-11-03 15:35:43 +00:00
Christoph M. Wintersteiger 28ba92b298 Python 3.x issues 2015-10-30 06:31:16 -07:00
Christoph M. Wintersteiger 7287478370 Fixed Python 3.x issue with commandline output from subprocess.Popen 2015-10-29 15:54:28 +00:00
Christoph M. Wintersteiger 5cb4b1d188 Fix for example build rules. 2015-10-29 13:06:48 +00:00
Christoph M. Wintersteiger b47e9d74e9 Refactored example build rules to avoid compiler warnings. 2015-10-29 13:03:02 +00:00
Christoph M. Wintersteiger 498bafcc4b Merge branch 'ocamlfind_stublibs' of https://github.com/zkincaid/z3 into zkincaid-172 2015-10-19 17:05:55 +01:00
Christoph M. Wintersteiger eb0cdc42d1 Merge branch 'pypy-fix' of https://github.com/zardus/z3 into zardus-76
# Conflicts:
#	scripts/mk_util.py
2015-10-19 16:51:43 +01:00
Christoph M. Wintersteiger aa1692370d Merge branch 'fix-mk_util_py' of https://github.com/cao/z3 into cao-tabs
# Conflicts:
#	scripts/mk_util.py
2015-10-19 15:35:14 +01:00
Christoph M. Wintersteiger b1fcdadd55 Merge branch 'buildsystem_cleanup' of https://github.com/daniel-j-h/z3 into daniel-j-h-buildsystem_cleanup 2015-10-19 15:18:13 +01:00
Christoph M. Wintersteiger 3c89312d1e Merge pull request #55 from zshipko/master
support openbsd
2015-10-19 14:15:56 +01:00
Zachary Kincaid 9e34872e8f For ocamlfind install, set rpath to package directory if stublibs does not exist 2015-10-04 10:10:53 -04:00
Christoph M. Wintersteiger d8524ae4dd Fixed indentation 2015-10-03 16:24:06 +01:00
Christoph M. Wintersteiger 08a3ab92f3 Added --noomp to mk_make 2015-10-02 12:38:56 +01:00
Zachary Kincaid eca2488ab4 If ocamlfind is installed, add destdir/stublibs to rpath 2015-07-26 19:59:17 -04:00
Nuno Lopes e441db5bc4 build system: fix typo in OS_DEFINES for linux
Signed-off-by: Nuno Lopes <nlopes@microsoft.com>
2015-06-23 13:59:36 +01:00
Nuno Lopes 4346966f00 Run link-time optimization on windows only when configured with --optimize
This should probably be revisited for VS 2015

Signed-off-by: Nuno Lopes <nlopes@microsoft.com>
2015-06-22 14:48:50 +01:00
zach shipko 9cc4fc919d Merge branch 'master' of https://github.com/Z3Prover/z3 2015-05-30 18:36:26 -07:00
Nuno Lopes 8ff7735a20 python 3 fixes
Signed-off-by: Nuno Lopes <nlopes@microsoft.com>
2015-05-19 13:47:43 +01:00
Nuno Lopes ef32aaaf12 don't use -fPIC on cygwin 64
Signed-off-by: Nuno Lopes <nlopes@microsoft.com>
2015-05-18 16:37:20 +01:00
Nikolaj Bjorner e8811748d3 fix regressions in nl/smt
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-05-16 19:08:37 +01:00
Nuno Lopes 7ae68f003a dont use /LTCG on windows debug builds
Signed-off-by: Nuno Lopes <nlopes@microsoft.com>
2015-05-15 19:20:57 +01:00
Nuno Lopes ce749240d7 more fixes for python 3
Signed-off-by: Nuno Lopes <nlopes@microsoft.com>
2015-05-12 18:43:51 +01:00
Yan 8b9bf9ea90 Fix mk_util.py so that it explicitly closes files (instead of relying on reference counting, which doesn't exist in pypy) 2015-05-05 11:38:04 -07:00
Kevin Borgolte 024923526b remove unused modules 2015-05-05 11:31:32 -07:00
Kevin Borgolte f458423868 remove trailing whitespace 2015-05-05 11:29:48 -07:00
Kevin Borgolte 7dcdecfa09 fix mixed tab/spaces indent 2015-05-05 11:29:26 -07:00
Christoph M. Wintersteiger c0dc08ee9c Added configuration checks for floating-point build flags. 2015-04-30 17:17:44 +01:00
Christoph M. Wintersteiger 78cc1e0703 Remove temporary files created during configuration tests. 2015-04-29 15:15:57 +01:00
zach shipko f034ed54ab support openbsd 2015-04-23 11:28:17 -07:00