Skip to content

Build pgPointCloud libpc.a without autotools to enable POINTCLOUD#154

Open
estebanzimanyi wants to merge 8 commits into
feat/trgeometry-port-corefrom
feat/pointcloud-vcpkg-enabler
Open

Build pgPointCloud libpc.a without autotools to enable POINTCLOUD#154
estebanzimanyi wants to merge 8 commits into
feat/trgeometry-port-corefrom
feat/pointcloud-vcpkg-enabler

Conversation

@estebanzimanyi
Copy link
Copy Markdown
Member

The MEOS -DPOINTCLOUD=ON build FATAL_ERRORs unless pointcloud-pg/lib/libpc.a exists, which pgPointCloud normally produces as a side effect of ./autogen.sh && ./configure && make. That autotools path cannot run in the manylinux extension-ci container, which has no autotools-usable PostgreSQL and no pg_config. The vendored pointcloud-pg/lib/ archive sources include only libxml2 and zlib (no PostgreSQL headers), and pointcloud-pg/lib/Makefile builds the libpc.a target directly via ar rs using only the XML2/ZLIB CPPFLAGS from config.mk; the CUnit dependency is confined to the all: cunit/ recurse. The portfile now generates config.mk and lib/pc_config.h the way pgPointCloud's autotools would, filling only the @vars@ that config.mk.in declares and the lib archive sources consume with vcpkg's libxml2 and zlib paths, builds the libpc.a target directly, asserts the archive exists at the path meos/src/pointcloud/CMakeLists.txt checks, and adds -DPOINTCLOUD=ON. libxml2 is declared as a dependency of the meos port and the top-level manifest; the meos port-version is bumped.

@estebanzimanyi estebanzimanyi force-pushed the feat/pointcloud-vcpkg-enabler branch 3 times, most recently from 9331934 to 024e8da Compare May 17, 2026 17:37
@estebanzimanyi
Copy link
Copy Markdown
Member Author

Reviewer's quickstart — ~2-3 minutes

What this PR does: Build pgPointCloud libpc.a without autotools to enable POINTCLOUD.

Risk: focused, single-purpose. Spot-check the source diff + matching tests; CI confirms.

Cross-link: Linux arm64 CI here needs #161 for the orthogonal MeosType build error.

estebanzimanyi added a commit to estebanzimanyi/MobilityDuck that referenced this pull request May 26, 2026
…bilityDB#154)

Enable -DPOINTCLOUD=ON in the MEOS vcpkg port so the temporal point
cloud types (tpcpoint/tpcpatch) can be built from the pinned MEOS.

The MEOS pointcloud module links the pgPointCloud archive libpc.a,
normally produced by pgPointCloud's autotools (./autogen.sh && configure
&& make), which cannot run here (no pg_config, no autotools-usable
PostgreSQL). The vendored pointcloud-pg/lib sources need only libxml2 and
zlib, and lib/Makefile builds libpc.a directly via ar. So the port now:

  - patches the upstream MEOS pcpoint.h/pcpatch.h DatumGetXxxP macros,
    which unconditionally use PG_DETOAST_DATUM (PostgreSQL-only) unlike
    every other type header, to DatumGetPointer under MEOS;
  - generates config.mk + lib/pc_config.h the way pgPointCloud's autotools
    would, with vcpkg's libxml2/zlib paths (CUnit/LazPerf disabled);
  - builds the libpc.a archive target directly;
  - renames libpc.a's stringbuffer_* symbols into a pc_stringbuffer_*
    namespace to avoid colliding with MEOS's bundled liblwgeom copy;
  - installs libpc.a alongside libmeos.a and propagates it (+ libxml2/zlib)
    through MEOS::meos's INTERFACE_LINK_LIBRARIES so consumers link cleanly.

Add libxml2/zlib to the meos port and project dependencies; bump the meos
port-version so vcpkg rebuilds it.
@estebanzimanyi estebanzimanyi force-pushed the feat/trgeometry-port-core branch from ede1610 to eb23e7c Compare May 26, 2026 22:07
@estebanzimanyi estebanzimanyi force-pushed the feat/pointcloud-vcpkg-enabler branch from 2ecc969 to 18dfeec Compare May 26, 2026 22:07
@estebanzimanyi estebanzimanyi force-pushed the feat/trgeometry-port-core branch from eb23e7c to 811018d Compare May 26, 2026 22:44
estebanzimanyi added a commit that referenced this pull request May 26, 2026
Enable -DPOINTCLOUD=ON in the MEOS vcpkg port so the temporal point
cloud types (tpcpoint/tpcpatch) can be built from the pinned MEOS.

