Skip to content

Install and Build

Prerequisites

  • libCalibGeom shared library for your platform:
  • Linux: lib/liblibCalibGeom.so
  • Windows: lib/libCalibGeom.lib for linking and bin/libCalibGeom.dll at runtime
  • macOS: lib/liblibCalibGeom.dylib
  • Rust wrapper source package in the SDK rust/ directory (Cargo.toml, build.rs, src/)
  • Rust toolchain with cargo

Build the Rust wrapper

The wrapper locates the SDK headers and library automatically in the standard package layout. LIBCALIBGEOM_INCLUDE_DIR and LIBCALIBGEOM_LIB_DIR can override those locations.

From an extracted SDK:

cd rust
cargo build --release

Use cargo run --example ... the same way, for example:

cargo run --release --example single_camera

For an in-tree development build, run Cargo from rust_wrapper/. Its default search includes build/release/libcalibgeom; set LIBCALIBGEOM_LIB_DIR when using a different build directory.

Make sure the shared library is found at runtime

In addition to link-time discovery, your OS loader must be able to find the shared library when running Rust binaries.

  • Linux: add the directory to LD_LIBRARY_PATH.
  • Windows: add the SDK bin/ directory to PATH.
  • macOS: add the directory to DYLD_LIBRARY_PATH (or use an embedded rpath workflow).

Example patterns:

# Linux
export LIBCALIBGEOM_LIB_DIR=/path/to/lib
export LD_LIBRARY_PATH="$LIBCALIBGEOM_LIB_DIR:$LD_LIBRARY_PATH"

# macOS
export LIBCALIBGEOM_LIB_DIR=/path/to/lib
export DYLD_LIBRARY_PATH="$LIBCALIBGEOM_LIB_DIR:$DYLD_LIBRARY_PATH"
# Windows PowerShell
$env:LIBCALIBGEOM_LIB_DIR = "C:\path\to\lib"
$env:PATH = "$env:LIBCALIBGEOM_LIB_DIR;$env:PATH"

Platform notes

  • Verify that the expected libCalibGeom shared library exists in LIBCALIBGEOM_LIB_DIR before running Cargo.
  • If the linker or loader cannot find libCalibGeom, re-check both LIBCALIBGEOM_LIB_DIR and your OS runtime path variable.