https://github.com/scaleweather/eccodes-sys
Low-level Rust bindings for ecCodes.
https://github.com/scaleweather/eccodes-sys
bufr eccodes grib grib2 numerical-simulations
Last synced: 8 months ago
JSON representation
Low-level Rust bindings for ecCodes.
- Host: GitHub
- URL: https://github.com/scaleweather/eccodes-sys
- Owner: ScaleWeather
- License: apache-2.0
- Created: 2021-06-23T13:13:18.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-09-21T09:26:33.000Z (9 months ago)
- Last Synced: 2025-09-21T11:30:17.405Z (9 months ago)
- Topics: bufr, eccodes, grib, grib2, numerical-simulations
- Language: Rust
- Homepage:
- Size: 11.1 MB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eccodes-sys
[](https://choosealicense.com/licenses/apache-2.0/)
[](https://crates.io/crates/eccodes-sys)
[](https://deps.rs/repo/github/ScaleWeather/eccodes-sys)
[](https://github.com/ScaleWeather/eccodes-sys/actions)
**This is a `-sys` crate with raw, unsafe bindings to the library and its API should not be used directly.** See the [eccodes crate](https://github.com/ScaleWeather/eccodes) for high-level, safe bindings.
**Due to the complexity of ecCodes library the decision has been made that this crate will not build ecCodes from source.**
See sections below for additional information how to install ecCodes on your system.
[ecCodes](https://confluence.ecmwf.int/display/ECC/ecCodes+Home) is an open-source library for reading and writing GRIB and BUFR files developed by [European Centre for Medium-Range Weather Forecasts](https://www.ecmwf.int/).
## Usage
This crate will look for existing `libeccodes` installation using [pkg-config](https://crates.io/crates/pkg-config).
The ecCodes library is then linked and bindings are generated using [bindgen](https://crates.io/crates/bindgen).
If the library is not found, the build will fail.
## ecCodes installation
The recommended way to install ecCodes on your computer is using your package manager.
For example, on Ubuntu you can use `apt-get`:
```bash
sudo apt-get install libeccodes-dev
```
Alternatively, you can install the library manually from source in suitable directory
following [this instructions](https://confluence.ecmwf.int/display/ECC/ecCodes+installation).
Then add the `lib/pkgconfig` directory from your ecCodes installation directory
to the `PKG_CONFIG_PATH` environmental variable. If ecCodes have been compiled
as shared library you will also need to specify `LD_LIBRARY_PATH`.
For example:
```bash
export PKG_CONFIG_PATH=/lib/pkgconfig
export LD_LIBRARY_PATH=/lib
```
## Features
There are two development features available:
- `docs` - for documentation building, does not 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 dereference null pointers causing undefined behavior
## License
The ecCodes library and these bindings are licensed under the [Apache License Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)