Search code examples
c++z3osx-mavericks

Errors when building Z3 unstable branch


I've been trying to build z3 unstable branch in the past two days but unfortunately I got many errors that do not make sense. I have no idea where is the problem. I have OSX 10.9.
Here is the list of errors

....-MacBook-Pro:build ....$ make
src/api/api_interp.cpp
In file included from ../src/api/api_interp.cpp:35:
In file included from ../src/interp/iz3interp.h:23:
../src/interp/iz3hash.h:72:14: error: no matching function for call to object of
      type 'const __gnu_cxx::hash<char *>'
      return H(s.c_str());
             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ext/__hash:38:12: note: 
      candidate function not viable: 1st argument ('const_pointer'
      (aka 'const char *')) would lose const qualifier
    size_t operator()(char *__c) const _NOEXCEPT
           ^
In file included from ../src/api/api_interp.cpp:38:
In file included from ../src/interp/iz3pp.h:23:
../src/interp/iz3mgr.h:221:31: error: no type named 'vector' in namespace 'std';
      did you mean 'hecto'?
  ast make(opr op, const std::vector<ast> &args);
                         ~~~~~^~~~~~
                              hecto
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ratio:264:43: note: 
      'hecto' declared here
typedef ratio<                100LL, 1LL> hecto;
                                          ^
In file included from ../src/api/api_interp.cpp:38:
In file included from ../src/interp/iz3pp.h:23:
../src/interp/iz3mgr.h:221:37: error: expected ')'
  ast make(opr op, const std::vector<ast> &args);
                                    ^
../src/interp/iz3mgr.h:221:11: note: to match this '('
  ast make(opr op, const std::vector<ast> &args);
          ^
../src/interp/iz3mgr.h:226:33: error: no type named 'vector' in namespace 'std';
      did you mean 'hecto'?
  ast make(symb sym, const std::vector<ast> &args);
                           ~~~~~^~~~~~
                                hecto
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ratio:264:43: note: 
      'hecto' declared here
typedef ratio<                100LL, 1LL> hecto;
                                          ^
In file included from ../src/api/api_interp.cpp:38:
In file included from ../src/interp/iz3pp.h:23:
../src/interp/iz3mgr.h:226:39: error: expected ')'
  ast make(symb sym, const std::vector<ast> &args);
                                      ^
../src/interp/iz3mgr.h:226:11: note: to match this '('
  ast make(symb sym, const std::vector<ast> &args);
          ^
../src/interp/iz3mgr.h:231:37: error: no type named 'vector' in namespace 'std';
      did you mean 'hecto'?
  ast make_quant(opr op, const std::vector<ast> &bvs, ast &body);
                               ~~~~~^~~~~~
                                    hecto
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ratio:264:43: note: 
      'hecto' declared here
typedef ratio<                100LL, 1LL> hecto;
                                          ^
In file included from ../src/api/api_interp.cpp:38:
In file included from ../src/interp/iz3pp.h:23:
../src/interp/iz3mgr.h:231:43: error: expected ')'
  ast make_quant(opr op, const std::vector<ast> &bvs, ast &body);
                                          ^
../src/interp/iz3mgr.h:231:17: note: to match this '('
  ast make_quant(opr op, const std::vector<ast> &bvs, ast &body);
                ^
../src/interp/iz3mgr.h:232:38: error: no type named 'vector' in namespace 'std';
      did you mean 'hecto'?
  ast clone(const ast &t, const std::vector<ast> &args);
                                ~~~~~^~~~~~
                                     hecto
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ratio:264:43: note: 
      'hecto' declared here
typedef ratio<                100LL, 1LL> hecto;
                                          ^
In file included from ../src/api/api_interp.cpp:38:
In file included from ../src/interp/iz3pp.h:23:
../src/interp/iz3mgr.h:232:44: error: expected ')'
  ast clone(const ast &t, const std::vector<ast> &args);
                                           ^
../src/interp/iz3mgr.h:232:12: note: to match this '('
  ast clone(const ast &t, const std::vector<ast> &args);
           ^
