CMake-ing 项目与谷神星求解器时的特征依赖关系冲突
Conflicting Eigen dependencies when CMake-ing project with Ceres solver
我安装了ceres-solver
brew install ceres-solver
在 macOS 上。
我为使用 Ceres 的客户端项目创建了一个CMake.txt
。
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
我收到以下错误
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!
如何删除特征的冲突版本?我不记得我过去是如何安装它的。我也尝试运行brew uninstall Eigen
,但这并没有使错误消失。
感谢您的任何帮助。
所以谷神星是用 Eigen 3.3.7 构建的,但你的 helloworld 构建是找到 Eigen 3.3.90。我发现跟踪此类 cmake 问题的最佳方法是在运行 cmake 配置步骤时使用--trace-expand
和--debug-output
选项。它生成大量输出,因此请将其全部重定向到一个文件,然后搜索find_package特征语句。例如
cmake . -Bbuild --debug-output --trace-expand > cmake.out 2>&1
相关文章:
- 如何从C++中的依赖类型中获得它所依赖的类型
- 如何声明特征矩阵,然后通过嵌套循环初始化它
- 特征::矩阵<双精度,1,3> 结构类型函数中的返回类型函数
- 将--whole archive链接器选项与CMake和具有其他库依赖项的库一起使用
- 将依赖名称显式标记为类型名和模板的奇怪之处
- 有没有一种方法可以通过"typedef"为重新定义的基本类型定义特征和强制转换运算符
- 在 Windows 上,是否可以让 dll 在不使用 PATH 环境变量的情况下在另一个文件夹中查找依赖项?
- 特征命名访问向量段
- 将特征矩阵的向量设置为0
- C++GTKMM gui循环依赖关系
- 通过ccmake在cmake中缓存依赖选项
- 特征:模板函数中矩阵的平面图
- basic_string的前导/尾部不区分空格的特征
- 当基类是依赖类型时,这是一个缺陷吗
- 特征 3 类的模板专用化
- 特征 c++:复矩阵的面积双曲正切(atanh)
- C++ 中的特征向量计算
- 从不同的附加依赖项中识别等同命名的函数
- 如何在 CMake 中对目标依赖项进行分组?
- CMake-ing 项目与谷神星求解器时的特征依赖关系冲突