File: builder.py

package info (click to toggle)
eccodes-python 2%3A1.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,672 kB
  • sloc: python: 2,991; ansic: 268; makefile: 83
file content (19 lines) | stat: -rw-r--r-- 435 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import logging
import sys

import cffi

ffibuilder = cffi.FFI()
ffibuilder.set_source(
    "gribapi._bindings",
    "#include <eccodes.h>",
    libraries=["eccodes"],
)
ffibuilder.cdef(open("gribapi/grib_api.h").read() + open("gribapi/eccodes.h").read())

if __name__ == "__main__":
    try:
        ffibuilder.compile(verbose=True)
    except Exception:
        logging.exception("can't compile ecCodes bindings")
        sys.exit(1)