#set #clingo #bindings #api-bindings #linker #version #variables

sys clingo-sys

Raw FFI bindings to the C API of the clingo library

15 releases

0.7.2 Oct 2, 2023
0.7.1 Aug 27, 2021
0.6.0 Jun 5, 2020
0.5.1 Nov 7, 2019
0.2.0 May 4, 2017

#2749 in Algorithms

Download history 681/week @ 2024-11-15 657/week @ 2024-11-22 764/week @ 2024-11-29 1403/week @ 2024-12-06 772/week @ 2024-12-13 736/week @ 2024-12-20 611/week @ 2024-12-27 808/week @ 2025-01-03 601/week @ 2025-01-10 984/week @ 2025-01-17 482/week @ 2025-01-24 516/week @ 2025-01-31 675/week @ 2025-02-07 599/week @ 2025-02-14 575/week @ 2025-02-21 565/week @ 2025-02-28

2,557 downloads per month
Used in 4 crates (via clingo)

MIT license

10MB
218K SLoC

C++ 152K SLoC // 0.1% comments C 35K SLoC // 0.0% comments Python 18K SLoC // 0.4% comments Rust 4K SLoC // 0.0% comments Solidity 4K SLoC Visual Studio Project 3K SLoC Bazel 680 SLoC // 0.2% comments Shell 555 SLoC // 0.4% comments Automake 421 SLoC // 0.2% comments M4 255 SLoC // 0.4% comments Visual Studio Solution 234 SLoC Batch 73 SLoC Xcode Config 33 SLoC // 0.7% comments PowerShell 13 SLoC // 0.1% comments Lua 10 SLoC JavaScript 2 SLoC

Contains (obscure autoconf code, 7KB) configure.ac, (obscure autoconf code, 1KB) configure.ac, (obscure autoconf code, 3KB) configure.ac

clingo-sys Build StatusLatest VersionRust Documentation

Rust raw FFI bindings to the C API of clingo library. Clingo version 5.6.2.

Requirements library

Per default the crate uses the clingo library via dynamic linking. It is assumed that a clingo dynamic library is installed on the system. You have to set the environment variable CLINGO_LIBRARY_PATH. For example:

export CLINGO_LIBRARY_PATH=/scratch/miniconda3/envs/test/lib

Using static-linking

The crate defines a Cargo feature that allows to use the clingo library via static linking.

The recommended way to use the optional static linking support is as follows.

[dependencies]
clingo-sys = { version = "0.7.2", features = ["static-linking"] }

To build clingo for static linking you need the following tools installed:

  • a C++14 conforming compiler
    • at least GCC version 4.9
    • Clang version 3.1 (using either libstdc++ provided by gcc 4.9 or libc++)
    • at least MSVC 15.0 (Visual Studio 2017)
    • other compilers might work
  • the cmake build system
    • at least version 3.18 is recommended
    • at least version 3.1 is required

Dependencies