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

fatal error Eigen/core: No such file or directory

asked 2012-11-07 01:42:53 -0500

boFFeL gravatar image

updated 2012-11-07 14:03:56 -0500

Eric Perko gravatar image

Hi everybody,

i'm trying to use eigen with ros electric. I don't know if I'm missing some aspects or just misunderstand the whole thing. I installed eigen via

sudo apt-get install ros-electric-eigen

As mentioned in the eigen Wiki for electric Installation I downloaded the FindEigen.cmake and moved it in the cmake directory of my package.

In the CMakeList.txt I appended

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(Eigen REQUIRED)
include_directories(${EIGEN_INCLUDE_DIRS})

Furthermore I edited the manifest.xml and included

<depend package="common_rosdeps" />
<rosdep name="eigen" />

But now I don't know how to include it within my cpp file. I've had look at the laser_geometry package, where the FindEigen.cmake comes from, but if I do it like this

#include <ros/ros.h>
#include <Eigen/Core>
...

i get an error making my package:

fatal error Eigen/Core: No such file or directory

What do i have to include within my cpp file or am I doing something else quite wrong? Most information I've found does not cover my problem or is referring to Fuerte installs.

thanking you in anticipation

Ah, ok sorry. Just referred to the errors. Here the rosmake output:

[ rosmake ] No package specified.  Building ['testEigen']                                                         
[ rosmake ] Packages requested are: ['testEigen']                                                                 
[ rosmake ] Logging to directory/home/namco/.ros/rosmake/rosmake_output-20121107-163504                           
[ rosmake ] Expanded args ['testEigen'] to:
['testEigen']                                                         
[ rosmake ] Checking rosdeps compliance for packages testEigen.  This may take a few seconds.                     
[ rosmake ] rosdep check passed all system dependencies in packages                                                                                                                 
[rosmake-0] Starting >>> rosbuild [ make ]                                                                                                                                          
[rosmake-0] Finished <<< rosbuild ROS_NOBUILD in package rosbuild                                                                                                                   
 No Makefile in package rosbuild                                                                                                                                                    
[rosmake-1] Starting >>> cpp_common [ make ]                                                                                                                                        
[rosmake-0] Starting >>> roslang [ make ]                                                                                                                                           
[rosmake-0] Finished <<< roslang ROS_NOBUILD in package roslang                                                                                                                     
 No Makefile in package roslang                                                                                                                                                     
