一、卸载
假如ceres安装完之后VINS编译时出现了报错:
fatal error: ceres/local_parameterization.h: No such file or directory
#include “ceres/local_parameterization.h”
版本太高卸载
sudo rm -r /usr/local/lib/cmake/Ceres
sudo rm -r /usr/local/include/ceres /usr/local/lib/libceres.a
删除安装包
二、安装
ceres-solver/1.14.0
历史版本
安装依赖项:
# CMake
sudo apt-get install cmake
# google-glog + gflags
sudo apt-get install libgoogle-glog-dev libgflags-dev
# Use ATLAS for BLAS & LAPACK
sudo apt-get install libatlas-base-dev
# Eigen3
sudo apt-get install libeigen3-dev
# SuiteSparse (optional)
sudo apt-get install libsuitesparse-dev
解压
安装ceres
mkdir ceres-bin
cd ceres-bin
cmake ../ceres-solver-1.14.0/
make -j4
make test
sudo make install
为了避免每次打开新的shell都需要source,我们将其添加到bash配置文件中
sudo gedit ~/.bashrc
# 最后一行添加:
source ~/catkin_ws/devel/setup.bash
#保存,退出
source ~/.bashrc