ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
3

Building gencpp from source

asked 2013-03-16 21:01:20 -0500

FranciscoD gravatar image

updated 2013-06-22 12:04:52 -0500

allenh1 gravatar image

I'm trying to build gencpp from source on a Fedora 18 system. I think I have the prerequisites already built: catkin and genmsg; however, during the build, cmake fails to find the genmsg cmake files. Here's the error:

+ /usr/bin/cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINCLUDE_INSTALL_DIR:PATH=/usr/include -DLIB_INSTALL_DIR:PATH=/usr/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/share -DLIB_SUFFIX=64 -DBUILD_SHARED_LIBS:BOOL=ON ..
-- The C compiler identification is GNU 4.7.2
-- The CXX compiler identification is GNU 4.7.2
-- Check for working C compiler: /usr/lib64/ccache/cc
-- Check for working C compiler: /usr/lib64/ccache/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/lib64/ccache/c++
-- Check for working CXX compiler: /usr/lib64/ccache/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Using CATKIN_DEVEL_PREFIX: /builddir/build/BUILD/gencpp-0.4.12/build/devel
-- Using CMAKE_PREFIX_PATH: 
-- Found PythonInterp: /usr/bin/python (found version "2.7.3") 
-- Found PY_em: /usr/lib/python2.7/site-packages/em.pyc  
-- Found gtest: gtests will be built
-- Using CATKIN_TEST_RESULTS_DIR: /builddir/build/BUILD/gencpp-0.4.12/build/test_results
-- catkin 0.5.64
CMake Error at /usr/share/catkin/cmake/catkinConfig.cmake:72 (find_package):
  Could not find a package configuration file provided by "genmsg" with any
  of the following names:
    genmsgConfig.cmake
    genmsg-config.cmake
  Add the installation prefix of "genmsg" to CMAKE_PREFIX_PATH or set
  "genmsg_DIR" to a directory containing one of the above files.  If "genmsg"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  CMakeLists.txt:3 (find_package)
-- Configuring incomplete, errors occurred!
error: Bad exit status from /var/tmp/rpm-tmp.tRuPTe (%build)
    Bad exit status from /var/tmp/rpm-tmp.tRuPTe (%build)

I've tried to define the genmsg_DIR variable as suggested in the error too, but it doesn't seem to make a difference:

