Ask Your Question
0

Invoking "cmake" failed

asked 2018-08-12 04:44:36 -0500

Tommy Hay gravatar image

updated 2018-08-12 04:46:19 -0500

I have previously installed Ubuntu 16.04 LTS and ROS kinetic on PC. I try to practice tutorial according this ( http://wiki.ros.org/cv_bridge/Tutoria... )

I create a package using catkin_create_pkg sample_opencv_pkg sensor_msgs opencv2 cv_bridge rospy std_msgs. the terminal shows

Created file sample_opencv_pkg/CMakeLists.txt
Created file sample_opencv_pkg/package.xml
Created folder sample_opencv_pkg/src
Successfully created files in /home/my/catkin_ws/src/sample_opencv_pkg. Please adjust the values in package.xml.

Then I change direction to catkin_ws ,and use catkin_make .The terminal show the following error:

Base path: /home/my/catkin_ws
Source space: /home/my/catkin_ws/src
Build space: /home/my/catkin_ws/build
Devel space: /home/my/catkin_ws/devel
Install space: /home/my/catkin_ws/install
####
#### Running command: "cmake /home/my/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/my/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/my/catkin_ws/install -G Unix Makefiles" in "/home/my/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/my/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/my/catkin_ws/devel;/opt/ros/kinetic
-- This workspace overlays: /home/my/catkin_ws/devel;/opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/my/catkin_ws/build/test_results
-- Found gmock sources under '/usr/src/gmock': gmock will be built
-- Found gtest sources under '/usr/src/gmock': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.11
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 9 packages in topological order:
-- ~~  - turtlebot3 (metapackage)
-- ~~  - turtlebot3_msgs
-- ~~  - turtlebot3_navigation
-- ~~  - sample_opencv_pkg
-- ~~  - turtlebot3_bringup
-- ~~  - turtlebot3_example
-- ~~  - turtlebot3_slam
-- ~~  - turtlebot3_teleop
-- ~~  - turtlebot3_description
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin metapackage: 'turtlebot3'
-- ==> add_subdirectory(turtlebot3/turtlebot3)
-- +++ processing catkin package: 'turtlebot3_msgs'
-- ==> add_subdirectory(turtlebot3_msgs)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- turtlebot3_msgs: 3 messages, 0 services
-- +++ processing catkin package: 'turtlebot3_navigation'
-- ==> add_subdirectory(turtlebot3/turtlebot3_navigation)
-- +++ processing catkin package: 'sample_opencv_pkg'
-- ==> add_subdirectory(sample_opencv_pkg)
CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
  Could not find a package configuration file provided by "opencv2" with any
  of the following names:

    opencv2Config.cmake
    opencv2-config.cmake

  Add the installation prefix of "opencv2" to CMAKE_PREFIX_PATH or set
  "opencv2_DIR" to a directory containing one of the above files.  If
  "opencv2" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  sample_opencv_pkg/CMakeLists.txt:10 (find_package)


-- Could not find the required component 'opencv2'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "opencv2" with any
  of the following names:

    opencv2Config.cmake
    opencv2-config.cmake
"opencv2" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  sample_opencv_pkg/CMakeLists.txt:10 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/my/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/my/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

  Add the installation prefix of "opencv2" to CMAKE_PREFIX_PATH or set
  "opencv2_DIR" to a directory containing one of the above files ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-08-13 14:09:12 -0500

Bogdar_ gravatar image

CMake can not find your opencv2 installation. As is a required component of the find_package command, compilation fails to success. Review your opencv2 install. It is not an ROS issue but machine configuration problem. Most common problems with CMake are that specific CMake Library Modules are missing so CMake can not recognize them (which I guess it is not your case, a classic example is Eigen).

Try also to check rosdep external dependencies that are not installed and soem of your package requires:

rosdep install --from-paths src --ignore-src -r -y
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-08-12 04:44:36 -0500

Seen: 389 times

Last updated: Aug 13 '18