3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 00:55:31 +00:00
z3/src/util
Dan Liew 251527603d Implement a CMake build system.
This is a large rework of my first attempt at this (#459).

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

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

The following notable features are implemented:

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

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

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

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

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

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

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

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

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

* It is easier for outside contributors to contribute to Z3 when the
  build system is something more standard.
* Incremental builds work properly. With the old build system when
  new code is pulled down the old build directory would need to thrown
  out and a new fresh build had to be performed because the build system
  didn't know how to correctly rebuild the project (e.g. couldn't handle
  new sources being added/removed, compiler flags changing, generated
  files changing, etc...). This is a MASSIVE boost to productivity!
* We now have access rich array of features that CMake provides for
  building C/C++ projects. This means less time spent implementing
  custom build system logic in Python that is already supported by
  CMake.
* CMake supports many IDEs out of the box so it should be fairly
  straight forward to build Z3 with Visual Studio (once support for MSVC
  is added), Xcode, Eclipse CDT, CLion, ..etc.
2016-03-04 15:26:09 +00:00
..
approx_nat.cpp Reorganizing source code. Created util dir 2012-10-20 10:19:38 -07:00
approx_nat.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
approx_set.cpp Reorganizing source code. Created util dir 2012-10-20 10:19:38 -07:00
approx_set.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
array.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
array_map.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
backtrackable_set.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
basic_interval.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
bit_util.cpp fix a few undefined behaviors exposed by the unit tests 2015-05-11 06:30:24 +01:00
bit_util.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
bit_vector.cpp pull unstable 2015-04-01 14:57:11 -07:00
bit_vector.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
buffer.h removing const qualifiers, perhaps this helps for #420 and adding assert to enable Clang analysis earlier for issue #440 2016-02-09 22:23:37 +00:00
cancel_eh.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
chashtable.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
checked_int64.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
CMakeLists.txt Implement a CMake build system. 2016-03-04 15:26:09 +00:00
cmd_context_types.cpp Reorganizing code. Added script for generating VS project files 2012-10-20 15:16:37 -07:00
cmd_context_types.h add line/position information to unsupported command reports per zeph pull request 2015-10-30 19:23:31 -07:00
common_msgs.cpp include rlimit in nlsat, include dedicated error message, for issue #216 2015-09-29 09:16:46 -07:00
common_msgs.h include rlimit in nlsat, include dedicated error message, for issue #216 2015-09-29 09:16:46 -07:00
cooperate.cpp fixing clang compilation problems 2012-12-05 15:20:16 -08:00
cooperate.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
critical_flet.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
debug.cpp Convert stream to bool explicitly 2016-02-02 23:39:11 +00:00
debug.h added compiler macro to disable invocation of the debugger upon failure. 2016-01-07 15:58:10 +00:00
dec_ref_util.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
dependency.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
dictionary.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
dlist.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
double_manager.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
env_params.cpp add count of memory allocations and way to limit allocations globally. Fix purification in nlsat_smt to fix regressions on QF_UFNRA 2015-06-24 17:06:12 +01:00
env_params.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
error_codes.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
event_handler.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
ext_gcd.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
ext_numeral.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
f2n.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
fixed_bit_vector.cpp fix bounds bug 2014-09-22 18:06:18 -07:00
fixed_bit_vector.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
gparams.cpp enforce stringstream formatting to avoid default format routine. fixes issue #149 2015-07-06 09:11:52 -07:00
gparams.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
hash.cpp use Z3_fallthrough instead of __falthrough directly to avoid messing with reserved identifiers 2015-10-09 18:06:49 +01:00
hash.h use Z3_fallthrough instead of __falthrough directly to avoid messing with reserved identifiers 2015-10-09 18:06:49 +01:00
hashtable.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
heap.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
hwf.cpp Fix gcc build failure on ARM caused by including <emmintrin.h> 2016-02-10 20:47:08 +00:00
hwf.h Merge branch 'static_analysis' of https://github.com/daniel-j-h/z3 2015-10-19 15:14:45 +01:00
id_gen.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
inf_eps_rational.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
inf_int_rational.cpp fix assorted undefined behaviors caught by clang 2015-05-23 11:45:12 +01:00
inf_int_rational.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
inf_rational.cpp fix assorted undefined behaviors caught by clang 2015-05-23 11:45:12 +01:00
inf_rational.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
inf_s_integer.cpp Reorganizing source code. Created util dir 2012-10-20 10:19:38 -07:00
inf_s_integer.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
lbool.cpp Reorganizing source code. Created util dir 2012-10-20 10:19:38 -07:00
lbool.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
list.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
luby.cpp checkpoint 2012-10-21 13:32:12 -07:00
luby.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
machine.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
map.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
memory_manager.cpp remove references to _DEBUG use Z3DEBUG instead 2016-02-29 20:23:20 -08:00
memory_manager.h remove references to _DEBUG use Z3DEBUG instead 2016-02-29 20:23:20 -08:00
mpbq.cpp Improve html pretty printer for RCF package 2013-01-27 11:24:23 -08:00
mpbq.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
mpbqi.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
mpf.cpp Fixed FP string input conversions. 2016-03-01 15:31:33 +00:00
mpf.h Changed FP significand/exponent functions to return non-normalized results. Clarified function remarks. Relates to #383. 2016-01-13 16:32:32 +00:00
mpff.cpp fix build warnings 2015-05-15 15:56:21 +01:00
mpff.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
mpfx.cpp reinterpret_cast fixes for the Windows compiler. 2015-10-04 16:41:28 +01:00
mpfx.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
mpn.cpp MPN synchronization fix 2015-02-08 13:25:18 +00:00
mpn.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
mpq.cpp prevent usage that mixes E/e notation with division / for numerals 2014-10-02 23:58:52 -07:00
mpq.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
mpq_inf.cpp working on DL opt 2014-03-05 15:43:15 -08:00
mpq_inf.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
mpz.cpp fix build with clang 2015-11-27 12:13:44 +00:00
mpz.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
mpzzp.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
nat_set.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
numeral_buffer.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
obj_hashtable.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
obj_mark.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
obj_pair_hashtable.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
obj_pair_set.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
obj_ref.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
obj_triple_hashtable.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
object_allocator.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
optional.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
page.cpp Reorganizing source code. Created util dir 2012-10-20 10:19:38 -07:00
page.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
params.cpp enable modular parameters from the parser 2014-10-09 10:18:46 -07:00
params.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
parray.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
permutation.cpp Reorganizing source code. Created util dir 2012-10-20 10:19:38 -07:00
permutation.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
plugin_manager.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
pool.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
pop_scopes.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
prime_generator.cpp put break statement in else branh. Issue #230 (broken loop) 2015-10-03 17:15:54 -07:00
prime_generator.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
ptr_scoped_buffer.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
rational.cpp fix assorted undefined behaviors caught by clang 2015-05-23 11:45:12 +01:00
rational.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
ref.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
ref_buffer.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
ref_util.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
ref_vector.h seq 2015-12-28 18:15:48 -08:00
region.cpp Reorganizing source code. Created util dir 2012-10-20 10:19:38 -07:00
region.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
resource_limit.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
rlimit.cpp ensure limit children are safe for race conditions 2015-12-12 10:24:19 -08:00
rlimit.h ensure limit children are safe for race conditions 2015-12-12 10:18:51 -08:00
s_integer.cpp Reorganizing source code. Created util dir 2012-10-20 10:19:38 -07:00
s_integer.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
scoped_ctrl_c.cpp Reorganizing source code. Created util dir 2012-10-20 10:19:38 -07:00
scoped_ctrl_c.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
scoped_numeral.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
scoped_numeral_buffer.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
scoped_numeral_vector.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
scoped_ptr_vector.h automata 2015-12-24 12:01:59 -08:00
scoped_timer.cpp fix compiler warning in scoped_timer.cpp on linux 2015-12-08 17:03:18 +00:00
scoped_timer.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
scoped_vector.h updated seq 2015-12-21 06:07:50 -08:00
sexpr.cpp Reorganizing source code. Created util dir 2012-10-20 10:19:38 -07:00
sexpr.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
small_object_allocator.cpp compiler optimization and fixes to unit tests 2013-04-11 13:44:23 -07:00
small_object_allocator.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
smt2_util.cpp Reorganizing the code 2012-10-20 19:54:08 -07:00
smt2_util.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
sorting_network.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
stack.cpp Reorganizing source code. Created util dir 2012-10-20 10:19:38 -07:00
stack.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
statistics.cpp moving to resource managed cancellation 2015-12-11 17:46:22 -08:00
statistics.h adding rlimit resource limit facility to provide platform and architecture independent method for canceling activities 2015-09-28 13:37:59 -07:00
stats.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
stopwatch.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
str_hashtable.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
stream_buffer.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
string_buffer.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
symbol.cpp Reorganizing source code. Created util dir 2012-10-20 10:19:38 -07:00
symbol.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
symbol_table.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
timeit.cpp env params 2012-12-01 20:56:40 -08:00
timeit.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
timeout.cpp fixing clang compilation problems 2012-12-05 15:20:16 -08:00
timeout.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
timer.cpp Reorganizing source code. Created util dir 2012-10-20 10:19:38 -07:00
timer.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
total_order.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
tptr.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
trace.cpp fix build on CentOS 2015-05-19 16:52:47 +01:00
trace.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
trail.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
uint_map.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
uint_set.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
union_find.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
util.cpp remove deprecated iz3 example. Remove deprecated process control 2015-11-18 12:32:15 -08:00
util.h add macro for converting std::vectors to pointers (leaking abstraction) 2015-12-01 16:35:03 -08:00
vector.h use signed character type declarations for cross platform compilation. Fixes issue #210 2015-09-05 16:30:58 -07:00
version.h.in Implement a CMake build system. 2016-03-04 15:26:09 +00:00
warning.cpp fix a few compilation warnings 2013-04-21 14:36:39 -07:00
warning.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
z3_exception.cpp enforce stringstream formatting to avoid default format routine. fixes issue #149 2015-07-06 09:11:52 -07:00
z3_exception.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00
z3_omp.h update header guards to be C++ style. Fixes issue #9 2015-07-08 23:18:40 -07:00