Ask pkg-config where MEOS is and which families it has - #13
Merged
estebanzimanyi merged 1 commit intoAug 15, 2026
Conversation
The cgo preamble hardcoded /usr/local (and /opt/homebrew) as the place to find libmeos, plus a hand-kept list of ten -D family macros mirroring the if(ALL) loop in MobilityDB's CMakeLists. Both are assumptions about a machine rather than facts about the library, and the -D list is the one that bites: the public headers gate declarations on those macros, so a list that disagrees with the installed library either declares a symbol that cannot link or hides a family the library provides. The macros are not derivable from -DALL either, which selects families at configure time and never reaches a compiler. The installed meos.pc now reports both, so the preamble asks for them. This also makes the binding relocatable: PKG_CONFIG_PATH selects which libmeos to build against, which is what lets a build target a private prefix instead of inheriting a machine-wide directory shared with everything else on the host. H3 ships no pkg-config file, so meos_h3.h's <h3api.h> keeps its include dir named here; GEOS and GSL resolve from the default include path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The generated cgo preamble asks
pkg-configfor the MEOS include dir, link path and family macros.The alternative is a hardcoded
/usr/local(and/opt/homebrew) plus a hand-kept list of ten-Dfamily macros mirroring theif(ALL)loop in MobilityDB CMakeLists. Both are assumptions about a machine rather than facts about the library, and the-Dlist is the one that bites: the public headers gate declarations on those macros, so a list that disagrees with the installed library either declares a symbol that cannot link or hides a family the library provides. The macros do not follow from-DALLeither, which selects families at configure time and never reaches a compiler.The installed
meos.pccarries both, so the preamble asks for them. This also makes the binding relocatable:PKG_CONFIG_PATHselects which libmeos to build against, which lets a build target a private prefix instead of a machine-wide directory shared with every other process on the host. A prefix outside the loader default search path needsLD_LIBRARY_PATHorldconfig.H3 ships no pkg-config file, so
meos_h3.hs<h3api.h>keeps its include dir named in the preamble; GEOS and GSL resolve from the default include path.go build ./functions/against a private prefix exits 0, with each of the 13meos*.hheaders resolving inside that prefix.