阅读量:0
一、安装ceres
1. 下载依赖
sudo apt-get install liblapack-dev libsuitesparse-dev libcxsparse3 libgflags-dev libgoogle-glog-dev libgtest-dev
2.下载
git clone https://mirror.ghproxy.com/https://github.com/ceres-solver/ceres-solver.git (镜像加速) 或 git clone http://gitee.com/liwuhaoooo/ceres-solver.git (gitee倒仓)
3.编译并安装
mkdir build cd build cmake .. make sudo make install
4. 报错及解决方案
4.1 cmake .. 报错
CMake Error at CMakeLists.txt:60 (add_subdirectory): The source directory /home/zwkj/ceres-solver/third_party/abseil-cpp does not contain a CMakeLists.txt file. -- Performing Test HAVE_BIGOBJ -- Performing Test HAVE_BIGOBJ - Failed
解决方案:进入third_party文件夹执行
git clone https://github.com/abseil/abseil-cpp.git git clone https://github.com/google/googletest.git
再重新编译
4.2.make报错
(1)
home/zwkj/ceres-solver/internal/ceres/suitesparse.cc:187:7: error: ‘VLOG_IS_ON’ was not declared in this scope; did you mean ‘VLOG_FIRST_N’? 187 | if (VLOG_IS_ON(2)) { | ^~~~~~~~~~ | VLOG_FIRST_N
解决方案:找到相应的.cc文件,加入头文件
#include <glog/logging.h>
(2)
undefined reference to `google::kLogSiteUninitialized
解决方案:参考方法或注释所有与glog/logging.h相关的代码
二、安装PCL
sudo apt install libpcl-dev
三、安装ALOAM
1报错及解决
报错
CMake Error at A-LOAM/CMakeLists.txt:25 (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. Reason given by package: The following imported targets are referenced, but are missing: absl::log absl::check absl::fixed_array
解决
cmakelists 加入
set(ABSEIL_DIR "/home/zwkj/aloam/ceres-solver/third_party/abseil" CACHE PATH "Path to Abseil libraries") find_package(absl REQUIRED HINTS ${ABSEIL_DIR})