eccodes-sys 0.0.2

Low-level Rust bindings for latests ecCodes version.
Documentation

eccodes-sys

Licence GitHub Workflow Status

This is a -sys crate with raw, unsafe bindings to the library and its API should not be used directly. See the eccodes crate for high-level, safe bindings.

ecCodes is an open-source library for reading and writing GRIB and BUFR files developed by European Centre for Medium-Range Weather Forecasts.

Usage

By default this crate will look for existing libeccodes installation using pkg-config. If the library is not found, the crate will attempt to download the latest source code and build ecCodes from source. The ecCodes library is then linked and bindings are generated using bindgen.

To install ecCodes globally to use with this crate apt-get can be used:

sudo apt-get install libeccodes-dev

Because ecCodes supports mainly Linux platforms, this crate is not tested on other architectures.

Features

The eccodes-sys crate allows to choose several features. For a detailed explanation of ecCodes compilation options check the official website.

  • build_source - ecCodes library will be built from source even if other installation exists. This option by default builds static library with MEMFS activated.

All following features activate building from source:

  • jpeg - builds ecCodes with JPEG2000 support enabled (ENABLE_JPG=ON), requires libopenjp2-7-dev
  • png - builds ecCodes with PNG support enabled (ENABLE_PNG=ON), requires libpng-dev
  • netcdf - builds ecCodes with NETCDF support enabled (ENABLE_NETCDF=ON), requires libnetcdff-dev and libnetcdf-c++4-dev

These are advanced features which should be used only when you know that compilation files will not be removed:

  • shared - builds ecCodes as shared library (BUILD_SHARED_LIBS=ON)
  • no_memfs - builds ecCodes with MEMFS deactivated (ENABLE_MEMFS=OFF)

There are also development features available:

  • docs - for documentation building, does not build or link ecCodes and includes bindings-docs.rs into lib.rs
  • tests - turns on generation of layout tests by bindgen, should not be used in production. Layout tests are off by default as they derefrence null pointers causing undefined behaviour

License

The ecCodes library and these bindings are licensed under the Apache License Version 2.0