FIWARE- Orion Context Broker - fiware-orion

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.

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

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.

Related

I ran into problems with `cmake..`

Because of some requirements, I need to install doxygen on ubuntu 12.04, but I ran into problems with cmake...
The error log as follow:
~/doxygen/build$ cmake ..
-- Found BISON: /usr/bin/bison (found version "2.7")
-- The javacc executable not found, using existing files
-- Configuring done
CMake Error in liblodepng/CMakeLists.txt:
Target "lodepng" requires the language dialect "CXX14" (with compiler
extensions), but CMake does not know the compile flags to use to enable it.
CMake Error in libmscgen/CMakeLists.txt:
Target "mscgen" requires the language dialect "CXX14" (with compiler
extensions), but CMake does not know the compile flags to use to enable it.
CMake Error in libversion/CMakeLists.txt:
Target "doxygen_version" requires the language dialect "CXX14" (with
compiler extensions), but CMake does not know the compile flags to use to
enable it.
.
.
.
.
.
.
-- Generating done
-- Build files have been written to: /home/nfore/doxygen/build
#albert The problem has been resolved by update GCC into gcc-6 g++-6.
But I ran into new problems as follow:
clang version is Ubuntu clang version 3.4-1ubuntu3~precise2 (tags/RELEASE_34/final) (based on LLVM 3.4)
~/build$ cmake ..
~/build$ make
Building CXX object src/CMakeFiles/doxymain.dir/context.cpp.o
In file included from /home/nfore/windows-kenny/doxygen/doxygen-1.9.2/src/context.h:20:0,
from /home/nfore/windows-kenny/doxygen/doxygen-1.9.2/src/context.cpp:19:
/home/nfore/windows-kenny/doxygen/doxygen-1.9.2/src/template.h:238:20: error: enclosing class of constexpr non-static member function ‘bool TemplateVariant::isValid() const’ is not a literal type
constexpr bool isValid() const { return m_variant.valid(); }
^~~~~~~
/home/nfore/windows-kenny/doxygen/doxygen-1.9.2/src/template.h:92:7: note: ‘TemplateVariant’ is not literal because:
class TemplateVariant
^~~~~~~~~~~~~~~
/home/nfore/windows-kenny/doxygen/doxygen-1.9.2/src/template.h:92:7: note: ‘TemplateVariant’ has a non-trivial destructor
/home/nfore/windows-kenny/doxygen/doxygen-1.9.2/src/template.h:240:20: error: enclosing class of constexpr non-static member function ‘bool TemplateVariant::isBool() const’ is not a literal type
constexpr bool isBool() const { return m_variant.is<bool>(); }
.
.
.
/home/nfore/windows-kenny/doxygen/doxygen-1.9.2/src/template.h:311:27: error: enclosing class of constexpr non-static member function ‘const char* TemplateVariant::typeAsString() const’ is not a literal type
constexpr const char *typeAsString() const
^~~~~~~~~~~~
make[2]: *** [src/CMakeFiles/doxymain.dir/context.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/doxymain.dir/all] Error 2
make: *** [all] Error 2

Sailsjs grunt .svn error during lifting

