ubuntu16.04 under Compile Ceres-solver

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.