Skip to content

Commit be61a26

Browse files
authored
Merge pull request #3 from batfish/ari-upgrade-for-ite
Upgrade to enable ite as doc precondition - update OSX build matrix - re-add debug tests for linux - update build matrix flags based on upstream changes - better OSX documentation
2 parents 86664af + 1aa4fc0 commit be61a26

File tree

1,523 files changed

+94742
-84392
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,523 files changed

+94742
-84392
lines changed

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ bld_dbg/*
4343
bld_rel/*
4444
bld_dbg_x64/*
4545
bld_rel_x64/*
46+
.vscode
4647
# Auto generated files.
4748
config.log
4849
config.status
@@ -75,3 +76,9 @@ src/api/ml/z3.mllib
7576
*.bak
7677
doc/api
7778
doc/code
79+
.vs
80+
examples/**/obj
81+
CMakeSettings.json
82+
83+
# ignore version header
84+
src/util/z3_version.h

.travis.yml

+12-8
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,18 @@ env:
1717
###############################################################################
1818
# Ubuntu 16.04 LTS
1919
###############################################################################
20-
# 64-bit default compilers RelWithDebInfo
21-
- LINUX_BASE=ubuntu_16.04 TARGET_ARCH=x86_64 Z3_BUILD_TYPE=Release JAVA_BINDINGS=1
20+
# 64-bit default compilers Release
21+
- LINUX_BASE=ubuntu_16.04 C_COMPILER=/usr/bin/gcc-5 CXX_COMPILER=/usr/bin/g++-5 TARGET_ARCH=x86_64 Z3_BUILD_TYPE=Release JAVA_BINDINGS=1
22+
# 64-bit GCC 5.4 Debug
23+
- LINUX_BASE=ubuntu_16.04 C_COMPILER=/usr/bin/gcc-5 CXX_COMPILER=/usr/bin/g++-5 TARGET_ARCH=x86_64 Z3_BUILD_TYPE=Debug RUN_UNIT_TESTS=BUILD_ONLY
2224

2325
###############################################################################
2426
# Ubuntu 14.04 LTS
2527
###############################################################################
26-
# 64-bit GCC 4.8 RelWithDebInfo java
27-
- LINUX_BASE=ubuntu_14.04 TARGET_ARCH=x86_64 Z3_BUILD_TYPE=Release JAVA_BINDINGS=1
28+
# 64-bit GCC 4.8 Release java
29+
- LINUX_BASE=ubuntu_14.04 C_COMPILER=/usr/bin/gcc-4.8 CXX_COMPILER=/usr/bin/g++-4.8 TARGET_ARCH=x86_64 Z3_BUILD_TYPE=Release JAVA_BINDINGS=1
30+
# 64-bit GCC 4.8 Debug
31+
- LINUX_BASE=ubuntu_14.04 C_COMPILER=/usr/bin/gcc-4.8 CXX_COMPILER=/usr/bin/g++-4.8 TARGET_ARCH=x86_64 Z3_BUILD_TYPE=Debug RUN_UNIT_TESTS=BUILD_ONLY
2832

2933
# macOS (a.k.a OSX) support
3034
matrix:
@@ -33,11 +37,11 @@ matrix:
3337
# very slow so we should keep the number of configurations we test on this
3438
# OS to a minimum.
3539
- os: osx
36-
osx_image: xcode9.2
37-
env: Z3_BUILD_TYPE=Release USE_OPENMP=1 JAVA_BINDINGS=1
40+
osx_image: xcode10.1
41+
env: Z3_BUILD_TYPE=Release USE_OPENMP=1 JAVA_BINDINGS=1 DOTNET_BINDINGS=0
3842
- os: osx
39-
osx_image: xcode9.2
40-
env: Z3_BUILD_TYPE=Release USE_OPENMP=0 JAVA_BINDINGS=1
43+
osx_image: xcode10.1
44+
env: Z3_BUILD_TYPE=Release USE_OPENMP=0 JAVA_BINDINGS=1 DOTNET_BINDINGS=0
4145
script:
4246
# Use `travis_wait` when doing LTO builds because this configuration will
4347
# have long link times during which it will not show any output which

