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

557 commits

Author SHA1 Message Date
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
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
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
Nikolaj Bjorner 665af3d8b9 remove deprecated user-theory plugins and other unused functionality from API
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-11-20 08:43:27 -08:00
Christoph M. Wintersteiger d9beb9e15a Windows build fix 2015-11-20 09:57:05 +01:00
Christoph M. Wintersteiger 0881c96b2e Merge branch 'master' of https://github.com/Z3Prover/z3 2015-11-19 23:24:34 +01:00
Christoph M. Wintersteiger b2281f956b Fixed Python 2.x vs 3.x issues.
Fixes Z3Prover/bin/#2.
2015-11-19 23:24:04 +01:00
Nikolaj Bjorner 2122fdee45 fix build script for update to name of get_error_msg
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-11-19 08:33:27 -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
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 706a037bf4 Python 3.x string decoding fix 2015-11-16 15:16:50 +01:00
Nikolaj Bjorner bea68cd194 remove deprecated API functionality
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-11-14 17:05:15 -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 64fa2db3ff Python 3.x issues 2015-10-29 17:47:07 +00:00