OpenCV and cv_bridge build
I'm building from source on debian based raspberry pi. When building cv_bridge it failed due to OpenCV being 2.x instead of 3.x. Since I was unable to find 3.x through any for of apt/deb package I build it from source.
I then edited CMakeLists.txt to include
find_package(OpenCV 3 REQUIRED
PATHS /home/pi/ros_catkin_ws/opencv
NO_DEFAULT_PATH
COMPONENTS
opencv_core
opencv_imgproc
opencv_imgcodecs
CONFIG
)
The on screen results told me I could rerun just a specific command, so I did:
cd /home/pi/ros_catkin_ws/build_isolated/cv_bridge && /home/pi/ros_catkin_ws/install_isolated/env.sh cmake /home/pi/ros_catkin_ws/src/vision_opencv/cv_bridge -DCATKIN_DEVEL_PREFIX=/home/pi/ros_catkin_ws/devel_isolated/cv_bridge -DCMAKE_INSTALL_PREFIX=/home/pi/ros_catkin_ws/install_isolated -G 'Unix Makefiles'
This seemed successful:
-- Found OpenCV: /home/pi/ros_catkin_ws/opencv (found suitable version "3.4.16", minimum required is "3") found components: opencv_core opencv_imgproc opencv_imgcodecs
-- Found PythonLibs: /usr/lib/arm-linux-gnueabihf/libpython2.7.so (found suitable version "2.7.13", minimum required is "2.7")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/ros_catkin_ws/src/vision_opencv/cv_bridge
So then I reran the build, just for cv_bridge:
./src/catkin/bin/catkin_make_isolated --install --only-pkg-with-deps cv_bridge
And it's failing in a completely different way now.
-- Build files have been written to: /home/pi/ros_catkin_ws/src/vision_opencv/cv_bridge
==> make -j8 -l8 in '/home/pi/ros_catkin_ws/build_isolated/cv_bridge'
make: *** No targets specified and no makefile found. Stop.
<== Failed to process package 'cv_bridge':
Command '['/home/pi/ros_catkin_ws/install_isolated/env.sh', 'make', '-j8', '-l8']' returned non-zero exit status 2
Reproduce this error by running:
==> cd /home/pi/ros_catkin_ws/build_isolated/cv_bridge && /home/pi/ros_catkin_ws/install_isolated/env.sh make -j8 -l8
Not sure what to try at this point.
The ROS melodic packages expect that you have installed the development version of libopencv 3.2.0 as a system library (not as a ros pkg.) Each ros release depends on a specific version of opencv. You can then attempt to build the ros packages in your catkin_ws that depend on the many libopencv*.so shared libraries.
Your can use rosdep to determine the dependencies needed by a particular ros package.
I understand what you have said, but that's doesn't solve my problem at all :) I've built open CV 3.x from source - I don't have package - building it from source is as good as having the development version of this. I thought I was clear on that. Once I built openCV from source, My build fails with a completely different error, which is in the last box of my post.