CMakeLists.txt

+60-15
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ endif()
3333
# Project version
3434
################################################################################
3535
set(Z3_VERSION_MAJOR 4)
36-
set(Z3_VERSION_MINOR 6)
37-
set(Z3_VERSION_PATCH 1)
36+
set(Z3_VERSION_MINOR 8)
37+
set(Z3_VERSION_PATCH 5)
3838
set(Z3_VERSION_TWEAK 0)
3939
set(Z3_VERSION "${Z3_VERSION_MAJOR}.${Z3_VERSION_MINOR}.${Z3_VERSION_PATCH}.${Z3_VERSION_TWEAK}")
4040
set(Z3_FULL_VERSION_STR "${Z3_VERSION}") # Note this might be modified
@@ -99,7 +99,7 @@ set(GIT_DIR "${CMAKE_SOURCE_DIR}/.git")
9999
if (EXISTS "${GIT_DIR}")
100100
# Try to make CMake configure depend on the current git HEAD so that
101101
# a re-configure is triggered when the HEAD changes.
102-
add_git_dir_dependency("${GIT_DIR}" ADD_GIT_DEP_SUCCESS)
102+
add_git_dir_dependency("${CMAKE_SOURCE_DIR}" ADD_GIT_DEP_SUCCESS)
103103
if (ADD_GIT_DEP_SUCCESS)
104104
if (INCLUDE_GIT_HASH)
105105
get_git_head_hash("${GIT_DIR}" Z3GITHASH)
@@ -205,9 +205,6 @@ message(STATUS "PYTHON_EXECUTABLE: ${PYTHON_EXECUTABLE}")
205205
include(${CMAKE_SOURCE_DIR}/cmake/target_arch_detect.cmake)
206206
detect_target_architecture(TARGET_ARCHITECTURE)
207207
message(STATUS "Detected target architecture: ${TARGET_ARCHITECTURE}")
208-
if ("${TARGET_ARCHITECTURE}" STREQUAL "x86_64")
209-
list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_AMD64_")
210-
endif()
211208

212209

213210
################################################################################
@@ -218,12 +215,17 @@ include(${CMAKE_SOURCE_DIR}/cmake/z3_add_cxx_flag.cmake)
218215
################################################################################
219216
# C++ language version
220217
################################################################################
221-
# FIXME: Use CMake's own mechanism for selecting language version
222-
if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
223-
z3_add_cxx_flag("-std=c++11" REQUIRED)
224-
else()
225-
message(AUTHOR_WARNING "Not setting C++ language version for compiler")
226-
endif()
218+
if ("${CMAKE_VERSION}" VERSION_LESS "3.1")
219+
# FIXME: Drop this when we upgrade to newer CMake versions.
220+
if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
221+
z3_add_cxx_flag("-std=c++11" REQUIRED)
222+
else()
223+
message(AUTHOR_WARNING "Not setting C++ language version for compiler")
224+
endif()
225+
else ()
226+
set(CMAKE_CXX_STANDARD 11)
227+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
228+
endif ()
227229

