I. Compilation environment
ubuntu16.04
Two. Preparation of the necessary libraries for the installation of the work
2.1 Installing CMake
sudo apt-get install CMake
2.2 Installing Google-glog + gflags
sudo apt-get install Libgoogle-glog-dev
2.3 Installing BLAS & LAPACK
sudo apt-get install Libatlas-base-dev
2.4 Installing Eigen3
sudo apt-get install Libeigen3-dev
2.5 Installing suitesparse and Cxsparse
sudo apt-get install Libsuitesparse-dev (this default causes Ceres-solver to be compiled into a static library, but so far to compile ceres-solver into a dynamic library, you need to add a repository to the current source, But the software warehouse to 2018/2/5 has not provided 16.04 of the corresponding version, so 16.04 can not be compiled into a dynamic library, but there are ways to patch themselves, compiled suitesparse this library)
The preparation is complete and the next step is to compile Ceres-solver
Three. Compiling ceres-solver Static Library
3.1 Get the source code
wget ceres-solver.org/ceres-solver-1.13.0.tar.gz
3.2 Decompression
Tar xvf ceres-solver-1.13.0.tar.gz
3.3 Switch to the source directory
CD ceres-solver-1.13.0
3.4 Creating a compiled directory
mkdir Build
3.5 Switch to the compiled directory
CD Build
3.6 Generating Makefile
CMake. /.. /ceres-solver-21.13.0
3.7 Compiling
Make-j4
3.8 Installation
Make install
Four. If you want to compile your own written test program needs to specify the following parameters to compile
For example, the test program is Test.cpp
g++-fopenmp Test.cpp-o Test-rdynamic/usr/local/lib/libceres.a-lcholmod-llapack-lf77blas-lcxsparse-lglog- I/usr/loca/include-isystem/usr/include/eigen3-i/usr/include/suitesparse
ubuntu16.04 under Compile Ceres-solver