0

In the cluster of my uni I do not have sudo rights, and I need the version Eigen3 3.3.3 and they only offer Eigen 2.8 installed.

Now, I uploaded the source files of Eigen3 3.3.3 and tried to manually hook it up with cmake.

Then I set the environmental variable CPLUS_INCLUDE_PATH accordingly. In cmake I have set the requirements as:

find_package(Eigen3 3.3.3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})

But I get this error message:

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" (requested version 3.3.3) with any of the following names:


I don't understand why I have to manually provide a FindEigen3.cmake file? Usually, one has not to do it. How to solve this error? I do not want to manipulate the existing CMakeList.txt. Thanks.

Armen Avetisyan
  • 1,140
  • 10
  • 29
  • The library brings its own CMake configuration script. The CMake needs a hint where your `Eigen3` library is to configure it correctly (see [`cmake/FindEigen3.cmake`](https://github.com/OPM/eigen3/blob/master/cmake/FindEigen3.cmake)). – Florian Mar 27 '17 at 10:44
  • Possible duplicate of [Unable to find Eigen3 with CMake](http://stackoverflow.com/questions/34138879/unable-to-find-eigen3-with-cmake) – Florian Mar 27 '17 at 10:47
  • @Florian I have seen it already. But I can't imagine to take care of it with `CMAKE_MODULE_PATH` by myself. Especially, I do not want to manipulate an existing `CMakeFiles.txt` to conform eigen3. – Armen Avetisyan Mar 27 '17 at 10:51
  • 1
    `cmake -DCMAKE_MODULE_PATH:PATH=/path/to/Eigen3/cmake ..` – Florian Mar 27 '17 at 10:53
  • @Florian alright, thanks a lot. – Armen Avetisyan Mar 27 '17 at 10:54
  • You are welcome. Added an answer accordingly. – Florian Mar 27 '17 at 10:59

1 Answers1

0

Turning my comments into an answer

The library brings its own CMake configuration script. The CMake needs a hint where your Eigen3 library is to configure it correctly (see cmake/FindEigen3.cmake).

So you can define the search path in your command line call:

cmake -DCMAKE_MODULE_PATH:PATH=/path/to/Eigen3/cmake ..

References

Florian
  • 39,996
  • 9
  • 133
  • 149