mirror of
https://github.com/Z3Prover/z3
synced 2025-04-06 01:24:08 +00:00
Fix build on Mac (#6146)
* Fix finding Python on Mac On Mac you have to specify the version. It also works well on other platforms this way. * Ignore CMake build directories from index * Fix warning about unused variable in release The variable is used in debug only, but it's legit that the compiler does not warn us for that in release.
This commit is contained in:
parent
49b7e9084f
commit
8b29f40152
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -46,6 +46,7 @@ bld_rel/*
|
||||||
bld_dbg_x64/*
|
bld_dbg_x64/*
|
||||||
bld_rel_x64/*
|
bld_rel_x64/*
|
||||||
.vscode
|
.vscode
|
||||||
|
*build*/**
|
||||||
# Auto generated files.
|
# Auto generated files.
|
||||||
config.log
|
config.log
|
||||||
config.status
|
config.status
|
||||||
|
|
|
@ -160,7 +160,7 @@ list(APPEND Z3_COMPONENT_CXX_DEFINES $<$<CONFIG:RelWithDebInfo>:_EXTERNAL_RELEAS
|
||||||
################################################################################
|
################################################################################
|
||||||
# Find Python
|
# Find Python
|
||||||
################################################################################
|
################################################################################
|
||||||
find_package(PythonInterp REQUIRED)
|
find_package(PythonInterp 3 REQUIRED)
|
||||||
message(STATUS "PYTHON_EXECUTABLE: ${PYTHON_EXECUTABLE}")
|
message(STATUS "PYTHON_EXECUTABLE: ${PYTHON_EXECUTABLE}")
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -230,7 +230,7 @@ else()
|
||||||
message(FATAL_ERROR "Platform \"${CMAKE_SYSTEM_NAME}\" not recognised")
|
message(FATAL_ERROR "Platform \"${CMAKE_SYSTEM_NAME}\" not recognised")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND Z3_COMPONENT_EXTRA_INCLUDE_DIRS
|
list(APPEND Z3_COMPONENT_EXTRA_INCLUDE_DIRS
|
||||||
"${PROJECT_BINARY_DIR}/src"
|
"${PROJECT_BINARY_DIR}/src"
|
||||||
"${PROJECT_SOURCE_DIR}/src"
|
"${PROJECT_SOURCE_DIR}/src"
|
||||||
)
|
)
|
||||||
|
@ -293,8 +293,8 @@ if ((TARGET_ARCHITECTURE STREQUAL "x86_64") OR (TARGET_ARCHITECTURE STREQUAL "i6
|
||||||
set(SSE_FLAGS "-mfpmath=sse" "-msse" "-msse2")
|
set(SSE_FLAGS "-mfpmath=sse" "-msse" "-msse2")
|
||||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||||
set(SSE_FLAGS "-mfpmath=sse" "-msse" "-msse2")
|
set(SSE_FLAGS "-mfpmath=sse" "-msse" "-msse2")
|
||||||
# Intel's compiler requires linking with libiomp5
|
# Intel's compiler requires linking with libiomp5
|
||||||
list(APPEND Z3_DEPENDENT_LIBS "iomp5")
|
list(APPEND Z3_DEPENDENT_LIBS "iomp5")
|
||||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||||
set(SSE_FLAGS "/arch:SSE2")
|
set(SSE_FLAGS "/arch:SSE2")
|
||||||
else()
|
else()
|
||||||
|
@ -624,7 +624,7 @@ install(
|
||||||
################################################################################
|
################################################################################
|
||||||
# Examples
|
# Examples
|
||||||
################################################################################
|
################################################################################
|
||||||
cmake_dependent_option(Z3_ENABLE_EXAMPLE_TARGETS
|
cmake_dependent_option(Z3_ENABLE_EXAMPLE_TARGETS
|
||||||
"Build Z3 api examples" ON
|
"Build Z3 api examples" ON
|
||||||
"CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF)
|
"CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF)
|
||||||
if (Z3_ENABLE_EXAMPLE_TARGETS)
|
if (Z3_ENABLE_EXAMPLE_TARGETS)
|
||||||
|
|
|
@ -91,7 +91,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
void dec_ref(unsigned sz, value * vs) {
|
void dec_ref(unsigned sz, value * vs) {
|
||||||
if (C::ref_count)
|
if (C::ref_count)
|
||||||
for (unsigned i = 0; i < sz; i++)
|
for (unsigned i = 0; i < sz; i++)
|
||||||
m_vmanager.dec_ref(vs[i]);
|
m_vmanager.dec_ref(vs[i]);
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ private:
|
||||||
size_t new_capacity = curr_capacity == 0 ? 2 : (3 * curr_capacity + 1) >> 1;
|
size_t new_capacity = curr_capacity == 0 ? 2 : (3 * curr_capacity + 1) >> 1;
|
||||||
value * new_vs = allocate_values(new_capacity);
|
value * new_vs = allocate_values(new_capacity);
|
||||||
if (curr_capacity > 0) {
|
if (curr_capacity > 0) {
|
||||||
for (size_t i = 0; i < curr_capacity; i++)
|
for (size_t i = 0; i < curr_capacity; i++)
|
||||||
new_vs[i] = vs[i];
|
new_vs[i] = vs[i];
|
||||||
deallocate_values(vs);
|
deallocate_values(vs);
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,7 @@ private:
|
||||||
inc_ref(v);
|
inc_ref(v);
|
||||||
vs[sz] = v;
|
vs[sz] = v;
|
||||||
sz++;
|
sz++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rpush_back(cell * c, value const & v) {
|
void rpush_back(cell * c, value const & v) {
|
||||||
SASSERT(c->kind() == ROOT);
|
SASSERT(c->kind() == ROOT);
|
||||||
|
@ -269,7 +269,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
value_manager & manager() { return m_vmanager; }
|
value_manager & manager() { return m_vmanager; }
|
||||||
|
|
||||||
void mk(ref & r) {
|
void mk(ref & r) {
|
||||||
dec_ref(r.m_ref);
|
dec_ref(r.m_ref);
|
||||||
cell * new_c = mk(ROOT);
|
cell * new_c = mk(ROOT);
|
||||||
|
@ -283,12 +283,12 @@ public:
|
||||||
r.m_ref = nullptr;
|
r.m_ref = nullptr;
|
||||||
r.m_updt_counter = 0;
|
r.m_updt_counter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void copy(ref const & s, ref & t) {
|
void copy(ref const & s, ref & t) {
|
||||||
inc_ref(s.m_ref);
|
inc_ref(s.m_ref);
|
||||||
dec_ref(t.m_ref);
|
dec_ref(t.m_ref);
|
||||||
t.m_ref = s.m_ref;
|
t.m_ref = s.m_ref;
|
||||||
t.m_updt_counter = 0;
|
t.m_updt_counter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned size(ref const & r) const {
|
unsigned size(ref const & r) const {
|
||||||
|
@ -310,7 +310,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void check_size(cell* c) const {
|
void check_size(cell* c) const {
|
||||||
unsigned r;
|
[[maybe_unused]] unsigned r;
|
||||||
while (c) {
|
while (c) {
|
||||||
switch (c->kind()) {
|
switch (c->kind()) {
|
||||||
case SET:
|
case SET:
|
||||||
|
@ -333,7 +333,7 @@ public:
|
||||||
|
|
||||||
value const & get(ref const & r, unsigned i) const {
|
value const & get(ref const & r, unsigned i) const {
|
||||||
SASSERT(i < size(r));
|
SASSERT(i < size(r));
|
||||||
|
|
||||||
unsigned trail_sz = 0;
|
unsigned trail_sz = 0;
|
||||||
cell * c = r.m_ref;
|
cell * c = r.m_ref;
|
||||||
|
|
||||||
|
@ -451,7 +451,7 @@ public:
|
||||||
inc_ref(v);
|
inc_ref(v);
|
||||||
new_c->m_elem = v;
|
new_c->m_elem = v;
|
||||||
new_c->m_next = r.m_ref;
|
new_c->m_next = r.m_ref;
|
||||||
r.m_ref = new_c;
|
r.m_ref = new_c;
|
||||||
SASSERT(new_c->m_ref_count == 1);
|
SASSERT(new_c->m_ref_count == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -536,7 +536,7 @@ public:
|
||||||
r.m_updt_counter = 0;
|
r.m_updt_counter = 0;
|
||||||
SASSERT(r.root());
|
SASSERT(r.root());
|
||||||
}
|
}
|
||||||
|
|
||||||
void reroot(ref & r) {
|
void reroot(ref & r) {
|
||||||
if (r.root())
|
if (r.root())
|
||||||
return;
|
return;
|
||||||
|
@ -545,7 +545,7 @@ public:
|
||||||
unsigned r_sz = size(r);
|
unsigned r_sz = size(r);
|
||||||
unsigned trail_split_idx = r_sz / C::factor;
|
unsigned trail_split_idx = r_sz / C::factor;
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
cell * c = r.m_ref;
|
cell * c = r.m_ref;
|
||||||
while (c->kind() != ROOT && i < trail_split_idx) {
|
while (c->kind() != ROOT && i < trail_split_idx) {
|
||||||
cs.push_back(c);
|
cs.push_back(c);
|
||||||
c = c->next();
|
c = c->next();
|
||||||
|
@ -556,7 +556,7 @@ public:
|
||||||
unfold(c);
|
unfold(c);
|
||||||
}
|
}
|
||||||
DEBUG_CODE(check_size(c););
|
DEBUG_CODE(check_size(c););
|
||||||
SASSERT(c->kind() == ROOT);
|
SASSERT(c->kind() == ROOT);
|
||||||
for (i = cs.size(); i-- > 0; ) {
|
for (i = cs.size(); i-- > 0; ) {
|
||||||
cell * p = cs[i];
|
cell * p = cs[i];
|
||||||
SASSERT(c->m_kind == ROOT);
|
SASSERT(c->m_kind == ROOT);
|
||||||
|
@ -574,7 +574,7 @@ public:
|
||||||
case PUSH_BACK:
|
case PUSH_BACK:
|
||||||
c->m_kind = POP_BACK;
|
c->m_kind = POP_BACK;
|
||||||
if (sz == capacity(vs))
|
if (sz == capacity(vs))
|
||||||
expand(vs);
|
expand(vs);
|
||||||
vs[sz] = p->m_elem;
|
vs[sz] = p->m_elem;
|
||||||
++sz;
|
++sz;
|
||||||
c->m_idx = sz;
|
c->m_idx = sz;
|
||||||
|
|
Loading…
Reference in a new issue