The MEOS pointcloud module links the pgPointCloud archive libpc.a,
normally produced by pgPointCloud's autotools (./autogen.sh && configure
&& make), which cannot run here (no pg_config, no autotools-usable
PostgreSQL). The vendored pointcloud-pg/lib sources need only libxml2 and
zlib, and lib/Makefile builds libpc.a directly via ar. So the port now:

  - patches the upstream MEOS pcpoint.h/pcpatch.h DatumGetXxxP macros,
    which unconditionally use PG_DETOAST_DATUM (PostgreSQL-only) unlike
    every other type header, to DatumGetPointer under MEOS;
  - generates config.mk + lib/pc_config.h the way pgPointCloud's autotools
    would, with vcpkg's libxml2/zlib paths (CUnit/LazPerf disabled);
  - builds the libpc.a archive target directly;
  - renames libpc.a's stringbuffer_* symbols into a pc_stringbuffer_*
    namespace to avoid colliding with MEOS's bundled liblwgeom copy;
  - installs libpc.a alongside libmeos.a and propagates it (+ libxml2/zlib)
    through MEOS::meos's INTERFACE_LINK_LIBRARIES so consumers link cleanly.

Add libxml2/zlib to the meos port and project dependencies; bump the meos
port-version so vcpkg rebuilds it.
@estebanzimanyi estebanzimanyi force-pushed the feat/pointcloud-vcpkg-enabler branch from 18dfeec to 0b5e583 Compare May 26, 2026 22:44
@estebanzimanyi estebanzimanyi force-pushed the feat/trgeometry-port-core branch from 811018d to 8f4d1b9 Compare May 27, 2026 00:26
estebanzimanyi added a commit that referenced this pull request May 27, 2026
Enable -DPOINTCLOUD=ON in the MEOS vcpkg port so the temporal point
cloud types (tpcpoint/tpcpatch) can be built from the pinned MEOS.

The MEOS pointcloud module links the pgPointCloud archive libpc.a,
normally produced by pgPointCloud's autotools (./autogen.sh && configure
&& make), which cannot run here (no pg_config, no autotools-usable
PostgreSQL). The vendored pointcloud-pg/lib sources need only libxml2 and
zlib, and lib/Makefile builds libpc.a directly via ar. So the port now:

  - patches the upstream MEOS pcpoint.h/pcpatch.h DatumGetXxxP macros,
    which unconditionally use PG_DETOAST_DATUM (PostgreSQL-only) unlike
    every other type header, to DatumGetPointer under MEOS;
  - generates config.mk + lib/pc_config.h the way pgPointCloud's autotools
    would, with vcpkg's libxml2/zlib paths (CUnit/LazPerf disabled);
  - builds the libpc.a archive target directly;
  - renames libpc.a's stringbuffer_* symbols into a pc_stringbuffer_*
    namespace to avoid colliding with MEOS's bundled liblwgeom copy;
  - installs libpc.a alongside libmeos.a and propagates it (+ libxml2/zlib)
    through MEOS::meos's INTERFACE_LINK_LIBRARIES so consumers link cleanly.

Add libxml2/zlib to the meos port and project dependencies; bump the meos
port-version so vcpkg rebuilds it.
@estebanzimanyi estebanzimanyi force-pushed the feat/pointcloud-vcpkg-enabler branch from 0b5e583 to b7e4f7e Compare May 27, 2026 00:26
@estebanzimanyi estebanzimanyi force-pushed the feat/trgeometry-port-core branch from 8f4d1b9 to 8db3629 Compare May 27, 2026 01:43
estebanzimanyi added a commit that referenced this pull request May 27, 2026
Enable -DPOINTCLOUD=ON in the MEOS vcpkg port so the temporal point
cloud types (tpcpoint/tpcpatch) can be built from the pinned MEOS.

The MEOS pointcloud module links the pgPointCloud archive libpc.a,
normally produced by pgPointCloud's autotools (./autogen.sh && configure
&& make), which cannot run here (no pg_config, no autotools-usable
PostgreSQL). The vendored pointcloud-pg/lib sources need only libxml2 and
zlib, and lib/Makefile builds libpc.a directly via ar. So the port now:

  - patches the upstream MEOS pcpoint.h/pcpatch.h DatumGetXxxP macros,
    which unconditionally use PG_DETOAST_DATUM (PostgreSQL-only) unlike
    every other type header, to DatumGetPointer under MEOS;
  - generates config.mk + lib/pc_config.h the way pgPointCloud's autotools
    would, with vcpkg's libxml2/zlib paths (CUnit/LazPerf disabled);
  - builds the libpc.a archive target directly;
  - renames libpc.a's stringbuffer_* symbols into a pc_stringbuffer_*
    namespace to avoid colliding with MEOS's bundled liblwgeom copy;
  - installs libpc.a alongside libmeos.a and propagates it (+ libxml2/zlib)
    through MEOS::meos's INTERFACE_LINK_LIBRARIES so consumers link cleanly.

