☰
ceres-solver安装
2026/10/18 16:51:14 网站建设 项目流程

在编译 fast-lio-slam框架时,总会报错,

CMake Error at FAST_LIO_SLAM/SC-PGO/CMakeLists.txt:25 (find_package): By not providing "FindCeres.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Ceres", but CMake did not find one. Could not find a package configuration file provided by "Ceres" with any of the following names: CeresConfig.cmake ceres-config.cmake Add the installation prefix of "Ceres" to CMAKE_PREFIX_PATH or set "Ceres_DIR" to a directory containing one of the above files. If "Ceres" provides a separate development package or SDK, be sure it has been installed.

使用的apt方式进行的安装

sudo apt install libceres1 sudo apt install libceres1=1.14.0-4ubuntu1
sudo apt remove libceres-dev

使用apt安装时 查看动态库:也有相应的库

find /usr -name "libceres.so*" 2>/dev/null /usr/lib/libceres.so.1.14.0 /usr/lib/libceres.so.1

但是一到fastlio_slam工作目录下cmake时就会报错,为此:

先卸载,再用源码安装,下述三个都要运行,因为我安装了这三个

sudo apt remove libceres-dev sudo apt remove libceres sudo apt remove libceres1

源码安装步骤:

在software文件夹下新建cere文件夹(好管理),再此文件夹下打开终端,按照如下进行安装即可

# 下载源码 wget http://ceres-solver.org/ceres-solver-1.14.0.tar.gz tar xvf ceres-solver-1.14.0.tar.gz cd ceres-solver-1.14.0 # 编译安装 mkdir build && cd build cmake .. make -j4 sudo make install

用 dpkg -s libceres-dev | grep Version 查找不到时不要紧,

因为dpkg -s libceres-dev找不到版本是正常的,因为你并没有通过apt安装libceres-dev这个软件包。

dpkg是 Debian/Ubuntu 的包管理工具,它只能查询通过apt或dpkg命令安装的软件包信息。从源码编译安装的软件,其文件被直接复制到系统目录(如/usr/local),但不会在dpkg的数据库中留下任何安装记录。

因此,你不需要使用dpkg,下面的方法可以准确地查看你通过源码编译安装的 Ceres 版本。

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询