Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 1.11 KB

README.md

File metadata and controls

24 lines (19 loc) · 1.11 KB

Go bindings for the DDlog API

We provide a Go module with a single ddlog package which defines wrappers around the DDlog C API.

Building this package requires access to the ddlog.h header file along with the dynamic library generated by DDlog for your program. We use cgo to invoke the DDlog C API and we expect the following environment variables to be set at build time:

  • CGO_CPPFLAGS must be set so that the directory including ddlog.h is added to the C compiler's search path.
  • CGO_LDFLAGS must be set so that the linker searches the dynamic library generated for your program.

For an example, refer to cmd/example/, which is a Go program using the DDlog Go bindings. This program assumes that the DDlog program typesTest.dl is the one being used. The example can be built and run with ./run-example.sh. Refer to this script to understand how to set CGO_CPPFLAGS and CGO_LDFLAGS.

Running the tests

If you make changes to the ddlog Go package, you can validate your changes by running the unit tests with ./run-tests.sh.