Add libxml2/zlib to the meos port and project dependencies; bump the meos
port-version so vcpkg rebuilds it.
@estebanzimanyi estebanzimanyi force-pushed the feat/pointcloud-vcpkg-enabler branch from b7e4f7e to 316ca4f Compare May 27, 2026 01:43
estebanzimanyi added a commit that referenced this pull request May 27, 2026
Enable -DPOINTCLOUD=ON in the MEOS vcpkg port so the temporal point
cloud types (tpcpoint/tpcpatch) can be built from the pinned MEOS.

The MEOS pointcloud module links the pgPointCloud archive libpc.a,
normally produced by pgPointCloud's autotools (./autogen.sh && configure
&& make), which cannot run here (no pg_config, no autotools-usable
PostgreSQL). The vendored pointcloud-pg/lib sources need only libxml2 and
zlib, and lib/Makefile builds libpc.a directly via ar. So the port now:

  - patches the upstream MEOS pcpoint.h/pcpatch.h DatumGetXxxP macros,
    which unconditionally use PG_DETOAST_DATUM (PostgreSQL-only) unlike
    every other type header, to DatumGetPointer under MEOS;
  - generates config.mk + lib/pc_config.h the way pgPointCloud's autotools
    would, with vcpkg's libxml2/zlib paths (CUnit/LazPerf disabled);
  - builds the libpc.a archive target directly;
  - renames libpc.a's stringbuffer_* symbols into a pc_stringbuffer_*
    namespace to avoid colliding with MEOS's bundled liblwgeom copy;
  - installs libpc.a alongside libmeos.a and propagates it (+ libxml2/zlib)
    through MEOS::meos's INTERFACE_LINK_LIBRARIES so consumers link cleanly.

Add libxml2/zlib to the meos port and project dependencies; bump the meos
port-version so vcpkg rebuilds it.
@estebanzimanyi estebanzimanyi force-pushed the feat/pointcloud-vcpkg-enabler branch from 316ca4f to 9c64f7b Compare May 27, 2026 02:50
estebanzimanyi added a commit that referenced this pull request May 27, 2026
Enable -DPOINTCLOUD=ON in the MEOS vcpkg port so the temporal point
cloud types (tpcpoint/tpcpatch) can be built from the pinned MEOS.

The MEOS pointcloud module links the pgPointCloud archive libpc.a,
normally produced by pgPointCloud's autotools (./autogen.sh && configure
&& make), which cannot run here (no pg_config, no autotools-usable
PostgreSQL). The vendored pointcloud-pg/lib sources need only libxml2 and
zlib, and lib/Makefile builds libpc.a directly via ar. So the port now:

  - patches the upstream MEOS pcpoint.h/pcpatch.h DatumGetXxxP macros,
    which unconditionally use PG_DETOAST_DATUM (PostgreSQL-only) unlike
    every other type header, to DatumGetPointer under MEOS;
  - generates config.mk + lib/pc_config.h the way pgPointCloud's autotools
    would, with vcpkg's libxml2/zlib paths (CUnit/LazPerf disabled);
  - builds the libpc.a archive target directly;
  - renames libpc.a's stringbuffer_* symbols into a pc_stringbuffer_*
    namespace to avoid colliding with MEOS's bundled liblwgeom copy;
  - installs libpc.a alongside libmeos.a and propagates it (+ libxml2/zlib)
    through MEOS::meos's INTERFACE_LINK_LIBRARIES so consumers link cleanly.

Add libxml2/zlib to the meos port and project dependencies; bump the meos
port-version so vcpkg rebuilds it.
@estebanzimanyi estebanzimanyi force-pushed the feat/pointcloud-vcpkg-enabler branch from 9c64f7b to f6d2141 Compare May 27, 2026 03:41
estebanzimanyi added a commit that referenced this pull request May 27, 2026
Enable -DPOINTCLOUD=ON in the MEOS vcpkg port so the temporal point
cloud types (tpcpoint/tpcpatch) can be built from the pinned MEOS.

