1
votes

I tried to install Orion context Broker on Ubuntu 14.04 with Alien but when I do contextBroker start it says:

contextBroker: error while loading shared libraries: libboost_thread-mt.so.5: cannot open shared object file: No such file or directory

I couldn't find where is the error then I tried to install with all the dependencies from the instructions in Git, but when I try to do the make it makes an error:

[ 26%] Building CXX object src/lib/serviceRoutines/CMakeFiles/serviceRoutines.dir/exitTreat.cpp.o In file included from /home/sistemas/fiware-orion-develop/src/lib/serviceRoutines/exitTreat.cpp:32:0: /home/sistemas/fiware-orion-develop/src/lib/mongoBackend/MongoGlobal.h:30:35: fatal error: mongo/client/dbclient.h: No existe el archivo o el directorio #include "mongo/client/dbclient.h"

I have the mongo's driver installed, how can I solve this?

Finally I compile a new driver from https://github.com/mongodb/mongo-cxx-driver/releases and it continues compiling until:

*

/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp: In function ‘void recoverOnTimeIntervalThread(std::string, mongo::BSONObj&)’:
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:532:40: error: ‘class mongo::OID’ has no member named ‘str’
   std::string  subId   = idField.OID().str();
                                        ^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp: In function ‘void destroyOnTimeIntervalThread(std::string, mongo::BSONObj&)’:
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:583:40: error: ‘class mongo::OID’ has no member named ‘str’
   std::string  subId   = idField.OID().str();
                                        ^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp: In function ‘void releaseTriggeredSubscriptions(std::map<std::basic_string<char>, TriggeredSubscription*>&)’:
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:17: error: ‘string’ was not declared in this scope
   for (std::map<string, TriggeredSubscription*>::iterator it = subs.begin(); it != subs.end(); ++it)
                 ^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:17: note: suggested alternative:
In file included from /usr/include/c++/4.9/iosfwd:39:0,
                 from /usr/include/boost/smart_ptr/shared_ptr.hpp:49,
                 from /usr/include/boost/shared_ptr.hpp:17,
                 from /usr/include/mongo/client/dbclient_rs.h:20,
                 from /usr/include/mongo/client/dbclient.h:59,
                 from /home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:27:
/usr/include/c++/4.9/bits/stringfwd.h:62:33: note:   ‘std::string’
   typedef basic_string<char>    string;   
                                 ^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:47: error: template argument 1 is invalid
   for (std::map<string, TriggeredSubscription*>::iterator it = subs.begin(); it != subs.end(); ++it)
                                               ^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:47: error: template argument 3 is invalid
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:47: error: template argument 4 is invalid
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:59: error: invalid type in declaration before ‘it’
   for (std::map<string, TriggeredSubscription*>::iterator it = subs.begin(); it != subs.end(); ++it)
                                                           ^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:59: error: expected ‘;’ before ‘it’
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:59: error: ‘it’ was not declared in this scope
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:94: error: expected ‘)’ before ‘;’ token
   for (std::map<string, TriggeredSubscription*>::iterator it = subs.begin(); it != subs.end(); ++it)

/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:50: error: unused variable ‘iterator’ [-Werror=unused-variable]
   for (std::map<string, TriggeredSubscription*>::iterator it = subs.begin(); it != subs.end(); ++it)
                                                  ^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:98: error: ‘it’ was not declared in this scope
   for (std::map<string, TriggeredSubscription*>::iterator it = subs.begin(); it != subs.end(); ++it)
                                                                                                  ^
cc1plus: all warnings being treated as errors
make[3]: *** [src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/MongoGlobal.cpp.o] Error 1
make[3]: se sale del directorio «/home/sistemas/fiware-orion/BUILD_RELEASE»
make[2]: *** [src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/all] Error 2
make[2]: *** Se espera a que terminen otras tareas....
[ 88%] Building CXX object src/lib/xmlParse/CMakeFiles/xmlParse.dir/xmlRegisterProviderRequest.cpp.o

*

Is a problem in a file of Orion Context Broker?

I think that it could be a problem with de mongo's driver again but I try to install another one older and it doesn't work. I also think it can be a problem with de -mt libraries that doesn't exist in boost anymore, but nothing that I try until now works.

2

2 Answers

2
votes

I've installed Orion CB using Ubuntu 14.04 LTS as host. I've also found some problems with libboost_thread-mt.so libraries. Solved this way:

Get & install packages boost-thread-1.41.0-25.el6.x86_64.rpm boost-system-1.41.0-25.el6.x86_64.rpm boost-filesystem-1.41.0-25.el6.x86_64.rpm

and install them using alien. Then, the libraries were installed in “/usr/lib64” folder. To correct this (and CB is able to locate them): create a .conf file within “/etc/ld.so.conf.d/”, add a line (“/usr/lib64”) within and save it and quit and reload your configuration by calling (“sudo ldconfig”)

Hope this helps

0
votes

So, here we have two questions in one. Let's start with the first one, about shared library not found:

Ask the broker where the library should be, using "ldd $(which contextBroker) | grep boost_thread). After running this command, make sure the library is there. If it is not, but you have it elsewhere, you should be able to use the env var LD_LIBRARY_PATH to point to the directory where the library is found.

Now, for the second question, the mongo driver includes are not found. In my machine, I have them in /usr/local/include/mongo => I'm ok with the -I/usr/local/include directive to the compiler. If you have your mongo driver installed elsewhere, you might need to add another 'include-directory' for the compilation. This would be done in the top-level CMakeLists.txt (I guess using 'include_directories' - I'm far from a cmake expert :-)). When building, to see detailed information, compile like this:

% CPU_COUNT=1 VERBOSE=1 make install

Post the info again here unless you manage to solve your problems.