9 releases

0.1.8 Oct 19, 2024
0.1.7 Oct 19, 2024
0.1.4 Sep 8, 2024
0.1.3 Aug 20, 2024
0.1.1 Jul 25, 2024

#1784 in Algorithms

Download history 98/week @ 2024-07-20 26/week @ 2024-07-27 112/week @ 2024-08-03 6/week @ 2024-08-10 139/week @ 2024-08-17 9/week @ 2024-08-24 115/week @ 2024-09-07 23/week @ 2024-09-14 18/week @ 2024-09-21 11/week @ 2024-09-28 1/week @ 2024-10-05 163/week @ 2024-10-12 449/week @ 2024-10-19 11/week @ 2024-10-26 6/week @ 2024-11-02

629 downloads per month
Used in meos

Custom license

3MB
44K SLoC

C 28K SLoC // 0.3% comments Rust 15K SLoC // 0.0% comments SQL 1K SLoC // 0.4% comments Happy 118 SLoC Shell 33 SLoC // 0.1% comments Lex 26 SLoC // 0.2% comments XSL 3 SLoC

meos-sys

Low level MEOS C API bindings for MEOS.

It provides C-interface as is. If you want to use a more Rust-friendly crate, use the meos crate.

You can also find it on crates.io.

Versions >= 1.1 are supported.

Usage

You need to select as features what version do you want to obtain the bindings from (v1_1, v1_2), or alternatively, whether you want to build MEOS from scratch (bundled). This will mean adding to your Cargo.toml:

# Cargo.toml
[dependencies]
meos-sys = { version = "0.1.8", features = ["v1_2"] }

Build

The build by default will use system-installed MEOS, pkg-config is used to automatically detect MEOS

If MEOS is in a custom location, you can instead use the MEOS_LIB_DIR environment variable to configure MEOS detection.

If MEOS_LIB_DIR is not also in your system's standard dynamic library search path, you may need to add it to the dynamic library search path before running the tests or executable produced by cargo build.

Linux:

LD_LIBRARY_PATH=<path to MEOS>/lib MEOS_LIB_DIR=<path to MEOS>/lib MEOS_VERSION=<version> cargo test

MacOS:

DYLD_FALLBACK_LIBRARY_PATH=<path to MEOS>/lib MEOS_LIB_DIR=<path to MEOS>/lib MEOS_VERSION=<version> cargo test

You can also enable the bundled feature to build MEOS from scratch. Note you will still have to have installed in your system GEOS, PROJ and JSON-C libraries. You can install all of them by running the following command in your (Debian based) machine:

sudo apt-get install libgeos-dev proj-bin libproj-dev proj-data libjson-c-dev

Binding generation

The 1.2 and 1.1 versions are already available as prebuilt bindings. Alternatively, you can generate your own bindings from your libmeos installation by specifying the bindgen feature.

Dependencies