potassco / clingo-sys

Raw Rust FFI bindings to the C API of clingo library
MIT License
1 stars 1 forks source link

Doesn't build when trying to compile to static library (libgringo dependencies?) #8

Open nuernbergk opened 7 months ago

nuernbergk commented 7 months ago

I am trying to build this library as a static library (adding crate-type = ["staticlib"] in the manifest and building by cargo build --features="static-linking". However, I am getting the following error(s): Called from: [1] /Users/nn/clingo-sys/clingo/clasp/libpotassco/CMakeLists.txt CMake Error: install(EXPORT "ClingoTargets" ...) includes target "libgringo" which requires target "ordered_map" that is not in any export set. Called from: [1] /Users/nn/clingo-sys/clingo/libclingo/CMakeLists.txt CMake Error: install(EXPORT "ClingoTargets" ...) includes target "libgringo" which requires target "hopscotch_map" that is not in any export set. Called from: [1] /Users/nn/clingo-sys/clingo/libclingo/CMakeLists.txt CMake Error: install(EXPORT "ClingoTargets" ...) includes target "libgringo" which requires target "sparse_map" that is not in any export set. Called from: [1] /Users/nn/clingo-sys/clingo/libclingo/CMakeLists.txt CMake Error: install(EXPORT "ClingoTargets" ...) includes target "libgringo" which requires target "optional" that is not in any export set. Called from: [1] /Users/nn/clingo-sys/clingo/libclingo/CMakeLists.txt CMake Error: install(EXPORT "ClingoTargets" ...) includes target "libgringo" which requires target "variant" that is not in any export set. Called from: [1] /Users/nn/clingo-sys/clingo/libclingo/CMakeLists.txt CMake Generate step failed. Build files cannot be regenerated correctly. I don't quite understand what is happening here. I am on macOS Sonoma. Building with the static-linking feature by including this in the dependencies of some other project works, however.

sthiele commented 7 months ago

The master branch is applying a patch to clingo to fix this issue. The bugfix.patch is contained in the repo.

You can apply the patch as follows:

patch -u clingo/libclingo/CMakeLists.txt -i bugfix.patch

Sorry for causing confusion. A new version of clingo-sys is overdue, but I currently don't find much time.