228230
################################################################################
229231
# Platform detection
@@ -235,11 +237,14 @@ if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
235237
list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_USE_THREAD_LOCAL")
236238
endif()
237239
elseif ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
238-
# Does OSX really not need any special flags?
240+
# Does macOS really not need any special flags?
239241
message(STATUS "Platform: Darwin")
240242
elseif ("${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD")
241243
message(STATUS "Platform: FreeBSD")
242244
list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_FREEBSD_")
245+
elseif ("${CMAKE_SYSTEM_NAME}" MATCHES "NetBSD")
246+
message(STATUS "Platform: NetBSD")
247+
list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_NetBSD_")
243248
elseif ("${CMAKE_SYSTEM_NAME}" MATCHES "OpenBSD")
244249
message(STATUS "Platform: OpenBSD")
245250
list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_OPENBSD_")
@@ -249,6 +254,15 @@ elseif (CYGWIN)
249254
elseif (WIN32)
250255
message(STATUS "Platform: Windows")
251256
list(APPEND Z3_COMPONENT_CXX_DEFINES "-D_WINDOWS")
257+
elseif (EMSCRIPTEN)
258+
message(STATUS "Platform: Emscripten")
259+
list(APPEND Z3_DEPENDENT_EXTRA_CXX_LINK_FLAGS
260+
"-Os"
261+
"-s ALLOW_MEMORY_GROWTH=1"
262+
"-s ASSERTIONS=0"
263+
"-s DISABLE_EXCEPTION_CATCHING=0"
264+
"-s ERROR_ON_UNDEFINED_SYMBOLS=1"
265+
)
252266
else()
253267
message(FATAL_ERROR "Platform \"${CMAKE_SYSTEM_NAME}\" not recognised")
254268
endif()
@@ -372,9 +386,17 @@ endif()
372386
################################################################################
373387
# FIXME: Support ARM "-mfpu=vfp -mfloat-abi=hard"
374388
if (("${TARGET_ARCHITECTURE}" STREQUAL "x86_64") OR ("${TARGET_ARCHITECTURE}" STREQUAL "i686"))
375-
if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
389+
if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel"))
390+
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel")
391+
# Intel's compiler requires linking with libiomp5
392+
list(APPEND Z3_DEPENDENT_LIBS "iomp5")
393+
endif()
376394
set(SSE_FLAGS "-mfpmath=sse" "-msse" "-msse2")
377395
# FIXME: Remove "x.." when CMP0054 is set to NEW
396+
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel")
397+
set(SSE_FLAGS "-mfpmath=sse" "-msse" "-msse2")
398+
# Intel's compiler requires linking with libiomp5
399+
list(APPEND Z3_DEPENDENT_LIBS "iomp5")
378400
elseif ("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
379401
set(SSE_FLAGS "/arch:SSE2")
380402
else()
@@ -409,6 +431,29 @@ list(APPEND Z3_DEPENDENT_LIBS ${CMAKE_THREAD_LIBS_INIT})
409431
################################################################################
410432
include(${CMAKE_SOURCE_DIR}/cmake/compiler_warnings.cmake)
411433

434+
################################################################################
435+
# Save Clang optimization records
436+
################################################################################
437+
option(SAVE_CLANG_OPTIMIZATION_RECORDS "Enable saving Clang optimization records." OFF)
438+
439+
if (SAVE_CLANG_OPTIMIZATION_RECORDS)
440+
z3_add_cxx_flag("-fsave-optimization-record" REQUIRED)
441+
endif()
442+
443+
################################################################################
444+
# If using Ninja, force color output for Clang (and gcc, disabled to check build).
445+
################################################################################
446+
if (UNIX AND CMAKE_GENERATOR STREQUAL "Ninja")
447+
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
448+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
449+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcolor-diagnostics")
450+
endif()
451+
# if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
452+
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color")
453+
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color")
454+
# endif()
455+
endif()
456+
412457
################################################################################
413458
# Option to control what type of library we build
414459
################################################################################
@@ -434,7 +479,7 @@ else()
434479
endif()
435480

436481
################################################################################
437-
# Postion independent code
482+
# Position independent code
438483
################################################################################
439484
# This is required because code built in the components will end up in a shared
440485
# library. If not building a shared library ``-fPIC`` isn't needed and would add

README.batfish

+9
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@ LINUX_BASE=ubuntu_14.04 TRAVIS_OS_NAME=linux contrib/ci/scripts/travis_ci_entry_
66
## Ubuntu 16,04 (USES DOCKER)
77
LINUX_BASE=ubuntu_16.04 TRAVIS_OS_NAME=linux contrib/ci/scripts/travis_ci_entry_point.sh
88

9+
### OSX
10+
# For all OSX builds as of Mojave, make sure you have installed SDK headers by executing:
11+
# open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
12+
#
13+
# You may need to install other dependencies via:
14+
# contrib/ci/scripts/install_deps_osx.sh
15+
#
916
## OSX with OpenMP (RECOMMENDED, MUST BE RUN ON OSX, DOES NOT USE DOCKER)
17+
# You must have OpenMP libraries for this build. Install with:
18+
# brew install libomp
1019
./package_z3_osx_openmp.sh
1120

1221
## OSX without OpenMP (NOT RECOMMENDED, MUST BE RUN ON OSX, DOES NOT USE DOCKER)

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,14 @@ under the [MIT license](LICENSE.txt).
55

66
If you are not familiar with Z3, you can start [here](https://github.com/Z3Prover/z3/wiki#background).
77

8+
Pre-built binaries for releases are available from [here](https://github.com/Z3Prover/z3/releases),
9+
and nightly builds from [here](https://github.com/Z3Prover/bin/tree/master/nightly).
10+
811
Z3 can be built using [Visual Studio][1], a [Makefile][2] or using [CMake][3]. It provides
9-
[bindings for several programming languages][4].
12+
[bindings for several programming languages][4].
1013

1114
See the [release notes](RELEASE_NOTES) for notes on various stable releases of Z3.
1215

13-
## Build status
14-
15-
| Windows x86 | Windows x64 | Ubuntu x64 | Debian x64 | OSX | TravisCI |
16-
| ----------- | ----------- | ---------- | ---------- | --- | -------- |
17-
[![win32-badge](https://cz3.visualstudio.com/_apis/public/build/definitions/bf14bcc7-ebd4-4240-812c-5972fa59e0ad/4/badge)](https://cz3.visualstudio.com/Z3/_build/index?definitionId=4) | [![win64-badge](https://cz3.visualstudio.com/_apis/public/build/definitions/bf14bcc7-ebd4-4240-812c-5972fa59e0ad/7/badge)](https://cz3.visualstudio.com/Z3/_build/index?definitionId=7) | [![ubuntu-x64-badge](https://cz3.visualstudio.com/_apis/public/build/definitions/bf14bcc7-ebd4-4240-812c-5972fa59e0ad/3/badge)](https://cz3.visualstudio.com/Z3/_build/index?definitionId=3) | [![debian-badge](https://cz3.visualstudio.com/_apis/public/build/definitions/bf14bcc7-ebd4-4240-812c-5972fa59e0ad/5/badge)](https://cz3.visualstudio.com/Z3/_build/index?definitionId=5) | [![osx-badge](https://cz3.visualstudio.com/_apis/public/build/definitions/bf14bcc7-ebd4-4240-812c-5972fa59e0ad/2/badge)](https://cz3.visualstudio.com/Z3/_build/index?definitionId=2) | [![Build Status](https://travis-ci.org/Z3Prover/z3.svg?branch=master)](https://travis-ci.org/Z3Prover/z3) ![Analytics](https://ga-beacon.appspot.com/UA-100596389-3/open-source/?pixel&useReferer)
18-
1916
[1]: #building-z3-on-windows-using-visual-studio-command-prompt
2017
[2]: #building-z3-using-make-and-gccclang
2118
[3]: #building-z3-using-cmake
@@ -75,7 +72,7 @@ A 32 bit build should work similarly (but is untested); the same is true for 32/
7572
By default, it will install z3 executable at ``PREFIX/bin``, libraries at
7673
``PREFIX/lib``, and include files at ``PREFIX/include``, where ``PREFIX``
7774
installation prefix if inferred by the ``mk_make.py`` script. It is usually
78-
``/usr`` for most Linux distros, and ``/usr/local`` for FreeBSD and OSX. Use
75+
``/usr`` for most Linux distros, and ``/usr/local`` for FreeBSD and macOS. Use
7976
the ``--prefix=`` command line option to change the install prefix. For example:
8077

8178
```bash
@@ -189,3 +186,6 @@ python -c 'import z3; print(z3.get_version_string())'
189186

190187
See [``examples/python``](examples/python) for examples.
191188

189+
### ``Web Assembly``
190+
191+
[WebAssembly](https://github.com/cpitclaudel/z3.wasm) bindings are provided by Clément Pit-Claudel.

0 commit comments

Comments
 (0)