fast-gicp-sys
Low-level FFI bindings for the fast_gicp C++ library.
Build Requirements
Normal Build
- PCL (Point Cloud Library) >= 1.8
- Eigen3 >= 3.0
- C++ compiler with C++17 support
- CMake
Documentation Build (docs.rs)
No external dependencies required when using the docs-only feature.
Features
openmp(default): Enable OpenMP parallelizationcuda: Enable CUDA GPU accelerationbindgen: Regenerate bindings from C++ headers (requires all dependencies)docs-only: Skip C++ compilation, use pre-generated bindings only
Pre-generated Bindings
This crate includes pre-generated CXX bindings in src/generated/ to support documentation builds on docs.rs where C++ dependencies are not available.
Updating Pre-generated Bindings
When making changes to the FFI interface, you must regenerate the bindings:
# From the project root
# Or manually
Important: Always commit the updated files in src/generated/ to ensure docs.rs builds continue to work.
Implementation Details
The binding generation process uses a two-phase approach:
- Phase 1: Parse the
cxx::bridgedefinition fromsrc/lib.rs(viaffi_definitionmodule) - Phase 2: Generate two files:
src/generated/bindings.rs: Full FFI bindings (used by default)src/generated/stub.rs: Stub implementations withunreachable!()for docs.rs
The build script automatically handles conditional compilation:
- Default build: Compiles C++ and uses
bindings.rs docs-onlyfeature: Skips C++ compilation and usesstub.rsbindgenfeature: Regenerates both files from the source definition
Development Workflow
- Make changes to the FFI interface in
src/lib.rs(in theffi_definitionmodule) - Test the normal build:
cargo build - Regenerate bindings:
make generate-bindings - Test docs-only build:
cargo build --no-default-features --features docs-only - Run the lint suite:
make lint(from project root) - Verify the generated code:
cargo expand --lib > expanded.rs - Commit both the source changes and updated
src/generated/files