#bindings #solver #ceres #unsafe-bindings

sys ceres-solver-sys

Unsafe Rust bindings for the Ceres Solver

11 releases

0.5.1 Dec 13, 2025
0.5.0 Dec 13, 2025
0.4.2 Apr 18, 2025
0.4.1 Jan 7, 2025
0.1.0 Jan 19, 2023

#2918 in Algorithms

Download history 188/week @ 2025-08-26 266/week @ 2025-09-02 140/week @ 2025-09-09 77/week @ 2025-09-16 37/week @ 2025-09-23 282/week @ 2025-09-30 30/week @ 2025-10-07 54/week @ 2025-10-14 43/week @ 2025-10-21 346/week @ 2025-10-28 57/week @ 2025-11-04 608/week @ 2025-11-11 80/week @ 2025-11-18 362/week @ 2025-11-25 36/week @ 2025-12-02 125/week @ 2025-12-09

621 downloads per month
Used in 2 crates (via ceres-solver)

MIT/Apache

2.5MB
41K SLoC

C++ 32K SLoC // 0.2% comments FORTRAN Legacy 5.5K SLoC // 0.4% comments C 1K SLoC // 0.4% comments CUDA 817 SLoC // 0.1% comments Rust 499 SLoC // 0.0% comments Bazel 175 SLoC // 0.3% comments Shell 175 SLoC // 0.2% comments Python 158 SLoC // 0.6% comments JavaScript 51 SLoC // 0.1% comments XSL 28 SLoC Forge Config 1 SLoC

ceres-solver-sys

Low-level unsafe Rust bindings for Ceres Solver

Test pre-commit.ci status Crates.io

Currently, we bind C API only using bindgen. The minimal tested version of Ceres Solver is 2.0

Cargo feature flags

  • v2_1 wraps Ceres Solver 2.1 API, which added CUDA support
  • system (default) links a system copy of the Ceres Solver library. By default, it would be a synamic library, but you can tweak it with pkg-config
  • source (optional) overrides system and links a static library file built by ceres-solver-src crate, it is also applies v2_1 feature flag, because ceres-solver-src crate builds Ceres Solver 2.2 from source

system feature requires pkg-config system dependency, while source requires ceres-solver-src build dependencies such as CMake and C++17 compatible compiler.

Dependencies