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

How to Add the installation prefix of "Eigen3" to CMAKE_PREFIX_PATH or set "Eigen3_DIR" to a directory containing one of the above files

asked 2015-08-02 13:23:22 -0500

lamiastella gravatar image

When I entered this command:

cd /Users/mona/ros_catkin_ws/build_isolated/pcl_ros && /Users/mona/ros_catkin_ws/install_isolated/ cmake /Users/mona/ros_catkin_ws/src/perception_pcl/pcl_ros -DCATKIN_DEVEL_PREFIX=/Users/mona/ros_catkin_ws/devel_isolated/pcl_ros -DCMAKE_INSTALL_PREFIX=/Users/mona/ros_catkin_ws/install_isolated -DCMAKE_BUILD_TYPE=Release -G 'Unix Makefiles'

I get the following error:

-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   thread
CMake Error at CMakeLists.txt:7 (find_package):
  By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Eigen3", but
  CMake did not find one.

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


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

-- Configuring incomplete, errors occurred!
See also "/Users/mona/ros_catkin_ws/build_isolated/pcl_ros/CMakeFiles/CMakeOutput.log".

I tried to follow the guide for installing the eigen but apparently it was unsuccessful. I have these in /usr/local/eigen :

Monas-MacBook-Pro:~ mona$ cd /usr/local/eigen
Monas-MacBook-Pro:eigen mona$ ls
CMakeLists.txt              build_dir
COPYING.BSD             cmake
COPYING.GPL             debug
COPYING.LGPL                demos
COPYING.MINPACK             doc
COPYING.README              failtest
CTestConfig.cmake           lapack            scripts
Eigen                   signature_of_eigen3_matrix_library
INSTALL                 test
bench                   unsupported

And I have followed these steps in INSTALL file:

cd build_dir
cmake source_dir
make install

However when I enter eigen it is not recognized.

I need to get this fixed for this step of installing ROS on OSX:

./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release

I am not an OSX guru, so if you are want to help me, it is best suggested to tell me how to set paths or where the files you want me to modify are located.

** I used destination path for eigen3:

cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/eigen3
make install

and now I have these items after make install :

Monas-MacBook-Pro:build_dir mona$ ls /usr/local/eigen3/include/eigen3/
Eigen                   unsupported
Monas-MacBook-Pro:build_dir mona$ ls /usr/local/eigen3/include/eigen3/Eigen/
Array           Householder     QR          StdDeque
Cholesky        IterativeLinearSolvers  QtAlignedMalloc     StdList
CholmodSupport      Jacobi          SPQRSupport     StdVector
Core            LU          SVD         SuperLUSupport
Dense           LeastSquares        Sparse          UmfPackSupport
Eigen           MetisSupport        SparseCholesky      src
Eigen2Support       OrderingMethods     SparseCore
Eigenvalues     PaStiXSupport       SparseLU
Geometry        PardisoSupport      SparseQR

Yet I don't know where is the executable for eigen3 and how to set path for cmake.

Thanks a bunch, Mona Jalal

edit retag flag offensive close merge delete


Hi! I am having the exact same issue as you. Did you ever solve it?

Tormod Haugene gravatar image Tormod Haugene  ( 2016-02-28 14:57:44 -0500 )edit

have you been able to solve it? I stil have the same issue

Kailegh gravatar image Kailegh  ( 2016-04-18 10:09:59 -0500 )edit

I have not been able to instal ROS on OSX yet. It seems the OSX version is having some issues at the moment, unfortunately.

Tormod Haugene gravatar image Tormod Haugene  ( 2016-07-21 03:40:21 -0500 )edit

4 Answers

Sort by » oldest newest most voted

answered 2015-08-02 16:06:12 -0500

William gravatar image

We (the ROS community) provide a CMake module for Eigen, but it is provided under the name Eigen but it is deprecated in Jade:

