Found Eigen dependency, but the version of Eigen……编译出现问题

在编译cartographer的时候出现了如下问题:

CMake Error at /usr/local/lib/cmake/Ceres/CeresConfig.cmake:93 (message):
  Failed to find Ceres - Found Eigen dependency, but the version of Eigen
  found (3.2.9) does not exactly match the version of Eigen Ceres was
  compiled with happy().  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:43 (find_package)


-- Configuring incomplete, errors occurred!

搜索问题后发现解决办法
解决方法
按照方法在文件头部添加如下代码后无效。

set(CERES_EIGEN_VERSION 3.2.9)
set(EIGEN_INCLUDE_DIRS "/usr/local/include/eigen3") 

分析代码发现,在提到的编译错误中 (3.2.9)和()空括号里应该分别是编译文件搜索到的Eigen版本号和CERES_EIGEN_VERSION 设置的版本号,但在编译中发现CERES_EIGEN_VERSION 并没有打印出来设置的内容,因此推断set没有产生效果,反复测试后发现,上述set语句应放在参数使用区域附近,至于具体原因,在下没咋看过cmake原理…不太知道,希望了解的大哥可以告知!!!

set(CERES_EIGEN_VERSION 3.2.9)
set(EIGEN_INCLUDE_DIRS "/usr/local/include/eigen3")  

if (EIGEN_FOUND)
  if (NOT EIGEN_VERSION VERSION_EQUAL CERES_EIGEN_VERSION)
    # CMake's VERSION check in FIND_PACKAGE() will accept any version >= the
    # specified version. However, only version = is supported. Improve
    # usability by explaining why we don't accept non-exact version matching.
    ceres_report_not_found("Found Eigen dependency, but the version of Eigen "
      "found (${EIGEN_VERSION}) does not exactly match the version of Eigen "
      "Ceres was compiled with (${CERES_EIGEN_VERSION}). 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"
	)
  endif ()

错误记录

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值