Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error Mac OSX #13

Open
GoogleCodeExporter opened this issue Sep 22, 2015 · 4 comments
Open

Compilation error Mac OSX #13

GoogleCodeExporter opened this issue Sep 22, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
--------------------------------------------------------------
1. tar xzvf to extract files
2. cd to src directory
3. make depend; make

What is the expected output? What do you see instead?
--------------------------------------------------------------
- make depend appears to run successfully.
- make fails with following error:
- makefile:402: *** missing separator.  Stop.
Attempt to fix by replacing -n ../bin/obj/\n with -n ../bin/obj/
- make returns with following error(s):
g++ -g -w -Wno-deprecated -Wall -I. -I../src/util -I../src/logic 
-I../src/parser -I../src/learnwts -I../src/learnstruct -I../src/infer 
-I../src/liftedinfer/bridge/includes -I../src/liftedinfer/common/includes 
-I../src/liftedinfer/liftedblockedgibbs/includes 
-I../src/liftedinfer/liftedimportancesampling/includes 
-I../src/liftedinfer/liftedweightedmodelcounting/includes 
-I../src/liftedinfer/tests -o ../bin/obj/learnwts.o -c 
../src/learnwts/learnwts.cpp
In file included from ../src/learnwts/learnwts.cpp:71:
In file included from ../src/infer/inferenceargs.h:70:
In file included from ../src/infer/inferutil.h:74:
../src/util/array.h:371:30: error: call to non-static member function without 
an object argument
      int swapwith = Random::randomOneOf(numItems_);
                     ~~~~~~~~^~~~~~~~~~~
In file included from ../src/learnwts/learnwts.cpp:71:
In file included from ../src/infer/inferenceargs.h:70:
In file included from ../src/infer/inferutil.h:75:
../src/util/hashint.h:69:17: error: expected namespace name
using namespace __gnu_cxx;
                ^
In file included from ../src/learnwts/learnwts.cpp:71:
In file included from ../src/infer/inferenceargs.h:70:
In file included from ../src/infer/inferutil.h:75:
In file included from ../src/util/hashint.h:70:
../src/util/hasharray.h:349:30: error: call to non-static member function 
without an object argument
      int swapwith = Random::randomOneOf(numItems_);
                     ~~~~~~~~^~~~~~~~~~~
In file included from ../src/learnwts/learnwts.cpp:71:
In file included from ../src/infer/inferenceargs.h:70:
In file included from ../src/infer/inferutil.h:75:
../src/util/hashint.h:77:50: error: reference to 'hash' is ambiguous
  size_t operator()(const int& i) const { return hash<int>()(i); }
                                                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u
sr/bin/../include/c++/v1/memory:3062:29: note: candidate found by name lookup 
is 'std::__1::hash'
template <class _Tp> struct hash;
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u
sr/bin/../include/c++/v1/ext/__hash:22:54: note: candidate found by name lookup 
is '__gnu_cxx::hash'
template <typename _Tp> struct _LIBCPP_TYPE_VIS_ONLY hash : public 
std::hash<_Tp>
                                                     ^
In file included from ../src/learnwts/learnwts.cpp:71:
In file included from ../src/infer/inferenceargs.h:70:
In file included from ../src/infer/inferutil.h:75:
../src/util/hashint.h:77:58: error: expected '(' for function-style cast or 
type construction
  size_t operator()(const int& i) const { return hash<int>()(i); }
                                                      ~~~^
../src/util/hashint.h:77:60: error: expected expression
  size_t operator()(const int& i) const { return hash<int>()(i); }
                                                           ^
In file included from ../src/learnwts/learnwts.cpp:71:
In file included from ../src/infer/inferenceargs.h:70:
In file included from ../src/infer/inferutil.h:76:
In file included from ../src/logic/clause.h:76:
In file included from ../src/logic/domain.h:72:
../src/util/dualmap.h:77:36: error: reference to 'hash' is ambiguous
typedef hash_map<const char*, int, hash<const char*>, EqualStr> StrToIntMap;
                                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u
sr/bin/../include/c++/v1/memory:3062:29: note: candidate found by name lookup 
is 'std::__1::hash'
template <class _Tp> struct hash;
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u
sr/bin/../include/c++/v1/ext/__hash:22:54: note: candidate found by name lookup 
is '__gnu_cxx::hash'
template <typename _Tp> struct _LIBCPP_TYPE_VIS_ONLY hash : public 
std::hash<_Tp>
                                                     ^
In file included from ../src/learnwts/learnwts.cpp:71:
In file included from ../src/infer/inferenceargs.h:70:
In file included from ../src/infer/inferutil.h:76:
In file included from ../src/logic/clause.h:76:
In file included from ../src/logic/domain.h:72:
../src/util/dualmap.h:77:41: error: expected expression
typedef hash_map<const char*, int, hash<const char*>, EqualStr> StrToIntMap;
                                        ^