But the package you're compiling is not using that deprecated module and is failing because it is looking for the Eigen provided Eigen3 CMake module. So the problem is likely that the version of Eigen you installed on your machine does not have this Eigen3 CMake module. Older versions of Eigen did not ship it. If you installed Eigen with Homebrew then it might be a packaging problem with Eigen in Homebrew. The Jade migration guide has a suggest way that packages should find Eigen to avoid disruption in the mean time:

It seems the package you're trying to compile (pcl_ros?) is not doing this or is doing it incorrectly. If it were following the suggestion then it would have "fallen" back on the FindEigen.cmake cmake module provided by the cmake_modules ROS package.

It could be that something else is going on that's causing the issue, but that's my take on it.

edit flag offensive delete link more

answered 2017-09-27 02:28:53 -0500

Jacob Lambert gravatar image

I had this error because I had a newer version of cmake installed. libeigen3-dev had installed FindEigen3.cmake in usr/share/cmake-2.8/Modules (the default Ubuntu 14.04 cmake) but not the other cmake versions. Since catkin_make defaults to latest cmake, it can't find the module. In my case, simply copying FindEigen3.cmake into usr/share/cmake-3.2/Modules fixed the issue.

edit flag offensive delete link more



Or you can create symbolic link to the file using ln -s command.

l4ncelot gravatar image l4ncelot  ( 2017-11-01 03:45:03 -0500 )edit

i got the same error after i upgrade my cmake from 2. to 3. . But there is no such a file called FindEigen3.cmake in my PC, what the reason behind it? Thanks for your answering.

Stanley HU gravatar image Stanley HU  ( 2018-09-19 00:13:42 -0500 )edit

@Stanley HU try dpkg -l | grep -i eigen3 to find out whether you have eigen3 library installed.

l4ncelot gravatar image l4ncelot  ( 2018-09-19 00:44:28 -0500 )edit

<ii libeigen3-dev="" 3.2.0-8="" all="" lightweight="" c++="" template="" library="" for="" linear="" algebra=""> This seems i already have eigen3 library installed? but i still don't have FindEigen3.cmake file

Stanley HU gravatar image Stanley HU  ( 2018-09-19 01:25:26 -0500 )edit

Have you looked in /usr/share/cmake-VERSION/Modules?

l4ncelot gravatar image l4ncelot  ( 2018-09-19 01:27:31 -0500 )edit

even there is no cmake folder under /share, anyway i search it in whole pc but i still cannot find it

Stanley HU gravatar image Stanley HU  ( 2018-09-19 03:11:36 -0500 )edit

@Stanley HU how did you install the eigen3 library? Can you reinstall it?

l4ncelot gravatar image l4ncelot  ( 2018-09-19 03:29:29 -0500 )edit

sorry, i found it, problem is solved,Thanks very much

Stanley HU gravatar image Stanley HU  ( 2018-09-19 08:33:27 -0500 )edit

answered 2017-10-31 15:28:11 -0500

clyde gravatar image

I ran into this problem on Raspbian Jessie. There's a good discussion here: This worked for me: "sudo cp /usr/share/cmake-2.8/Modules/FindEigen3.cmake /usr/share/cmake-3.6/Modules/"

edit flag offensive delete link more


Hi, I am also building the ros_catkin_ws on Raspbian Jessie and encounter the same issue. Can you have a look at mine :

bdgitr gravatar image bdgitr  ( 2021-03-19 09:06:40 -0500 )edit

answered 2017-04-14 10:34:03 -0500

CimeROS gravatar image

When I had this error, i made shure that i had eigen3 installed with:

sudo apt-get install libeigen3-dev

When i still had problems and after loosing 2 hours searching for a solution online i went into CMakeLists.txt and changed every word "Eigen3" to "Eigen". After that it compiled normally.

edit flag offensive delete link more


I tried changing the Eigen3 to Eigen, but still got the same error.

wintermute gravatar image wintermute  ( 2017-05-08 15:36:29 -0500 )edit

Question Tools



Asked: 2015-08-02 13:16:56 -0500

Seen: 22,793 times

Last updated: Oct 31 '17