[rosmake-1] Finished <<< cpp_common ROS_NOBUILD in package cpp_common                                                                                                               
[rosmake-0] Starting >>> roslib [ make ]                                                                                                                                            
[rosmake-1] Starting >>> roscpp_traits [ make ]                                                                                                                                     
[rosmake-0] Finished <<< roslib ROS_NOBUILD in package roslib                                                                                                                       
[rosmake-1] Finished <<< roscpp_traits ROS_NOBUILD in package roscpp_traits                                                                                                         
[rosmake-0] Starting >>> rostime [ make ]                                                                                                                                           
[rosmake-0] Finished <<< rostime ROS_NOBUILD in package rostime                                                                                                                     
[rosmake-1] Starting >>> xmlrpcpp [ make ]                                                                                                                                          
[rosmake-0] Starting >>> roscpp_serialization [ make ]                                                                                                                              
[rosmake-0] Finished <<< roscpp_serialization ROS_NOBUILD in package roscpp_serialization                                                                                           
[rosmake-1] Finished <<< xmlrpcpp ROS_NOBUILD in package xmlrpcpp                                                                                                                   
[rosmake-0] Starting >>> rosconsole [ make ]                                                                                                                                        
[rosmake-0] Finished <<< rosconsole ROS_NOBUILD in package rosconsole                                                                                                               
[rosmake-1] Starting >>> std_msgs [ make ]                                                                                                                                          
[rosmake-1] Finished <<< std_msgs ROS_NOBUILD in package std_msgs                                                                                                                   
[rosmake-0] Starting >>> common_rosdeps [ make ]                                                                                                                                    
[rosmake-1] Starting >>> rosgraph_msgs [ make ]                                                                                                                                     
[rosmake-0] Finished <<< common_rosdeps ROS_NOBUILD in package common_rosdeps                                                                                                       
[rosmake-1] Finished <<< rosgraph_msgs ROS_NOBUILD in package rosgraph_msgs                                                                                                         
[rosmake-1] Starting >>> roscpp [ make ]                                                                                                                                            
[rosmake-1] Finished <<< roscpp ROS_NOBUILD in package roscpp                                                                                                                       
[rosmake-1] Starting >>> testEigen [ make ]                                                                                                                                         
[ rosmake ] All 37 linesestEigen: 4.0 sec ]                                                                                                              [ 1 Active 14/15 Complete ]
{-------------------------------------------------------------------------------
  mkdir -p bin
  cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=`rospack find rosbuild`/rostoolchain.cmake  ..
  [rosbuild] Building package testEigen
  [rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/roslisp/cmake/roslisp.cmake
  [rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/rospy/cmake/rospy.cmake
  [rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/cmake/roscpp.cmake
  -- Configuring done
  -- Generating done
  CMake Warning:
    Manually-specified variables were not used by the project:

      CMAKE_TOOLCHAIN_FILE


  -- Build files have been written to: /home/namco/ros/testEigen/build
  cd build && make -l2
  make[1 ...
(more)
edit retag flag offensive close merge delete

Comments

Did you get any other errors? What is the output of VERBOSE=1 make?

dornhege gravatar image dornhege  ( 2012-11-07 02:04:35 -0500 )edit

No, when i do make VERBOSE=1 it's the same. Only this error and after that compilation is terminated.

boFFeL gravatar image boFFeL  ( 2012-11-07 02:18:16 -0500 )edit

I'm sure, there is more output than just the error. Please provide the COMPLETE output.

dornhege gravatar image dornhege  ( 2012-11-07 02:41:23 -0500 )edit

eigen is not added to the include. If it is installed, check the output of the variables that FindEigen produces.

dornhege gravatar image dornhege  ( 2012-11-07 05:07:55 -0500 )edit
1

Your fix is not a real fix. You basically manually specified to look in /usr/include/eigen3/Eigen/Core. The original code was correct. The problem lies in the compile setup, which should add /usr/include/eigen3 to the include.

dornhege gravatar image dornhege  ( 2012-11-07 05:17:16 -0500 )edit

Okay, I see what you mean. FindEigen should produce EIGEN_FOUND, EIGEN_INCLUDE_DIR and EIGEN_VERSION, correct? So they should be via echo $EIGEN_FOUND available after rosmake? Or after running CMakeList.txt? I use QtCreator in which i can run them. Nevertheless there are no Variables available.

boFFeL gravatar image boFFeL  ( 2012-11-07 05:27:10 -0500 )edit

Yes, those should be produced. Either they are not produced or not used for some reason.Those are not environment variables, but CMAKE variables. You can use cmake's message function to output them.

dornhege gravatar image dornhege  ( 2012-11-07 05:59:06 -0500 )edit

If I message Variables at the end of CMakeList.txt I get TRUE for EIGEN_FOUND, /usr/include/eigen3 for EIGEN_INCLUDE_DIR and 3.0.1 for EIGEN_VERSION

boFFeL gravatar image boFFeL  ( 2012-11-07 08:48:12 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
4

answered 2012-11-08 02:10:39 -0500

Lorenz gravatar image

The problem is that you are missing the dependency on eigen in manifest.xml.

You actually do not need FindEigen.cmake. The simplest (however incompatible to fuerte) way in electric is to use the ROS package eigen. It is a very simple dummy package that only exports the correct compiler/linker flags for linking against eigen. If you want to use it, just add

<depend package="eigen" />

to your manifest file and get rid of FindEigen and all other eigen related things in your CMakeLists.txt.

If you want to make your code future proof, I suggest to use pkg-config in your CMakeLists to find eigen instead of the FindEigen thing. For instance:

find_package(PkgConfig REQUIRED)
pkg_search_module(EIGEN REQUIRED eigen3)

include_directories(${EIGEN_INCLUDE_DIRS})
link_directories(${EIGEN_LIBRARY_DIRS})
edit flag offensive delete link more

Comments

I'm not on the right computer to test it right now, but then i don't understand the eigen ROS Wiki concerning ROS electric. Anyway, also thanks for your reply...

boFFeL gravatar image boFFeL  ( 2012-11-08 10:09:21 -0500 )edit

I just provided alternative solutions that do not require to manually put FindEigen.cmake anywhere. The solution on the wiki should work, too.

Lorenz gravatar image Lorenz  ( 2012-11-08 21:26:06 -0500 )edit

For ros indigo, also add following to your package.xml

 <build_depend>laser_geometry</build_depend>
 <build_depend>eigen</build_depend>
 <run_depend>laser_geometry</run_depend>
 <run_depend>eigen</run_depend>

Include "laser_geometry" to find_package(..) in CMakeLists.txt

ShubhamVerma gravatar image ShubhamVerma  ( 2015-06-15 09:12:07 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2012-11-07 01:42:53 -0500

Seen: 8,637 times

Last updated: Nov 08 '12