From e0c1b64d436a1525410ef26bb213ccad14223fd8 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Wed, 2 Sep 2026 22:07:59 +0200 Subject: [PATCH] Reach MEOS through the pkg-config file MEOS installs The streaming engine's cgo preamble reads meos.pc, which MEOS's own install writes beside the library, instead of naming -I/usr/local/include and -lmeos directly. A stock /usr/local install carries that file and resolves to the same flags, so the default path is unchanged; a prefix built elsewhere is named once, through PKG_CONFIG_PATH, and both the header path and the link path follow from that single coordinate. Naming the directory directly resolves one libmeos and one set of headers, whichever copy /usr/local holds, and a prefix built for the branch under test is unreachable. An -I added alongside only prepends, so a stale /usr/local header still satisfies the include, and a build compiles against headers that belong to a different library than the one it links. meos.pc also carries the family flags the library is configured with (-DCBUFFER=0, -DNPOINT=1 and the rest), so a build under -tags meos compiles against the same family gating as the libmeos it links, rather than against whatever the headers on the include path happen to declare. The tutorial's prerequisites name the two variables a prefix elsewhere needs. --- stream_engine_meos.go | 3 +-- tutorial-stream/README.md | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/stream_engine_meos.go b/stream_engine_meos.go index 05248c6..fc82e35 100644 --- a/stream_engine_meos.go +++ b/stream_engine_meos.go @@ -19,8 +19,7 @@ package main /* -#cgo CFLAGS: -I/usr/local/include -#cgo LDFLAGS: -lmeos +#cgo pkg-config: meos #include #include */ diff --git a/tutorial-stream/README.md b/tutorial-stream/README.md index 48c6912..63095bc 100644 --- a/tutorial-stream/README.md +++ b/tutorial-stream/README.md @@ -45,6 +45,10 @@ in-process engine live in one tier (each named cluster engine still requires its MFAPI_DSN= LD_LIBRARY_PATH=/usr/local/lib ./mfapi ``` + The build reads MEOS's own `meos.pc`, so a libmeos installed somewhere other + than `/usr/local` is named once, by pointing `PKG_CONFIG_PATH` at the + prefix's `lib/pkgconfig` and `LD_LIBRARY_PATH` at its `lib`. + The default (cgo-free) build serves every other endpoint but reports the streaming engine as not built (`501`). Point the notebook at another host with the `MFAPI_HOST` environment variable.