+ /usr/bin/cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINCLUDE_INSTALL_DIR:PATH=/usr/include -DLIB_INSTALL_DIR:PATH=/usr/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/share -DLIB_SUFFIX=64 -DBUILD_SHARED_LIBS:BOOL=ON .. -Dgenmsg_DIR=/builddir/build/BUILDROOT/ros-gencpp-groovy-0.4.12-1.fc18.x86_64//usr/share/genmsg/cmake
-- The C compiler identification is GNU 4.7.2
-- The CXX compiler identification is GNU 4.7.2
-- Check for working C compiler: /usr/lib64/ccache/cc
-- Check for working C compiler: /usr/lib64/ccache/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/lib64/ccache/c++
-- Check for working CXX compiler: /usr/lib64/ccache/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Using CATKIN_DEVEL_PREFIX: /builddir/build/BUILD/gencpp-0.4.12/build/devel
-- Using CMAKE_PREFIX_PATH: 
-- Found PythonInterp: /usr/bin/python (found version "2.7.3") 
-- Found PY_em: /usr/lib/python2.7/site-packages/em.pyc  
-- Found gtest: gtests will be built
-- Using CATKIN_TEST_RESULTS_DIR: /builddir/build/BUILD/gencpp-0.4.12/build/test_results
-- catkin 0.5.64
CMake Error at /usr/share/catkin/cmake/catkinConfig.cmake:72 (find_package ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2013-03-17 18:42:12 -0500

William gravatar image

updated 2013-03-18 07:37:52 -0500

I think you need to add the installation prefix of genmsg to your CMAKE_PREFIX_PATH. In your case I think this might be:

-DCMAKE_PREFIX_PATH=/builddir/build/BUILDROOT/ros-gencpp-groovy-0.4.12-1.fc18.x86_64//usr/

But without knowing more about your build environment I don't think I will be able to give you the exact solution.

Also, did you ensure that the genmsg-config.cmake was in the the path you get for genmsg_DIR?

EDIT:

You should look for genmsg-config.cmake OR genmsgConfig.cmake

edit flag offensive delete link more

Comments

I've updated the question with more information, on the build system, and attempts with the -DCMAKE_PREFIX_PATH. The genmsg package did not generate a genmsg-config.cmake file though.

FranciscoD gravatar image FranciscoD  ( 2013-03-18 00:31:13 -0500 )edit

It should generate a genmsgConfig.cmake file, I was thinking it was the other one, but in fact its the first.

William gravatar image William  ( 2013-03-18 07:38:33 -0500 )edit

The file is available at: /usr/share/genmsg/cmake/genmsgConfig.cmake. For the buildroot, it would become /builddir/build/BUILDROOT/ros-gencpp-groovy-0.4.12-1.fc18.x86_64//usr/share/genmsg/cmake/genmsgConfig.cmake. Maybe I need to place the cmake file in another location, where cmake can find it.

FranciscoD gravatar image FranciscoD  ( 2013-03-18 13:14:48 -0500 )edit

CMake finds config files in various locations http://cmake.org/cmake/help/v2.8.8/cmake.html#command:find_package

catkin uses PREFIX/share/genmsg/cmake/genmsgConfig.cmake. Make sure PREFIX is part of the CMAKE_PREFIX_PATH and the file exists. Also remove previous CMakeCache.txt files.

Dirk Thomas gravatar image Dirk Thomas  ( 2013-06-22 19:43:55 -0500 )edit
0

answered 2013-06-20 04:11:25 -0500

focs gravatar image

updated 2013-06-20 21:30:48 -0500

I have the same problem building it from gentoo. Well, atcually I do have the .cmake file in the indicated folder but still cmake doesn't find it. Did you manage do solve it?

Also with genpy.

Edit:

$ ls /usr/local/share/genmsg/cmake/ -l total 44
-rw-r--r-- 1 root root  6126 Jun 20 17:42 genmsgConfig.cmake
-rw-r--r-- 1 root root   427 Jun 20 17:42 genmsgConfig-version.cmake
-rw-r--r-- 1 root root 10757 Jun 20 17:46 genmsg-extras.cmake
-rw-r--r-- 1 root root  4219 Jun 19 19:53 pkg-genmsg.cmake.em
-rw-r--r-- 1 root root   364 Jun 19 19:53 pkg-genmsg.context.in
-rw-r--r-- 1 root root   104 Jun 19 19:53 pkg-msg-extras.cmake.in
-rw-r--r-- 1 root root   118 Jun 19 19:53 pkg-msg-paths.cmake.in

We can see that the file is there, or at least a file with the indicated name.

cmake -DCMAKE_PREFIX_PATH=/usr/local/share/genmsg/cmake/ ..
-- Using CATKIN_DEVEL_PREFIX: /home/fox/Downloads/gencpp/build/devel
-- Using CMAKE_PREFIX_PATH: /usr/local/share/genmsg/cmake/
-- Found gtest: gtests will be built
-- Using CATKIN_TEST_RESULTS_DIR: /home/fox/Downloads/gencpp/build/test_results
-- catkin 0.5.67
CMake Error at /usr/local/share/catkin/cmake/catkinConfig.cmake:72 (find_package):
  Could not find a package configuration file provided by "genmsg" with any
  of the following names:

    genmsgConfig.cmake
    genmsg-config.cmake

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


-- Configuring incomplete, errors occurred!

But still it does not work. I tried too with the path to genmsg:

$ cmake -DCMAKE_PREFIX_PATH=/usr/local/share/genmsg/ ..
-- Using CATKIN_DEVEL_PREFIX: /home/fox/Downloads/gencpp/build/devel
-- Using CMAKE_PREFIX_PATH: /usr/local/share/genmsg/
-- Found gtest: gtests will be built
-- Using CATKIN_TEST_RESULTS_DIR: /home/fox/Downloads/gencpp/build/test_results
-- catkin 0.5.67
CMake Error at /usr/local/share/catkin/cmake/catkinConfig.cmake:72 (find_package):
  Could not find a package configuration file provided by "genmsg" with any
  of the following names:

    genmsgConfig.cmake
    genmsg-config.cmake

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


-- Configuring incomplete, errors occurred!

But I managed to compile the system without this. Now some packages are crashing while running rosmake -a.

[ rosmake ] All 21 linesobot_pose_ekf: 0.5 sec ]... [ 4 Active 35/109 Complete ]
{-------------------------------------------------------------------------------
  mkdir -p bin
  cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=/opt/ros/groovy/share/ros/core/rosbuild/rostoolchain.cmake  ..
  [rosbuild] Building package robot_pose_ekf
  Failed to invoke /opt/ros/groovy/bin/rospack deps-manifests robot_pose_ekf
  [rospack] Error: package/stack 'robot_pose_ekf' depends on non-existent package 'bfl' and rosdep claims that it is not a system dependency. Check the ROS_PACKAGE_PATH or try calling 'rosdep update'


  CMake Error at /opt/ros/groovy/share/ros/core/rosbuild/public.cmake ...
(more)
edit flag offensive delete link more

Comments

Double check your CMAKE_PREFIX_PATH, if the file exists and it isn't being found then it isn't on the CPP.

William gravatar image William  ( 2013-06-20 08:17:45 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2013-03-16 21:01:20 -0500

Seen: 1,924 times

Last updated: Jun 22 '13