I have imported my project in svn when I did a checkout and ran the app I got this error I am using sailsjs-0.10.5. I think it is to do with the grunt I am not able to find any solution it works fine in mac not in linux I set the permissin to 0777 even though it is not working here is the error.
verbose: Grunt :: Loading "Gruntfile.js" tasks...
verbose: Grunt :: ERROR
verbose: Grunt :: >> TypeError: Property '.svn' of object # is not a function
verbose: Grunt :: Warning: Task "default" not found.
error: ** Grunt :: An error occurred. **
error:
Aborted due to warnings.
Loading "Gruntfile.js" tasks...ERROR
TypeError: Property '.svn' of object # is not a function
Warning: Task "default" not found.
error: Looks like a Grunt error occurred--
error: Please fix it, then restart Sails to continue running tasks (e.g. watching for changes in assets)
error: Or if you're stuck, check out the troubleshooting tips below.
error: Troubleshooting tips:
error:
error: *-> Are "grunt" and related grunt task modules installed locally? Run npm install if you're not sure.
error:
error: *-> You might have a malformed LESS, SASS, CoffeeScript file, etc.
error:
error: *-> Or maybe you don't have permissions to access the .tmp directory?
error: e.g., /var/hosts/chating_room/.tmp ?
error:
error: If you think this might be the case, try running:
error: sudo chown -R YOUR_COMPUTER_USER_NAME /var/hosts/chating_room/.tmp
Make changes to Gruntfile.js, find loadTasks function, add excludeDirs : /^\.(git|svn)$/:
Original:
function loadTasks(relPath) {
return includeAll({
dirname: require('path').resolve(__dirname, relPath),
filter: /(.+)\.js$/
}) || {};
}
After:
function loadTasks(relPath) {
return includeAll({
dirname: require('path').resolve(__dirname, relPath),
filter: /(.+)\.js$/,
excludeDirs : /^\.(git|svn)$/
}) || {};
}
I have a same problem.
FIXED by
Simply deleting .svn folder from
1) task/.svn,
2) config/.svn &
3) register/.svn

install opencv for perl (centos)

