在ubuntu18.04上安装ceres总结

ceres下载

在ubuntu18.04版本中安装2.2.0版本存在很多问题,下载2.1.0或者更早的1.14.0可以跳过很多麻烦。

法1:在官网installation的Getting the source code章节,直接点击"the latest stable release"。

法2:在ubuntu的bash中使用wge下载:[适合于下载指定的版本]

bash 复制代码
wget http://ceres-solver.org/ceres-solver-2.2.0.tar.gz
wget http://ceres-solver.org/ceres-solver-2.1.0.tar.gz
wget http://ceres-solver.org/ceres-solver-1.14.0.tar.gz

ceres安装

参考官网的安装步骤:[链接]

注意阅读官网Dependencies要求的eigen,camke,...等依赖的版本号是否兼容。

开始安装依赖

bash 复制代码
# 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

bash 复制代码
tar zxf ceres-solver-2.1.0.tar.gz
# cd到解压后的ceres-solver目录
cd ceres-solver-2.1.0
# 创建一个编译结果的存放目录,并cd进去
mkdir build
cd build
# 执行cmake, 这里设置了ceres的安装目录是/usr/local/ceres,可根据个人情况指定
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PRE_FIX=/usr/local/ceres ..
# -j3是使用3个cpu core来编译,根据个人CPU的个数给定,也可以去掉-j3
make -j3
# make test不是必须的
make test
# Optionally install Ceres, it can also be exported using CMake which
# allows Ceres to be used without requiring installation, see the documentation
# for the EXPORT_BUILD_DIR option for more information.
sudo make install
相关推荐
xlp666hub6 分钟前
如果操作GPIO可能导致休眠,那么同步机制绝不能采用spinlock
linux·面试
RisunJan26 分钟前
Linux命令-mkbootdisk(可建立目前系统的启动盘)
linux·运维·服务器
朽棘不雕1 小时前
Linux工具(上)
linux·运维·服务器
Eric.Lee20212 小时前
查看ubuntu机器正在使用的网络端口
网络·ubuntu·php
BestOrNothing_20152 小时前
Ubuntu 22.04 下调整 VS Code 界面及字体教程
linux·vscode·ubuntu22.04·界面调整
桌面运维家2 小时前
Windows/Linux云桌面:高校VDisk方案部署指南
linux·运维·windows
mzhan0172 小时前
Linux:intel:Cache Allocation tech
linux·cpu
学机械的鱼鱼3 小时前
【踩坑记录】Linux环境下FreeCAD打开后一新建就崩
linux
小璐资源网3 小时前
UPS电源管理:应对突发断电的应急方案
linux·运维·服务器
grrrr_13 小时前
【工具类】虚拟机 + Ubuntu 安全部署 OpenClaw,联动 Ollama 零成本解锁云端大模型
linux·运维·ubuntu·#openclaw·#小龙虾