Search code examples
buildz3

Building z3 on mac os x


I'm trying to build Z3 on mac os x.

Following README file, I just executed

autoconf
./configure
make

to get an error "omp.h" file not found.

I copied the omp.h file from /usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include to lib directory to solve this issue.

Then, I got lib/buffer.h:243:13: error: use of undeclared identifier 'push_back' error in building the code.

What could be the solution? I have gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) on Mac OS X 10.7.5.


Solution

  • The next release (Z3 v4.3.2) will have better support for OSX, clang, and older versions of gcc. You should be able to compile the release candidate using the following instructions. rc is the branch that contains the current release candidate.

    git clone https://git01.codeplex.com/z3 -b rc
    cd z3
    python scripts/mk_make.py
    cd build
    make
    

    BTW, the link http://z3.codeplex.com/releases/view/95640 does not contain the latest release (Z3 v4.3.1). We don't create zip files with source code anymore because codeplex automatically generates them for any version. See this link for additional details.

    EDIT on February 2013, we started to provide nightly builds for all major platforms (including OSX). Here are instruction on how to download these pre-compiled binaries. END EDIT