Open akshay-raj-dhamija opened 7 years ago
Try reverting this change and see if the warning is actually useful for you: https://github.com/caffe2/caffe2/pull/729
I tried to change find_package(Eigen3 QUIET)
in cmake to find_package(Eigen3)
but the error is the same.
Well that's good - at least my change didn't make anything worse!
I'd try uninstalling whatever version of Eigen you have and falling back to the version that ships with caffe2 under third_party/
.
I found the error was caused in commit 63d4a406be041e04ade70e41f59a66fca197b8b2, specifically in line 203 where EIGEN3_INCLUDE_DIRS
was used, where as cmake uses EIGEN3_INCLUDE_DIR
What Linux distribution are you using here? Eigen3 sets both variables, so something else must be responsible for detecting your Eigen version on your system.
I'm using Gentoo Linux with Eigen3 3.3.3, and it looks like I'm running into this issue as well. Looking at the CMake output, my system Eigen is being detected, but here are the relevant lines from the output:
-- Found Eigen3: /usr/include/eigen3 (Required is at least version "2.91.0")
-- Found system Eigen at
For some reason EIGEN3_INCLUDE_DIRS
is not set. I'm trying to track down why, since this variable should be set by Eigen3Config.cmake
.
I'm attaching the cmake --trace ../
output from the build
directory: cmake.log
The major finding here is that Eigen3's Config.cmake doesn't seem to be picked up. This may be a problem with Eigen3 (I remember seeing a Debian patch for this when looking through Ubuntu's files to see what differs between Gentoo and Ubuntu).
Alright, I think I tracked down what's going on. I upgraded my Eigen3 installation to 3.3.4 just in case.
Based on what I can, FindEigen3.cmake
sets the version number to 2.91.0
at first. Later, it invokes find_package(Eigen3 2.91.0 NO_MODULE QUIET )
which jumps to Eigen3ConfigVersion.cmake
. There, PACKAGE_VERSION_COMPATIBLE
is set to false:
/usr/share/eigen3/cmake/Eigen3ConfigVersion.cmake(12): set(PACKAGE_VERSION 3.3.4 )
/usr/share/eigen3/cmake/Eigen3ConfigVersion.cmake(14): if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION )
/usr/share/eigen3/cmake/Eigen3ConfigVersion.cmake(16): else()
/usr/share/eigen3/cmake/Eigen3ConfigVersion.cmake(18): if(3.3.4 MATCHES ^([0-9]+)\. )
/usr/share/eigen3/cmake/Eigen3ConfigVersion.cmake(19): set(CVF_VERSION_MAJOR 3 )
/usr/share/eigen3/cmake/Eigen3ConfigVersion.cmake(24): if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR )
/usr/share/eigen3/cmake/Eigen3ConfigVersion.cmake(26): else()
/usr/share/eigen3/cmake/Eigen3ConfigVersion.cmake(27): set(PACKAGE_VERSION_COMPATIBLE FALSE )
Now, I guess that because PACKAGE_VERSION_COMPATIBLE is false, cmake refuses to process Eigen3Config.cmake
. In fact, hacking that check above to return true, causes Eigen3Config.cmake
to be processed and the DIRS variable is set properly.
One way to fix this is to have caffe explicitly demand for an Eigen3 version that's compatible, well, with Eigen3 (I'm guessing that's 3.0.0+), instead of relying on the default check of 2.91.0.
Changing the find_package
call in cmake/Dependencies.cmake
for Eigen3 to find_package(Eigen3 3.0.0)
makes this work on my system.
@gemarcano Which package installed FindEigen3.cmake for you? I tried repro'ing but see that Eigen 3 provided its own FindEigen3.cmake which was up to date with its version. If your FindEigen3.cmake expands the version to 2.9.1 then I suppose it's pretty old and not provided by the Eigen package itself.
@gemarcano I had the same issue (installed earlier Eigen in system) and confirm that "Changing the find_package call in cmake/Dependencies.cmake for Eigen3 to find_package(Eigen3 3.0.0) makes this work on my system." helps
Hello,
I get the following error while trying to make from the commit acee64a9f95612e69d0a615c09e0676ac076849d. I get the same error in various earlier commits whereas the commit 0a3c8413fc26cffa255d34ba7f4830e6c9724854 is working fine. Eigen is already installed.
Below is the complete make output