../src/interp/iz3mgr.h:238:8: error: no type named 'vector' in namespace 'std';
      did you mean 'hecto'?
  std::vector<ast> cook(ptr_vector<raw_ast> v) {
  ~~~~~^~~~~~
       hecto
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ratio:264:43: note: 
      'hecto' declared here
typedef ratio<                100LL, 1LL> hecto;
                                          ^
In file included from ../src/api/api_interp.cpp:38:
In file included from ../src/interp/iz3pp.h:23:
../src/interp/iz3mgr.h:238:14: error: expected member name or ';' after
      declaration specifiers
  std::vector<ast> cook(ptr_vector<raw_ast> v) {
  ~~~~~~~~~~~^
../src/interp/iz3mgr.h:383:3: error: unknown type name 'lemma_theory'
  lemma_theory get_theory_lemma_theory(const ast &proof){
  ^
../src/interp/iz3mgr.h:417:49: error: no type named 'vector' in namespace 'std';
      did you mean 'hecto'?
  void get_farkas_coeffs(const ast &proof, std::vector<ast>& coeffs);
                                           ~~~~~^~~~~~
                                                hecto
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ratio:264:43: note: 
      'hecto' declared here
typedef ratio<                100LL, 1LL> hecto;
                                          ^
In file included from ../src/api/api_interp.cpp:38:
In file included from ../src/interp/iz3pp.h:23:
../src/interp/iz3mgr.h:417:55: error: expected ')'
  void get_farkas_coeffs(const ast &proof, std::vector<ast>& coeffs);
                                                      ^
../src/interp/iz3mgr.h:417:25: note: to match this '('
  void get_farkas_coeffs(const ast &proof, std::vector<ast>& coeffs);
                        ^
../src/interp/iz3mgr.h:419:49: error: no type named 'vector' in namespace 'std';
      did you mean 'hecto'?
  void get_farkas_coeffs(const ast &proof, std::vector<rational>& rats);
                                           ~~~~~^~~~~~
                                                hecto
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ratio:264:43: note: 
      'hecto' declared here
typedef ratio<                100LL, 1LL> hecto;
                                          ^
In file included from ../src/api/api_interp.cpp:38:
In file included from ../src/interp/iz3pp.h:23:
../src/interp/iz3mgr.h:419:55: error: expected ')'
  void get_farkas_coeffs(const ast &proof, std::vector<rational>& rats);
                                                      ^
../src/interp/iz3mgr.h:419:25: note: to match this '('
  void get_farkas_coeffs(const ast &proof, std::vector<rational>& rats);
                        ^
../src/interp/iz3mgr.h:419:8: error: class member cannot be redeclared
  void get_farkas_coeffs(const ast &proof, std::vector<rational>& rats);
       ^
../src/interp/iz3mgr.h:417:8: note: previous declaration is here
  void get_farkas_coeffs(const ast &proof, std::vector<ast>& coeffs);
       ^
../src/interp/iz3mgr.h:421:56: error: no type named 'vector' in namespace 'std';
      did you mean 'hecto'?
  void get_assign_bounds_coeffs(const ast &proof, std::vector<rational>& rats);
                                                  ~~~~~^~~~~~
                                                       hecto
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ratio:264:43: note: 
      'hecto' declared here
typedef ratio<                100LL, 1LL> hecto;
                                          ^
In file included from ../src/api/api_interp.cpp:38:
In file included from ../src/interp/iz3pp.h:23:
../src/interp/iz3mgr.h:421:62: error: expected ')'
  void get_assign_bounds_coeffs(const ast &proof, std::vector<rational>& rats);
                                                             ^
../src/interp/iz3mgr.h:421:32: note: to match this '('
  void get_assign_bounds_coeffs(const ast &proof, std::vector<rational>& rats);
                               ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [api/api_interp.o] Error 1

I checked the first 2 errors manually but the code seems fine. PLEASE help

Thanks Yaco


Solution

  • Thanks for reporting this. I haven't seen any similar reports yet, but I just fixed a couple of problems that appeared when the new OSX and XCode came out. For details, see here.

    Could you update to the latest version of the unstable branch and try again (also re-run python scripts/mk_make.py). Thanks!