使用clang-2.9和Os X 10.5.8编译Z3

时间:2012-12-05 09:57:53

标签: z3 clang++

我想使用Z3Py,我正按照http://z3.codeplex.com/SourceControl/changeset/view/89c1785b7322#README中的说明尝试安装Z3 我正在获得以下内容:

dhcp-154:z3-89c1785b7322 mgarcia$ ./configure CXX=clang++
checking whether we are using the GNU C++ compiler... no
checking whether clang++ accepts -g... no
checking for gcc... gcc
checking whether we are using the GNU C compiler... no
checking whether gcc accepts -g... no
checking for gcc option to accept ISO C89... unsupported
checking whether make sets $(MAKE)... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for a sed that does not truncate output... /usr/bin/sed
checking for int *... no
checking size of int *... 4
configure: creating ./config.status
config.status: creating scripts/config-debug.mk
config.status: creating scripts/config-release.mk
Z3 was configured with success.
Host platform:  osx
Compiler:       clang++
Arithmetic:     internal
Python:         python
Prefix:         /usr
64-bit:         no

当我做make时,我会收到错误,例如:

In file included from ../src/muz_qe/dl_smt_relation.cpp:32:
../src/smt/expr_context_simplifier.h:78:10: error: expected parameter declarator
    void assert(expr* e) { m_solver.assert_expr(e); }

/usr/include/assert.h:85:23: note: instantiated from:
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)

In file included from ../src/muz_qe/dl_smt_relation.cpp:32:
../src/smt/expr_context_simplifier.h:78:10: error: expected ')'
../src/smt/expr_context_simplifier.h:78:10: note: to match this '('
    void assert(expr* e) { m_solver.assert_expr(e); }

所以我不知道这是否是与代码相关的问题,或者我仍然遗漏了一些东西。或者,也许,我使用的是旧版本。

感谢您的回答。

1 个答案:

答案 0 :(得分:2)

我在这里没有类似的系统进行测试,但我相信这是因为你的系统库使用类似的东西

#define assert(x) (__builtin_expect...

定义assert函数。碰巧我们其中一个类中的一个函数也被称为assert,并且预处理器将其替换为#define的其余部分。似乎这个问题已经在Z3的不稳定分支中修复了,你可以从Codeplex上的源代码下载,通过从#34; master"切换分支选择器。到"不稳定"在点击下载之前。