1

I installed ceres-solver using

brew install ceres-solver

on macOS.

I created a CMake.txt for a client project that uses Ceres.

cmake_minimum_required(VERSION 2.8)

project(helloworld)

find_package(Ceres REQUIRED)
include_directories(${CERES_INCLUDE_DIRS})

# helloworld
add_executable(helloworld helloworld.cpp)
target_link_libraries(helloworld ${CERES_LIBRARIES})

However, when I run the following command

cmake . -Bbuild

I get the following error

CMake Error at /usr/local/lib/cmake/Ceres/CeresConfig.cmake:88 (message):
  Failed to find Ceres - Found Eigen dependency, but the version of Eigen
  found (3.3.90) does not exactly match the version of Eigen Ceres was
  compiled with (3.3.7).  This can cause subtle bugs by triggering violations
  of the One Definition Rule.  See the Wikipedia article
  http://en.wikipedia.org/wiki/One_Definition_Rule for more details
Call Stack (most recent call first):
  /usr/local/lib/cmake/Ceres/CeresConfig.cmake:223 (ceres_report_not_found)
  CMakeLists.txt:5 (find_package)


CMake Error at CMakeLists.txt:5 (find_package):
  Found package configuration file:

    /usr/local/lib/cmake/Ceres/CeresConfig.cmake

  but it set Ceres_FOUND to FALSE so package "Ceres" is considered to be NOT
  FOUND.


-- Configuring incomplete, errors occurred!

How do I remove the conflicting version of Eigen? I don't remember how I installed it in the past. I tried running brew uninstall Eigen as well, but that didn't make the error go away.

Thanks for any help.

Carpetfizz
  • 8,707
  • 22
  • 85
  • 146

1 Answers1

1

So Ceres was built with Eigen 3.3.7 but your helloworld build is finding Eigen 3.3.90. The best way I have found to track down cmake problems like this is to use the --trace-expand and --debug-output options when running the cmake configure step. It generates a lot of output so redirect it all to a file and then search for the find_package eigen statement. For example

cmake . -Bbuild --debug-output --trace-expand > cmake.out 2>&1
Phil
  • 5,822
  • 2
  • 31
  • 60