The MEOS pointcloud module links the pgPointCloud archive libpc.a,
normally produced by pgPointCloud's autotools (./autogen.sh && configure
&& make), which cannot run here (no pg_config, no autotools-usable
PostgreSQL). The vendored pointcloud-pg/lib sources need only libxml2 and
zlib, and lib/Makefile builds libpc.a directly via ar. So the port now:

  - patches the upstream MEOS pcpoint.h/pcpatch.h DatumGetXxxP macros,
    which unconditionally use PG_DETOAST_DATUM (PostgreSQL-only) unlike
    every other type header, to DatumGetPointer under MEOS;
  - generates config.mk + lib/pc_config.h the way pgPointCloud's autotools
    would, with vcpkg's libxml2/zlib paths (CUnit/LazPerf disabled);
  - builds the libpc.a archive target directly;
  - renames libpc.a's stringbuffer_* symbols into a pc_stringbuffer_*
    namespace to avoid colliding with MEOS's bundled liblwgeom copy;
  - installs libpc.a alongside libmeos.a and propagates it (+ libxml2/zlib)
    through MEOS::meos's INTERFACE_LINK_LIBRARIES so consumers link cleanly.

Add libxml2/zlib to the meos port and project dependencies; bump the meos
port-version so vcpkg rebuilds it.
@estebanzimanyi estebanzimanyi force-pushed the feat/pointcloud-vcpkg-enabler branch from f6d2141 to c5d4a61 Compare May 27, 2026 04:20
@estebanzimanyi estebanzimanyi force-pushed the feat/trgeometry-port-core branch from 8db3629 to 2a6634e Compare May 28, 2026 21:48
Adds the SIZEOF_LONG_LONG emission to the rendered pg_config.h so the
DuckDB-Wasm (wasm32-emscripten / ILP32) build of MEOS no longer fails the
pg_bitutils integer-width check.
@estebanzimanyi estebanzimanyi force-pushed the feat/trgeometry-port-core branch from 2a6634e to cb39d26 Compare May 29, 2026 21:33
Scalar and cast bodies run MEOS on DuckDB TaskScheduler worker threads, which
need a per-thread meos_initialize(); a thread-local guard in the scalar exec
wrapper and a cast trampoline (RegisterMeosCastFunction) cover every entry
point, so timestamp formatting no longer dereferences a NULL session_timezone.
Per-type DuckDB callbacks and blob helpers have internal linkage and a single
canonical blob round-trip (TemporalToBlob / BlobToTemporal) declared once in
temporal/temporal_blob.hpp, so each function-pointer registration binds to its
own body.
Enable the CBUFFER, NPOINT, POSE and RGEO MEOS modules in the vcpkg port so the
extended temporal types (tcbuffer, tnpoint, tpose, trgeometry) can be ported
into MobilityDuck. RGEO depends on POSE.
Bring the temporal circular buffer (tcbuffer) type into MobilityDuck:
construction, text/EWKT/WKB I/O, casts and accessors, gated by the CBUFFER
config flag that mirrors the MEOS CBUFFER build module. Disabling CBUFFER drops
the tcbuffer sources and its registration in LoadInternal. MFJSON input binds to
MEOS tcbuffer_from_mfjson, which the pinned MEOS does not yet expose, so it is
omitted here.
Brings the temporal network point (tnpoint) type into the accumulate:
construction, text/EWKT/MFJSON I/O, casts, and accessors, registered in
LoadInternal after the tcbuffer surface. The network model resolves route
geometries from a ways CSV; MEOS hardcodes its path
(/usr/local/share/ways1000.csv) with no setter, so the canonical ways1000.csv
is embedded (ways_csv.inc) and materialized there on load (best-effort).

Fixes applied on top of the #150 branch:
- getValue/startValue/endValue value executors renamed to tnpoint-unique names
  (Tnpoint_{get,start,end}_value). Generic names (Tinstant_value /
  Temporal_start_value / Temporal_end_value) are also defined at namespace
  scope in the other geo .cpp — an ODR violation that would otherwise dispatch
  these to the surviving (geometry) definition and render the npoint as a
  geometry ("Unknown geometry type: 0").
- Refresh the asEWKT test expecteds with the ways-network SRID prefix
  (SRID=5676;), matching MobilityDB's asEWKT(npoint) reference; asText omits it.

Full sqllogictest suite green: 1799 assertions across 78 test cases.

(cherry picked from commit 94e01ad)
Brings the temporal pose (tpose) type into the accumulate: construction,
text/EWKT/MFJSON/WKB I/O, casts, and accessors, registered in LoadInternal
after the tnpoint surface.

Fixes applied on top of the #151 branch:
- getValue/startValue/endValue value executors renamed to tpose-unique names
  (Tpose_{get,start,end}_value) and rendered via pose_as_text (WKT form
  "Pose(POINT(x y),r)"). Generic names collide with the other geo .cpp (ODR
  violation -> geometry renderer -> "Unknown geometry type: 0"); pose_out
  emits the HexWKB/uppercase "POSE (...)" form, not what asText/getValue want.
