ceres g2o 安装

9、ceres 安装
git clone https://github.com/ceres-solver/ceres-solver.git
安装依赖:
# CMake
sudo apt-get install cmake
# google-glog + gflags
sudo apt-get install libgoogle-glog-dev
# BLAS & LAPACK
sudo apt-get install libatlas-base-dev
# Eigen3
sudo apt-get install libeigen3-dev
# SuiteSparse and CXSparse (optional)
# - If you want to build Ceres as a *static* library (the default)
#   you can use the SuiteSparse package in the main Ubuntu package
#   repository:
sudo apt-get install libsuitesparse-dev
# - However, if you want to build Ceres as a *shared* library, you must   //如果编译动态库时  需要安装 ppa
#   add the following PPA:
sudo add-apt-repository ppa:bzindovic/suitesparse-bugfix-1319687
sudo apt-get update
sudo apt-get install libsuitesparse-dev
编译:
Cd ceres-solver
Mkidr build 
Cd build
cmake ..
make -j3
    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
10、g2o安装 git clone https://github.com/RainerKuemmerle/g2o.git 安装依赖: Sudo apt-get install cmake libeigen3-dev libsuitesparse-dev qtdeclarative5-dev qt5-qmake libqglviewer-dev 编译: cd g2o mkdir build cd build cmake make sudo make install

 

问题:移除重装

先删除之前的:
sudo rm -r /usr/local/lib/cmake/Ceres
sudo rm -rf /usr/local/include/ceres /usr/local/lib/libceres.a

git clone https://github.com/ceres-solver/ceres-solver/tree/1.14.0

cd ceres-solver-1.14.0
mkdir build
cd build
cmake ..
make -j4
sudo make install

 

cmakelists

add_executable(helloworld helloworld.cc)
target_link_libraries(helloworld ceres)

 

posted @ 2019-05-29 14:14  玥茹苟  阅读(633)  评论(0编辑  收藏  举报