../src/util/dualmap.h:77:53: error: expected unqualified-id
typedef hash_map<const char*, int, hash<const char*>, EqualStr> StrToIntMap;
                                                    ^
../src/util/dualmap.h:168:3: error: unknown type name 'StrToIntMap'
  StrToIntMap* strToIntMap_;
  ^
../src/util/dualmap.h:85:32: error: unknown type name 'StrToIntMap'
              strToIntMap_(new StrToIntMap) {}
                               ^
../src/util/dualmap.h:169:2: error: expected '{' or ','
};
 ^
../src/util/dualmap.h:91:24: error: unknown type name 'StrToIntMap'
    strToIntMap_ = new StrToIntMap;
                       ^
../src/util/dualmap.h:122:5: error: use of undeclared identifier 'StrToIntMap'
    StrToIntMap::iterator it;
    ^
../src/util/dualmap.h:122:18: error: use of class template 'iterator' requires 
template arguments
    StrToIntMap::iterator it;
                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u
sr/bin/../include/c++/v1/iterator:432:30: note: template is declared here
struct _LIBCPP_TYPE_VIS_ONLY iterator
                             ^
In file included from ../src/learnwts/learnwts.cpp:71:
In file included from ../src/infer/inferenceargs.h:70:
In file included from ../src/infer/inferutil.h:76:
In file included from ../src/logic/clause.h:76:
In file included from ../src/logic/domain.h:72:
../src/util/dualmap.h:134:5: error: use of undeclared identifier 'StrToIntMap'
    StrToIntMap::iterator it;
    ^
../src/util/dualmap.h:134:18: error: use of class template 'iterator' requires 
template arguments
    StrToIntMap::iterator it;
                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u
sr/bin/../include/c++/v1/iterator:432:30: note: template is declared here
struct _LIBCPP_TYPE_VIS_ONLY iterator
                             ^
In file included from ../src/learnwts/learnwts.cpp:71:
In file included from ../src/infer/inferenceargs.h:70:
In file included from ../src/infer/inferutil.h:76:
In file included from ../src/logic/clause.h:76:
In file included from ../src/logic/domain.h:73:
In file included from ../src/util/constdualmap.h:75:
../src/util/strint.h:112:12: error: reference to 'hash' is ambiguous
    return hash<char const *>()(s->str_);
           ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u
sr/bin/../include/c++/v1/memory:3062:29: note: candidate found by name lookup 
is 'std::__1::hash'
template <class _Tp> struct hash;
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u
sr/bin/../include/c++/v1/ext/__hash:22:54: note: candidate found by name lookup 
is '__gnu_cxx::hash'
template <typename _Tp> struct _LIBCPP_TYPE_VIS_ONLY hash : public 
std::hash<_Tp>
                                                     ^
In file included from ../src/learnwts/learnwts.cpp:71:
In file included from ../src/infer/inferenceargs.h:70:
In file included from ../src/infer/inferutil.h:76:
In file included from ../src/logic/clause.h:76:
In file included from ../src/logic/domain.h:73:
In file included from ../src/util/constdualmap.h:75:
../src/util/strint.h:112:22: error: expected '(' for function-style cast or 
type construction
    return hash<char const *>()(s->str_);
                ~~~~ ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [../bin/obj/learnwts.o] Error 1

What version of the product are you using? On what operating system?
--------------------------------------------------------------
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr 
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix

Please provide any additional information below.
--------------------------------------------------------------
Currently attempting to recompile using the following compiler (Will update 
with results):

Using built-in specs.
COLLECT_GCC=g++-4.9
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/4.9.2_1/libexec/gcc/x86_64-apple-darwi
n14.0.0/4.9.2/lto-wrapper
Target: x86_64-apple-darwin14.0.0
Configured with: ../configure --build=x86_64-apple-darwin14.0.0 
--prefix=/usr/local/Cellar/gcc/4.9.2_1 
--libdir=/usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9 
--enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-4.9 
--with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr 
--with-mpc=/usr/local/opt/libmpc --with-cloog=/usr/local/opt/cloog 
--with-isl=/usr/local/opt/isl --with-system-zlib --enable-libstdcxx-time=yes 
--enable-stage1-checking --enable-checking=release --enable-lto 
--disable-werror --with-pkgversion='Homebrew gcc 4.9.2_1' 
--with-bugurl=https://github.com/Homebrew/homebrew/issues --enable-plugin 
--disable-nls --enable-multilib
Thread model: posix
gcc version 4.9.2 (Homebrew gcc 4.9.2_1) 

Original issue reported on code.google.com by zacharia...@gmail.com on 10 Feb 2015 at 9:46

@GoogleCodeExporter
Copy link
Author

Using g++ 4.9 via homebrew results in successful compilation. The generated 
makefile portion with the unexpected newlines should be fixed rather simply by 
editing the makefile code related to the loop on line 389.

Original comment by zacharia...@gmail.com on 10 Feb 2015 at 9:53

@GoogleCodeExporter
Copy link
Author

Hi,


I use mac version 10.8.5. I installed g++ 4.9, and compile with "make depend; 
make." It still gives me error:
makefile:402: *** missing separator.  Stop.

Could you provide more information on how you use g++ 4.9 to compile please? 
Thank you.

Original comment by AnnYoung...@gmail.com on 12 May 2015 at 2:52

@GoogleCodeExporter
Copy link
Author

Changing the GPP=g++ line in the makefile to GPP=g++-4.9 worked for me (after 
also following the instructions for MacOSX at 
http://alchemy.cs.washington.edu/requirements.html)

Original comment by ericgrib...@gmail.com on 20 Jun 2015 at 12:40

@GoogleCodeExporter
Copy link
Author

I followed the instructions for MacOSX and used g++-4.9, but I'm still getting 
the following error:

../src/parser/fol.y:2485.3-15: warning: extra characters in character literal 
[-Wother]
   'x^2 + x + 3'
   ^^^^^^^^^^^^^
mv -f fol.tab.c  ../src/parser/fol.cpp
../src/parser/replacefolcpp.pl ../src/parser/fol.cpp
g++-4.9 -g -w -Wno-deprecated -Wall -I. -I../src/util -I../src/logic 
-I../src/parser -I../src/learnwts -I../src/learnstruct -I../src/infer 
-I../src/liftedinfer/bridge/includes -I../src/liftedinfer/common/includes 
-I../src/liftedinfer/liftedblockedgibbs/includes 
-I../src/liftedinfer/liftedimportancesampling/includes 
-I../src/liftedinfer/liftedweightedmodelcounting/includes 
-I../src/liftedinfer/tests -o ../bin/obj/fol.o -c ../src/parser/fol.cpp
In file included from ../src/parser/fol.y:106:0:
../src/parser/follex.y: In function 'int yylex()':
../src/parser/follex.y:165:10: error: 'ZZ_INCLUDE' was not declared in this 
scope
   return ZZ_INCLUDE;
          ^
In file included from ../src/parser/fol.y:106:0:
../src/parser/follex.y:201:10: error: 'ZZ_IMPLY' was not declared in this scope
   return ZZ_IMPLY;
          ^
In file included from ../src/parser/fol.y:106:0:
../src/parser/follex.y:210:10: error: 'ZZ_EQUIV' was not declared in this scope
   return ZZ_EQUIV;
          ^
In file included from ../src/parser/fol.y:106:0:
../src/parser/follex.y:219:10: error: 'ZZ_EXIST' was not declared in this scope
   return ZZ_EXIST;
          ^
In file included from ../src/parser/fol.y:106:0:
../src/parser/follex.y:228:10: error: 'ZZ_FORALL' was not declared in this scope
   return ZZ_FORALL;
          ^
In file included from ../src/parser/fol.y:106:0:
../src/parser/follex.y:272:10: error: 'ZZ_NUM' was not declared in this scope
   return ZZ_NUM;  
          ^
In file included from ../src/parser/fol.y:106:0:
../src/parser/follex.y:281:10: error: 'ZZ_NUM' was not declared in this scope
   return ZZ_NUM;
          ^
In file included from ../src/parser/fol.y:106:0:
../src/parser/follex.y:290:10: error: 'ZZ_NUM' was not declared in this scope
   return ZZ_NUM;
          ^
In file included from ../src/parser/fol.y:106:0:
../src/parser/follex.y:299:44: error: 'ZZ_CONSTANT' was not declared in this 
scope
   if (zzdomain->isConstant(yytext)) return ZZ_CONSTANT;
                                            ^
../src/parser/follex.y:300:10: error: 'ZZ_STRING' was not declared in this scope
   return ZZ_STRING;
          ^
In file included from ../src/parser/fol.y:106:0:
../src/parser/follex.y:312:12: error: 'ZZ_TYPE' was not declared in this scope
     return ZZ_TYPE;
            ^
../src/parser/follex.y:317:12: error: 'ZZ_PREDICATE' was not declared in this 
scope
     return ZZ_PREDICATE; 
            ^
../src/parser/follex.y:322:12: error: 'ZZ_FUNCTION' was not declared in this 
scope
     return ZZ_FUNCTION;
            ^
../src/parser/follex.y:327:12: error: 'ZZ_CONSTANT' was not declared in this 
scope
     return ZZ_CONSTANT;
            ^
../src/parser/follex.y:330:10: error: 'ZZ_VARIABLE' was not declared in this 
scope
   return ZZ_VARIABLE;
          ^
In file included from ../src/parser/fol.y:106:0:
../src/parser/follex.y:415:10: error: 'ZZ_DOTDOTDOT' was not declared in this 
scope
   return ZZ_DOTDOTDOT;
          ^
makefile:218: recipe for target '../bin/obj/fol.o' failed
make: *** [../bin/obj/fol.o] Error 1

Original comment by kazemi0a...@gmail.com on 3 Jul 2015 at 10:41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant