首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Ceres求解器生成项目时的特征依赖冲突

使用Ceres求解器生成项目时的特征依赖冲突
EN

Stack Overflow用户
提问于 2019-10-22 00:16:00
回答 1查看 736关注 0票数 1

我使用以下命令安装了ceres-solver

brew install ceres-solver

在macOS上。

我为一个使用Ceres的客户端项目创建了一个CMake.txt

代码语言:javascript
复制
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})

但是,当我运行以下命令时

cmake . -Bbuild

我得到以下错误

代码语言:javascript
复制
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!

如何删除冲突版本的Eigen?我不记得我以前是怎么安装它的。我也尝试过运行brew uninstall Eigen,但这并没有使错误消失。

谢谢你的帮助。

EN

回答 1

Stack Overflow用户

发布于 2019-10-22 02:38:04

所以Ceres是用Eigen 3.3.7构建的,但是你的helloworld构建找到了Eigen 3.3.90。我找到的跟踪此类cmake问题的最好方法是在运行cmake配置步骤时使用--trace-expand--debug-output选项。它会生成大量输出,因此将所有输出重定向到一个文件,然后搜索find_package特征语句。例如

代码语言:javascript
复制
cmake . -Bbuild --debug-output --trace-expand > cmake.out 2>&1
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58490283

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档