fast-gicp-sys

Crates.iofast-gicp-sys
lib.rsfast-gicp-sys
version0.3.0
created_at2025-06-27 08:28:24.185369+00
updated_at2025-06-29 08:41:30.729777+00
descriptionLow-level FFI bindings for fast_gicp C++ library
homepagehttps://github.com/jerry73204/fast_gicp_rust
repositoryhttps://github.com/jerry73204/fast_gicp_rust.git
max_upload_size
id1728328
size347,404
(jerry73204)

documentation

https://docs.rs/fast-gicp

README

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 parallelization
  • cuda: Enable CUDA GPU acceleration
  • bindgen: 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
make generate-bindings

# Or manually
cd fast-gicp-sys
cargo build --features bindgen

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:

  1. Phase 1: Parse the cxx::bridge definition from src/lib.rs (via ffi_definition module)
  2. Phase 2: Generate two files:
    • src/generated/bindings.rs: Full FFI bindings (used by default)
    • src/generated/stub.rs: Stub implementations with unreachable!() for docs.rs

The build script automatically handles conditional compilation:

  • Default build: Compiles C++ and uses bindings.rs
  • docs-only feature: Skips C++ compilation and uses stub.rs
  • bindgen feature: Regenerates both files from the source definition

Development Workflow

  1. Make changes to the FFI interface in src/lib.rs (in the ffi_definition module)
  2. Test the normal build: cargo build
  3. Regenerate bindings: make generate-bindings
  4. Test docs-only build: cargo build --no-default-features --features docs-only
  5. Run the lint suite: make lint (from project root)
  6. Verify the generated code: cargo expand --lib > expanded.rs
  7. Commit both the source changes and updated src/generated/ files
Commit count: 0

cargo fmt