Install
Pick one language.
| Binding | Install |
|---|---|
| Rust | cargo add minimage |
| Python | pip install minimage |
| C / C++ | Meson wrap, CMake find_package(minimage), or pkg-config minimage |
Rust
use minimage::{Cell, Error};
fn main() -> Result<(), Error> {
let sim = Cell::ortho(10.0, 10.0, 10.0)?;
assert!((sim.dist2([0.2, 0.0, 0.0], [9.4, 0.0, 0.0]) - 0.64).abs() < 1e-12);
Ok(())
}
Python
Python 3.10 or newer. Each release has one abi3 wheel per platform, for Linux x86_64 and aarch64 (manylinux_2_28), macOS arm64 and Windows x86_64, which covers every CPython from 3.10 on. Elsewhere pip builds the sdist, which needs a Rust toolchain.
import minimage cell = minimage.Cell.ortho(10.0, 10.0, 10.0) print(cell.dist2([0.2, 0.0, 0.0], [9.4, 0.0, 0.0]))
Meson wrap
[wrap-git] url = https://github.com/lode-org/minimage.git revision = v0.2.3 depth = 1 [provide] minimage = minimage_dep
minimage_dep = dependency('minimage', fallback: ['minimage', 'minimage_dep'])
CMake and pkg-config
cmake -B build -DCMAKE_INSTALL_PREFIX=$PREFIX cmake --build build cmake --install build
find_package(minimage 0.2 REQUIRED) target_link_libraries(app PRIVATE minimage::minimage)
With pkg-config after installing via Meson or CMake:
pkg-config --cflags --libs minimage
Next: tutorial.