- Close the output-serialization gap the #151 test exercises but the port
  omitted: register asMFJSON (via temporal_as_mfjson) and asBinary / asEWKB /
  asHexWKB / asHexEWKB (via temporal_as_wkb / temporal_as_hexwkb), with
  tpose-unique exec names. MobilityDB exposes all of these for tpose.
- Fix the setInterp-to-discrete test: a multi-instant continuous sequence
  cannot be discretized (MEOS errors); lift an instant instead, matching
  MobilityDB's 102_tpose reference.

Full sqllogictest suite green: 1830 assertions across 79 test cases.

(cherry picked from commit ec74d58)
Bring the temporal rigid geometry (trgeometry) type into MobilityDuck:
construction, text/EWKT/WKB I/O, casts and accessors, gated by the RGEO config
flag that mirrors the MEOS RGEO build module. Disabling RGEO drops the
trgeometry sources and its registration in LoadInternal. The MEOS calls use the
trgeo_* names exported by the pinned MEOS; MFJSON input binds to a MEOS symbol
the pinned MEOS does not yet expose, so it is omitted here.
@estebanzimanyi estebanzimanyi force-pushed the feat/trgeometry-port-core branch from cb39d26 to 744b0df Compare May 29, 2026 22:56
estebanzimanyi added a commit that referenced this pull request May 30, 2026
Enable -DPOINTCLOUD=ON in the MEOS vcpkg port so the temporal point
cloud types (tpcpoint/tpcpatch) can be built from the pinned MEOS.

The MEOS pointcloud module links the pgPointCloud archive libpc.a,
normally produced by pgPointCloud's autotools (./autogen.sh && configure
&& make), which cannot run here (no pg_config, no autotools-usable
PostgreSQL). The vendored pointcloud-pg/lib sources need only libxml2 and
zlib, and lib/Makefile builds libpc.a directly via ar. So the port now:

  - patches the upstream MEOS pcpoint.h/pcpatch.h DatumGetXxxP macros,
    which unconditionally use PG_DETOAST_DATUM (PostgreSQL-only) unlike
    every other type header, to DatumGetPointer under MEOS;
  - generates config.mk + lib/pc_config.h the way pgPointCloud's autotools
    would, with vcpkg's libxml2/zlib paths (CUnit/LazPerf disabled);
  - builds the libpc.a archive target directly;
  - renames libpc.a's stringbuffer_* symbols into a pc_stringbuffer_*
    namespace to avoid colliding with MEOS's bundled liblwgeom copy;
  - installs libpc.a alongside libmeos.a and propagates it (+ libxml2/zlib)
    through MEOS::meos's INTERFACE_LINK_LIBRARIES so consumers link cleanly.

Add libxml2/zlib to the meos port and project dependencies; bump the meos
port-version so vcpkg rebuilds it.
@estebanzimanyi estebanzimanyi force-pushed the feat/pointcloud-vcpkg-enabler branch from c5d4a61 to 6f7f6ba Compare May 30, 2026 17:33
Enable -DPOINTCLOUD=ON and -DH3=ON in the MEOS vcpkg port so the temporal
point cloud types (tpcpoint/tpcpatch) and the temporal H3 index can be built
from the pinned MEOS. The pin carries the extended-type stack (tbigint,
th3index, pgPointCloud) on the pre-rename trgeo C API the stack targets.

The MEOS pointcloud module links the pgPointCloud archive libpc.a, normally
produced by pgPointCloud's autotools, which cannot run here. The vendored
pointcloud-pg/lib sources need only libxml2 and zlib, and lib/Makefile builds
libpc.a directly via ar. So the port patches the upstream pcpoint.h/pcpatch.h
DatumGetXxxP macros to DatumGetPointer under MEOS, generates config.mk +
lib/pc_config.h with vcpkg's libxml2/zlib paths, builds the libpc.a archive
target directly with the stringbuffer_* symbols renamed into a pc_stringbuffer_*
namespace, installs libpc.a alongside libmeos.a, and propagates it (+ libxml2/
zlib) through MEOS::meos's INTERFACE_LINK_LIBRARIES. Adds the meos_h3.h install
rule and adds h3/libxml2/zlib to the meos port and project dependencies.
@estebanzimanyi estebanzimanyi force-pushed the feat/pointcloud-vcpkg-enabler branch from 6f7f6ba to 0399d81 Compare May 30, 2026 19:15
@estebanzimanyi estebanzimanyi force-pushed the feat/trgeometry-port-core branch from 744b0df to f053543 Compare June 2, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant