c++ - 匹配 Eigen 和 Ceres-Solver 版本的最简单方法是什么?

标签 c++ homebrew eigen ceres-solver

我使用 brew 安装了 Eigen 和 Ceres-Solver 作为现有项目的先决条件。

当我为项目运行 make 时,我收到以下消息

Found Eigen dependency, but the version of Eigen found (3.3.1) does not exactly match the version of Eigen Ceres was compiled with (3.3.0). 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

我的第一个想法是使用来自 brew 的 Eigen 从源代码编译 Ceres-solver,但这在 make 期间产生了其他错误消息。

具体来说,它会累积到 54%,然后打印

[ 54%] Linking C executable ../bin/curve_fitting_c
Undefined symbols for architecture x86_64:
  "___kmpc_atomic_fixed4_sub", referenced from:
      __ZN5Eigen8internal29general_matrix_matrix_productIldLi1ELb0EdLi1ELb0ELi0EE3runElllPKdlS4_lPdldRNS0_15level3_blockingIddEEPNS0_16GemmParallelInfoIlEE in libceres.a(gradient_checker.cc.o)
      __ZN5Eigen8internal29general_matrix_matrix_productIldLi1ELb0EdLi0ELb0ELi0EE3runElllPKdlS4_lPdldRNS0_15level3_blockingIddEEPNS0_16GemmParallelInfoIlEE in libceres.a(dogleg_strategy.cc.o)

__ZN5ceres8internal11EventLoggerC2ERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE in libceres.a(wall_time.cc.o)
  __ZN5ceres8internal11EventLoggerC1ERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE in libceres.a(wall_time.cc.o)
  __ZN5ceres8internal11EventLoggerD2Ev in libceres.a(wall_time.cc.o)

...跳过一些行...

    __ZN5ceres8internal11EventLogger8AddEventERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE in libceres.a(wall_time.cc.o)
ld: symbol(s) not found for architecture x86_64
clang-3.5: error: linker command failed with exit code 1 (use -v to see invocation)

ceres installation page推荐 Eigen 3.2.2 或更高版本,所以 3.3.1 应该没问题,除非 3.2 和 3.3 之间有一些结构上的变化。

我的问题:

下一步我应该尝试什么?安装旧版本的 Eigen?

最佳答案

我正在尝试使用 the instructions on the ceres website 从源代码构建 ceres .我仍然不确定为什么会失败,但是使用 brew(我以前不知道存在的选项)从源代码构建是可行的。

brew install --build-from-source ceres-solver

它使用通过 brew (Eigen 3.3.1) 安装的 Eigen 依赖项,并且不会产生任何错误消息。

关于c++ - 匹配 Eigen 和 Ceres-Solver 版本的最简单方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41727736/

相关文章:

python - 使用 gdb pretty-print 在 eclipse cdt 中显示智能指针

c++ - C++ 中的最大特征值(和相应的特征向量)

c++ - 使用队列的 Phantom Bug(STL 库),Windows/MingW/G++

homebrew - brew install nginx 链接失败

c++ - Eigen ,错误地使用了不同类型的逗号初始化程序

c++ - 删除函数的 std::map

macos - macOS 上的 wget 如何处理证书?

使用brew安装的docker在/var/run/docker.sock上失败

c++ - Eigen 错误 : please_protect_your_min_with_parentheses

c++ - Eigen 矩阵和 vector 之上的抽象类