opencog / cogutil

Very low-level C++ programming utilities used by several components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error while building cogutils for MOSES

EskenderTamrat opened this issue · comments

Based on the recent changes of the Opencog codebase, I think its possible to run MOSES separately from Opencog. But when I try to build the only prerequisite Cogutils, I encountered the following problem.

:~/Downloads/OPENCOG/cogutils-master/build$ make

Scanning dependencies of target cogutil
[ 5%] Building CXX object opencog/util/CMakeFiles/cogutil.dir/ansi.cc.o
[ 10%] Building C object opencog/util/CMakeFiles/cogutil.dir/backtrace-symbols.c.o
[ 15%] Building C object opencog/util/CMakeFiles/cogutil.dir/cluster.c.o
[ 20%] Building CXX object opencog/util/CMakeFiles/cogutil.dir/Config.cc.o
In file included from /home/addis-ai/Downloads/OPENCOG/cogutils-master/opencog/util/Config.cc:50:0:
/home/addis-ai/Downloads/OPENCOG/cogutils-master/opencog/util/exceptions.h:72:32: error: expected ‘;’ at end of member declaration
/home/addis-ai/Downloads/OPENCOG/cogutils-master/opencog/util/exceptions.h:72:38: error: ‘_GLIBCXX_USE_NOEXCEPT’ does not name a type
/home/addis-ai/Downloads/OPENCOG/cogutils-master/opencog/util/exceptions.h:72:25: error: looser throw specifier for ‘virtual const char* opencog::StandardException::what() const’
/usr/include/c++/4.6/exception:69:25: error: overriding ‘virtual const char* std::exception::what() const throw ()’
make[2]: *** [opencog/util/CMakeFiles/cogutil.dir/Config.cc.o] Error 1
make[1]: *** [opencog/util/CMakeFiles/cogutil.dir/all] Error 2
make: *** [all] Error 2

Any suggestions?

what compiler and OS are you using? the _GLIBCXX_USE_NOEXCEPT statement has been there since fore ver, not clear why its failing now.

whatever, I just pushed a fix that should solve this for you.

I encountered a slightly different error message with the new commit. I updated my compiler to 4.8, but had same error message. My OS is Ubuntu 12.04.

Scanning dependencies of target cogutil
[ 5%] Building CXX object opencog/util/CMakeFiles/cogutil.dir/ansi.cc.o
[ 10%] Building C object opencog/util/CMakeFiles/cogutil.dir/backtrace-symbols.c.o
[ 15%] Building C object opencog/util/CMakeFiles/cogutil.dir/cluster.c.o
[ 20%] Building CXX object opencog/util/CMakeFiles/cogutil.dir/Config.cc.o
In file included from /home/addis-ai/OPENCOG/cogutils/opencog/util/Config.cc:50:0:
/home/addis-ai/OPENCOG/cogutils/opencog/util/exceptions.h:72:32: error: expected ‘;’ at end of member declaration
/home/addis-ai/OPENCOG/cogutils/opencog/util/exceptions.h:72:38: error: ‘_GLIBCXX_USE_NOEXCEPT’ does not name a type
/home/addis-ai/OPENCOG/cogutils/opencog/util/exceptions.h:71:13: error: looser throw specifier for ‘virtual opencog::StandardException::~StandardException()’
/usr/include/c++/4.6/exception:65:13: error: overriding ‘virtual std::exception::~exception() throw ()’
/home/addis-ai/OPENCOG/cogutils/opencog/util/exceptions.h:72:25: error: looser throw specifier for ‘virtual const char* opencog::StandardException::what() const’
/usr/include/c++/4.6/exception:69:25: error: overriding ‘virtual const char* std::exception::what() const throw ()’
make[2]: *** [opencog/util/CMakeFiles/cogutil.dir/Config.cc.o] Error 1
make[1]: *** [opencog/util/CMakeFiles/cogutil.dir/all] Error 2
make: *** [all] Error 2

Thanks

what compiler version? 4.8.0? 4.8.1 4.8.4?

try gcc --version

Sorry for the late reply. gcc version is 4.8.1. I also tried with 4.9.2. But I am getting the following error


Scanning dependencies of target cogutil
[ 5%] Building CXX object opencog/util/CMakeFiles/cogutil.dir/ansi.cc.o
[ 10%] Building C object opencog/util/CMakeFiles/cogutil.dir/backtrace-symbols.c.o
[ 15%] Building C object opencog/util/CMakeFiles/cogutil.dir/cluster.c.o
[ 20%] Building CXX object opencog/util/CMakeFiles/cogutil.dir/Config.cc.o
In file included from /media/E8ED-808C/cogutils/opencog/util/Config.cc:50:
/media/E8ED-808C/cogutils/opencog/util/exceptions.h:76:13: error: exception specification of overriding function is more lax than base version
virtual ~StandardException() _GLIBCXX_USE_NOEXCEPT;
^
/usr/include/c++/4.6/exception:64:13: note: overridden virtual function is here
virtual ~exception() throw();
^
In file included from /media/E8ED-808C/cogutils/opencog/util/Config.cc:50:
/media/E8ED-808C/cogutils/opencog/util/exceptions.h:77:25: error: exception specification of overriding function is more lax than base version
virtual const char* what() const _GLIBCXX_USE_NOEXCEPT {
^
/usr/include/c++/4.6/exception:68:25: note: overridden virtual function is here
virtual const char* what() const throw();
^
/media/E8ED-808C/cogutils/opencog/util/Config.cc:335:17: error: no type named 'unique_ptr' in namespace 'std'
static std::unique_ptr instance((_factoryFunction)());
~~~~~^
/media/E8ED-808C/cogutils/opencog/util/Config.cc:335:27: error: expected unqualified-id
static std::unique_ptr instance((_factoryFunction)());
^
/media/E8ED-808C/cogutils/opencog/util/Config.cc:337:9: error: use of undeclared identifier 'instance'; did you mean 'distance'?
instance.reset((_factoryFunction)());
^~~~~~~~
distance
/usr/include/c++/4.6/bits/stl_iterator_base_funcs.h:112:5: note: 'distance' declared here
distance(_InputIterator __first, _InputIterator __last)
^
/media/E8ED-808C/cogutils/opencog/util/Config.cc:337:9: error: reference to overloaded function could not be resolved; did you mean to call it?
instance.reset((_factoryFunction)());
^~~~~~~~
/usr/include/c++/4.6/bits/stl_iterator_base_funcs.h:110:3: note: possible target for call
template
^
/media/E8ED-808C/cogutils/opencog/util/Config.cc:338:13: error: use of undeclared identifier 'instance'; did you mean 'distance'?
return _instance;
^~~~~~~~
distance
/usr/include/c++/4.6/bits/stl_iterator_base_funcs.h:112:5: note: 'distance' declared here
distance(_InputIterator __first, InputIterator __last)
^
/media/E8ED-808C/cogutils/opencog/util/Config.cc:338:13: error: reference to overloaded function could not be resolved; did you mean to call it?
return *instance;
^~~~~~~~
/usr/include/c++/4.6/bits/stl_iterator_base_funcs.h:110:3: note: possible target for call
template
^
8 errors generated.
make[2]: *
* [opencog/util/CMakeFiles/cogutil.dir/Config.cc.o] Error 1
make[1]: *** [opencog/util/CMakeFiles/cogutil.dir/all] Error 2
make: *** [all] Error 2


Can you take a look at exceptions.h and see what's going on? I tried to set it up in there so that _GLIBCXX_USE_NOEXCEPT got defined or undefined or whatever, done correctly for each differrent compiler, but i guess its not quite right. This should not be hard: take a look at the cogutil exceptions.h and compare that to the code in /usr/include/c++/4.6/exception:64:13: ...

whoa. I see a HUGE problem already: your compiler install is totally messed up! If you are using gcc-4.8.1 it should be pulling from /usr/include/c++/4.8 and NOT from /usr/include/c++/4.6 !!! That problem right there is enough to sink the battleship.

I'll take a look at the installation carefully. It seems all the time 4.6 has been used. I will get back to you, asap. Thanks, Linas.