ceres-solver¶
- Official
- Hunterized
- Examples:
- Available since v0.18.30
- Added by NeroBurner (pr-648)
- with SuiteSparse support
- Available since v0.19.40
- Added by NeroBurner (pr-898)
- Maintainer: https://github.com/NeroBurner
Ceres Solver is an open source C++ library for modeling and solving large, complicated optimization problems. It can be used to solve Non-linear Least Squares problems with bounds constraints and general unconstrained optimization problems. It is a mature, feature rich, and performant library that has been used in production at Google since 2010. For more, see official website.
Usage¶
hunter_add_package(ceres-solver)
find_package(Ceres CONFIG REQUIRED)
target_link_libraries(... PRIVATE ceres)
with SuiteSparse¶
To get ceres-solver
with SuiteSparse
and static LAPACK
add a local cmake/Hunter/config.cmake
file with the following contents:
hunter_config(ceres-solver
VERSION ${HUNTER_ceres-solver_VERSION} CMAKE_ARGS
LAPACK=ON
SUITESPARSE=ON
CXSPARSE=ON # since 1.14.0-p1
)
Don’t forget to add enable_language(Fortran)
in your projects CMakeLists.txt
.
with SuiteSparse and dynamic LAPACK¶
To get ceres-solver
with SuiteSparse
and dynamic LAPACK
add a local cmake/Hunter/config.cmake
file with the following contents:
hunter_config(ceres-solver
VERSION ${HUNTER_ceres-solver_VERSION} CMAKE_ARGS
LAPACK=ON
SUITESPARSE=ON
CXSPARSE=ON # since 1.14.0-p1
)
hunter_config(LAPACK
VERSION ${HUNTER_LAPACK_VERSION}
CMAKE_ARGS BUILD_SHARED_LIBS=ON
)
With a dynamic LAPACK
library the enable_language(Fortran)
is not needed.
But when shipping your project one must also ship the shared LAPACK
library.