Skip to content

Linking h3-pg against the system libh3 #206

Description

@df7cb

The h3-pg Debian package has been patched to properly link against a packaged version of libh3:

https://salsa.debian.org/postgresql/h3-pg/-/blob/master/debian/patches/include-dir?ref_type=heads
https://salsa.debian.org/postgresql/h3-pg/-/blob/master/debian/patches/use-system-libh3?ref_type=heads

So far, that worked.

The new h3-pg version 4.5.0 seems to require a lot of internal h3 headers beyond h3api.h though:

[ 49%] Linking C shared module h3.so
cd /home/myon/projects/postgresql/h3-pg/h3-pg/build-18/h3 && /usr/bin/cmake -E cmake_link_script CMakeFiles/postgresql_h3.dir/link.txt --verbose=1
/usr/lib/ccache/cc -fPIC -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/home/myon/projects/postgresql/h3-pg/h3-pg=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -flto=auto -fno-fat-lto-objects -shared -Wl,-z,relro -Wl,--dependency-file=CMakeFiles/postgresql_h3.dir/link.d  -o h3.so CMakeFiles/postgresql_h3.dir/src/binding/edge.c.o CMakeFiles/postgresql_h3.dir/src/binding/hierarchy.c.o CMakeFiles/postgresql_h3.dir/src/binding/indexing.c.o CMakeFiles/postgresql_h3.dir/src/binding/inspection.c.o CMakeFiles/postgresql_h3.dir/src/binding/miscellaneous.c.o CMakeFiles/postgresql_h3.dir/src/binding/regions.c.o CMakeFiles/postgresql_h3.dir/src/binding/traversal.c.o CMakeFiles/postgresql_h3.dir/src/binding/vertex.c.o CMakeFiles/postgresql_h3.dir/src/algos.c.o CMakeFiles/postgresql_h3.dir/src/deprecated.c.o CMakeFiles/postgresql_h3.dir/src/extension.c.o CMakeFiles/postgresql_h3.dir/src/guc.c.o CMakeFiles/postgresql_h3.dir/src/init.c.o CMakeFiles/postgresql_h3.dir/src/opclass_btree.c.o CMakeFiles/postgresql_h3.dir/src/opclass_gist.c.o CMakeFiles/postgresql_h3.dir/src/opclass_hash.c.o CMakeFiles/postgresql_h3.dir/src/opclass_spgist.c.o CMakeFiles/postgresql_h3.dir/src/operators.c.o CMakeFiles/postgresql_h3.dir/src/srf.c.o CMakeFiles/postgresql_h3.dir/src/type.c.o ../include/CMakeFiles/postgresql_h3_shared.dir/error.c.o  /usr/lib/x86_64-linux-gnu/libpq.so -lh3 /usr/lib/x86_64-linux-gnu/libpq.so
/home/myon/projects/postgresql/h3-pg/h3-pg/h3_postgis/src/wkb_regions.c:25:10: fatal error: linkedGeo.h: Datei oder Verzeichnis nicht gefunden
   25 | #include <linkedGeo.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
In file included from /home/myon/projects/postgresql/h3-pg/h3-pg/h3_postgis/src/wkb_vertex_graph.c:24:
/home/myon/projects/postgresql/h3-pg/h3-pg/h3_postgis/src/wkb_vertex_graph.h:21:10: fatal error: latLng.h: Datei oder Verzeichnis nicht gefunden
   21 | #include <latLng.h>
      |          ^~~~~~~~~~
compilation terminated.

I can make the libh3.deb package contain these files, but then I still have to do a lot of patching to fix the paths to the header files.

Is there any chance to have this use case officially supported?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions