0
$\begingroup$

Rosanswers logo

I am trying to compile a ros node that uses the eigen library. I am working on Indigo, but I assume that the node was programmed in another version of ROS, since the original programmer does not have this problem.

I get this error:

By not providing "Findeigen.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "eigen", but
  CMake did not find one.

  Could not find a package configuration file provided by "eigen" with any of
  the following names:

    eigenConfig.cmake
    eigen-config.cmake

  Add the installation prefix of "eigen" to CMAKE_PREFIX_PATH or set
  "eigen_DIR" to a directory containing one of the above files.  If "eigen"
  provides a separate development package or SDK, be sure it has been
  installed.

The eigen library works on my C++ projects, so I know that it is correctly installed. I just can't get it to work with ROS. I looked around to find a solution and I added:

find_package(cmake_modules REQUIRED)
find_package(eigen REQUIRED)
include_directories(${Eigen_INCLUDE_DIRS})

to the CMakeLists.txt, and

<build_depend>cmake_modules</build_depend>
<run_depend>cmake_modules</run_depend>

to the package.xml. However, it didn't solve the problem. Does anybody have the same problem with eigen? What should I do?


Originally posted by Valerio on ROS Answers with karma: 13 on 2015-07-16

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I guess you have almost everything correct. But in find_package(Eigen REQUIRED), Eigen should start with a capital letter. See the Usage document on cmake_modules


Originally posted by mgruhler with karma: 12390 on 2015-07-16

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by mgruhler on 2015-07-16:
oh, and the run_depend for cmake_modules is not required.

Comment by soheilred on 2015-08-11:
I have the same problem. I did all the steps that you have mentioned. but when I compile my code I get this: /usr/include/eigen3/Eigen/src/Cholesky/LDLT.h:52:40: error: ‘RowMajorBit’ was not declared in this scope Options = MatrixType::Options & ~RowMajorBit,

this is not the whole error

Comment by mgruhler on 2015-08-12:
Well, please make a new question with the full error output. Also, include the CMakeLists.txt, the package.xml and, if possible, a minimal example with the error. Or the full source code, if possible (preferably in a link to a repo or a GIST).

$\endgroup$

Your Answer

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