0
$\begingroup$

Rosanswers logo

I'm trying to install ROS from source on Fedora 20 as per http://wiki.ros.org/indigo/Installation/Source. It fails with:

    CMake Error at /home/jfstepha/ros_catkin_ws/install_isolated/share/cv_bridge/cmake/cv_bridgeConfig.cmake:106 (message):
  Project 'cv_bridge' specifies '//include/opencv' as an include dir, which
  is not found.  It does neither exist as an absolute directory nor in
  '/home/jfstepha/ros_catkin_ws/install_isolated///include/opencv'

The correct path should be "/usr/include/opencv", somehow it seems to be missing the "usr". Also, it successfully builds 153 packages before this, so it doesn't seem to be a general setup issue.

I'm having a hard time figuring out where this path comes from - can anyone help?


Originally posted by Jon Stephan on ROS Answers with karma: 837 on 2014-12-10

Post score: 0


Original comments

Comment by ahendrix on 2014-12-10:
Perhaps this is related: http://answers.ros.org/question/198058/cmake-error-while-building-rpg_svo/ ?

Comment by Jon Stephan on 2014-12-11:
@ahendrix: It could possibly be somehow related in that it could be an opencv configuration bug, but the root cause of that one had to do with the Nvidia TK1 Jetson board, which I am not using. It could be the same environmental variable is missing or something.

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

The problem was that OpenCV_INCLUDE_DIRS was not getting set properly. It gets set by this line in /usr/lib64/OpenCVConfig.cmake

set(OpenCV_INCLUDE_DIRS "${OpenCV_INSTALL_PATH}/include/opencv;${OpenCV_INSTALL_PATH}/include")

The root cause is probably that OpenCV_INSTALL_PATH is not set properly, but I just changed the line to this:

set(OpenCV_INCLUDE_DIRS "/usr/include/opencv;/usr/include")

This seemed to work.


Originally posted by Jon Stephan with karma: 837 on 2014-12-14

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

In my case in Jetson Nano, the error happened when I ran catkin_make clean for the first time.

The actual path for OpenCV include files was /usr/include/opencv4/opencv2 though /usr/include/opencv was expected.

So, after this actual path is written correctly in the cv_bridgeConfig.cmake file, the error disappeared.


Originally posted by bigbellmercy with karma: 86 on 2021-03-23

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by Marcus Forte on 2021-04-27:
The same happened here. Thank you for the correction!

$\endgroup$
0
$\begingroup$

Rosanswers logo

I'm on a Nvidia Jetson platform.

As said above, cv_bridge expects /usr/include/opencv but on jetson systems it's under /usr/include/opencv4/opencv2

The quickest way to solve this, without rewriting config files is to symlink the directories:

sudo ln -s /usr/include/opencv4/opencv2/ /usr/include/opencv


Originally posted by eeppii with karma: 116 on 2021-04-29

This answer was NOT ACCEPTED on the original site

Post score: 10


Original comments

Comment by kidargueta on 2021-05-09:
I think this is the best way to go, as it will fix issues with other scripts trying to find opencv in the future.

Comment by mysqo on 2021-06-04:
Thanks, this solved my problem when running on NVida Xavier!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.