Re: How to build rtabmap_ros with own opencv instead of ros's opencv
Posted by
matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/How-to-build-rtabmap-ros-with-own-opencv-instead-of-ros-s-opencv-tp3113p3119.html
Hi,
don't build opencv in /usr/local, but install it in it:
$ cd ~
$ git clone https://github.com/opencv/opencv.git
$ cd opencv
$ mkdir build
$ make
$ sudo make install
This will install in /usr/local by default.
You don't need to change anything in the CMakeLists.txt. By default cmake will try the default paths to find OpenCVConfig.cmake. Make sure in the PATH, "/usr/local/bin" is first:
$ export PATH=/usr/local/bin:$PATH
Make sure to clean the build directory of rtabmap to force cmake to look up again for opencv.
On runtime, if opencv libraries in /usr/local/lib are not taken first, you can update LD_LIBRARY_PATH environment variable:
$ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
Also which version of opencv are you installing? If it is opencv 2 on Kinetic, there will be conflicts when building rtabmap_ros. See
installation instructions for more info.
cheers,
Mathieu