I'm trying to do face detection on perl, and I found out about OpenCV and the perl module Image::ObjectDetect on CPAN here and here. I've done a clean install of CentOS 6.5 (minimal) on a virtual machine to test this, and then:
yum -y update
yum -y install perl cpan opencv
Ok, and considering I never user cpan before, I tried the obvious (after some short google searches)
perl -MCPAN -e shell
[accept default]
install Image::ObjectDetect
that gave me some errors:
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
After googling about that error, I did:
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
mkdir /usr/local/lib/pkgconfig
vi /usr/local/lib/pkgconfig/opencv.pc
the content of the file:
prefix=/usr
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib
Name: opencv
Description: The opencv library
Version: 2.x.x
Cflags: -I${includedir}/opencv -I${includedir}/opencv2
Libs: -L${libdir} -lopencv_calib3d -lopencv_imgproc -lopencv_contrib -lopencv_legacy -l
After I ran the install again, I noticed I was missing gcc:
/bin/sh: gcc: command not found
yum -y install gcc
Running the install again now gives me:
...
Note (probably harmless): No library found for -lopencv_calib3d
Note (probably harmless): No library found for -lopencv_imgproc
Note (probably harmless): No library found for -lopencv_contrib
Note (probably harmless): No library found for -lopencv_legacy
Note (probably harmless): No library found for -l
Writing Makefile for Image::ObjectDetect
Could not read '/root/.cpan/build/Image-ObjectDetect-0.12-BsNNjF/META.yml'. Falling back to other methods to determine prerequisites
cp lib/Image/ObjectDetect.pm blib/lib/Image/ObjectDetect.pm
cp lib/Image/ObjectDetect.xs blib/lib/Image/ObjectDetect.xs
/usr/bin/perl /usr/share/perl5/ExtUtils/xsubpp -typemap /usr/share/perl5/ExtUtils/typemap ObjectDetect.xs > ObjectDetect.xsc && mv ObjectDetect.xsc ObjectDetect.c
gcc -c -I/usr/include/opencv -I/usr/include/opencv2 -Isrc -I/usr/include/opencv -I/usr/include/opencv2 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -DVERSION=\"0.12\" -DXS_VERSION=\"0.12\" -fPIC "-I/usr/lib/perl5/CORE" ObjectDetect.c
In file included from ObjectDetect.xs:7:
/usr/lib/perl5/CORE/cv.h:13: error: redefinition of ‘struct xpvcv’
/usr/lib/perl5/CORE/cv.h:94: error: conflicting types for ‘xpvcv_allocated’
/usr/lib/perl5/CORE/cv.h:94: note: previous declaration of ‘xpvcv_allocated’ was here
ObjectDetect.xs:8:21: error: highgui.h: No such file or directory
ObjectDetect.xs: In function ‘XS_Image__ObjectDetect_new’:
ObjectDetect.xs:19: error: ‘CvHaarClassifierCascade’ undeclared (first use in this function)
ObjectDetect.xs:19: error: (Each undeclared identifier is reported only once
ObjectDetect.xs:19: error: for each function it appears in.)
ObjectDetect.xs:19: error: ‘cascade’ undeclared (first use in this function)
ObjectDetect.xs:22: warning: implicit declaration of function ‘cvLoad’
ObjectDetect.xs: In function ‘XS_Image__ObjectDetect_xs_detect’:
ObjectDetect.xs:37: error: ‘IplImage’ undeclared (first use in this function)
ObjectDetect.xs:37: error: ‘img’ undeclared (first use in this function)
ObjectDetect.xs:37: error: ‘gray’ undeclared (first use in this function)
ObjectDetect.xs:37: warning: left-hand operand of comma expression has no effect
ObjectDetect.xs:39: error: ‘CvMemStorage’ undeclared (first use in this function)
ObjectDetect.xs:39: error: ‘storage’ undeclared (first use in this function)
ObjectDetect.xs:40: error: ‘CvHaarClassifierCascade’ undeclared (first use in this function)
ObjectDetect.xs:40: error: ‘cascade’ undeclared (first use in this function)
ObjectDetect.xs:41: error: ‘CvSeq’ undeclared (first use in this function)
ObjectDetect.xs:41: error: ‘objects’ undeclared (first use in this function)
ObjectDetect.xs:42: error: ‘CvRect’ undeclared (first use in this function)
ObjectDetect.xs:42: error: ‘rect’ undeclared (first use in this function)
ObjectDetect.xs:46: warning: implicit declaration of function ‘cvLoadImage’
ObjectDetect.xs:50: warning: implicit declaration of function ‘cvCreateImage’
ObjectDetect.xs:50: warning: implicit declaration of function ‘cvSize’
ObjectDetect.xs:51: warning: implicit declaration of function ‘cvCvtColor’
ObjectDetect.xs:51: error: ‘CV_BGR2GRAY’ undeclared (first use in this function)
ObjectDetect.xs:52: warning: implicit declaration of function ‘cvEqualizeHist’
ObjectDetect.xs:54: warning: implicit declaration of function ‘cvCreateMemStorage’
ObjectDetect.xs:55: error: expected expression before ‘)’ token
ObjectDetect.xs:56: warning: implicit declaration of function ‘cvHaarDetectObjects’
ObjectDetect.xs:58: error: ‘CV_HAAR_DO_CANNY_PRUNING’ undeclared (first use in this function)
ObjectDetect.xs:65: error: expected expression before ‘)’ token
ObjectDetect.xs:74: warning: implicit declaration of function ‘cvReleaseMemStorage’
ObjectDetect.xs:75: warning: implicit declaration of function ‘cvReleaseImage’
ObjectDetect.xs: In function ‘XS_Image__ObjectDetect_DESTROY’:
ObjectDetect.xs:86: error: ‘CvHaarClassifierCascade’ undeclared (first use in this function)
ObjectDetect.xs:86: error: ‘cascade’ undeclared (first use in this function)
ObjectDetect.xs:88: error: expected expression before ‘)’ token
ObjectDetect.xs:89: warning: implicit declaration of function ‘cvReleaseHaarClassifierCascade’
make: *** [ObjectDetect.o] Error 1
JIRO/Image-ObjectDetect-0.12.tar.gz
/usr/bin/make -- NOT OK
Warning (usually harmless): 'YAML' not installed, will not store persistent state
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Failed during this command:
JIRO/Image-ObjectDetect-0.12.tar.gz : make NO
Any help? Thanks.
Glad to see someone using OpenCV with Perl! I hope you can get it working and show us some nice asps and scripts :-)
You seem to be building from source and installing packages (with yum) - this sometimes complicates matters when it comes to dependencies. For example, you may have a version of OpenCV that is too new for the CPAN module. Image::ObjectDetect` is fairly old
(the last release was several years ago http://metacpan.org/pod/Image::ObjectDetect) whereas OpenCV is being actively developed.
Note this line:
ObjectDetect.xs:8:21: error: highgui.h: No such file or directory
I came across a similar error compiling applications that depend on OpenCV after a recent update. Either the header files were missing; the applications Makefiles did not know how to locate them; or other development libraries and headers in the chain of dependencies needed updating as well.
You may get better luck solving this by posting to the OpenCV development list where the error message may look more familiar.
See: http://groups.yahoo.com/neo/groups/OpenCV/info
You could try installing some other modules to see if it is perl, XS, gcc or your version of OpenCV that is at fault. Here's another module that uses OpenCV:
https://github.com/shisful/Image-OpenCV

Perl Cross Compilation: MAKE

I've been trying to Cross Compile Perl-5.14.2 for NetBSD target from Linux machine.
Configure script successfully invoked with following options,
./Configure -des -Dusecrosscompile
-Dtargetarch=netbsd
-Dosvers=3.0.0
-Dtargethost=10.184.22.48
-Dtargetuser=username
-Dusrinc=.../sb1-mips/usr/include
-Dlibpth=.../xc-sb1-mips/netbsd/Lib/lib
-Dcc=.../mips64-netbsdelf-gcc
Once after Configured, make wasn't successful.
It breaks at different places right from creating miniperlmain.o file.
For example following error occurred while generating gv.o file:
gv.c: In function `Perl_try_amagic_un':
gv.c:2018: error: void value not ignored as it ought to be
gv.c:2029: error: void value not ignored as it ought to be
gv.c:2029: warning: cast from pointer to integer of different size
gv.c: In function `Perl_try_amagic_bin':
gv.c:2061: error: void value not ignored as it ought to be
gv.c:2063: error: void value not ignored as it ought to be
make: *** [gv.o] Error 1
Now to get rid of these errors I've passed two flags namely -DPERL_IMPLICIT_CONTEXT and -DPERL_GCC_BRACE_GROUPS_FORBIDDEN to C Compiler CCFLAGS which solved the problem.
Since it is a custom build, want to know about all of the CCFLAGS that have to be passed in order to achieve a successful build?
What does each flag mean?
Is their any documentation available?
Use vagrant. It has some OpenBSD and FreeBSD images. Hopefuly those will be compatible with NetBSD.
You can get a build environment very fast with that. Then you can transfer and build your code happily :)

Perl IPTables Module Installation Error

I've been trying to install the IPTables module for perl http://metacpan.org/pod/IPTables::IPv4 and I've been running into errors during installation.
I've tried installing using the CPAN in shell as well as downloading the tarball form the link above. Both installation give me errors. I am not sure how to get the dump from CPAN but what I can get is a dump of my shell when I run the MAKE file from the tarball:
[root#localhost IPTables-IPv4-0.98]# make
make -C libiptc/ all
make[1]: Entering directory `/home/student/Downloads/IPTables-IPv4-0.98/libiptc'
gcc -o libip6tc.o -c libip6tc.c -I../include -I/usr/src/linux/include -DIPTABLES_VERSION=\"1.2.8\" -O2 -Wall
In file included from libip6tc.c:111:0:
libiptc.c: In function ‘ip6tc_init’:
libiptc.c:312:10: warning: pointer targets in passing argument 5 of ‘getsockopt’ differ in signedness
/usr/include/sys/socket.h:190:12: note: expected ‘socklen_t * __restrict__’ but argument is of type ‘int *’
libiptc.c: In function ‘target_name’:
libiptc.c:727:2: warning: dereferencing type-punned pointer will break strict-aliasing rules
libip6tc.c: In function ‘ipv6_prefix_length’:
libip6tc.c:121:7: error: ‘const struct in6_addr’ has no member named ‘in6_u’
libip6tc.c:125:7: error: ‘const struct in6_addr’ has no member named ‘in6_u’
libip6tc.c: In function ‘dump_entry’:
libip6tc.c:201:3: warning: dereferencing type-punned pointer will break strict-aliasing rules
make[1]: *** [libip6tc.o] Error 1
make[1]: Leaving directory `/home/student/Downloads/IPTables-IPv4-0.98/libiptc'
make: *** [libiptc/libiptc.a] Error 2
[root#localhost IPTables-IPv4-0.98]#
I would like to know what do I need to do so that I can install the module. Are there some dependencies that I need to install?
Your help is greatly appreciated.
The cpanratings and CPAN testers reports for this module make me think that you're wasting your time here.