[geos-devel] Is GEOS 3.11 C-API upward compatible with GEOS 3.9.0

Greg Troxel gdt at lexort.com
Sun Dec 5 15:45:15 PST 2021

"Regina Obe" <lr at pcorp.us> writes:

> I was always under the assumption that the C-API should be upward compatible
> (only the C++ API is unstable).


> Normally  I can do the following:
> Compile PostGIS with GEOS say 3.9.0
> Launch my PostgreSQL with GEOS 3.9.0
> Then launch again with newer GEOS - in this case GEOS 3.11.

That is not about API stability.  It is about having the same ABI

> So my PostGIS is compiled with GEOS 3.9.0, but it should work with GEOS
> 3.11.

You presumably have swapped out the geos implementation?  How?

> What I am finding is it is not.  I thought maybe I had the paths wrong so I
> double-checked a couple of times.
> This is what I get when I swap out the older GEOS 3.9.0 with newer GEOS 3.11
> (main branch)
> And then run any PostGIS function.
> ERROR:  could not load library
> "C:/ming64gcc81/projects/postgresql/rel/pg14w64gcc81/lib/postgis-3.2.dll":
> The specified module could not be found.

Well, your real problem is that you are using windows!

That error doesn't show what couldn't be found, and I'd suggest the
equivalent of objdump and ldd.

> I then tried to swap with GEOS 3.10.0  and that worked okay.
> POSTGIS="3.2.0dev 3.2.0beta3-2-g0b32bdd14" [EXTENSION] PGSQL="140"
> GEOS="3.10.0-CAPI-1.16.0" PROJ="7.2.1" GDAL="GDAL 3.3.3, released
> 2021/10/25" LIBXML="2.9.9" LIBJSON="0.12" LIBPROTOBUF="1.2.1" WAGYU="0.5.0
> GEOS 3.10.1 - errors
> ERROR:  could not load library
> "C:/ming64gcc81/projects/postgresql/rel/pg14w64gcc81/lib/postgis-3.2.dll":
> The specified module could not be found.
> Can someone confirm that?  If it's just an issue with PostGIS 3.2, I guess
> that is okay, though I would think it would mean just the newer features
> like MakeValid would not be enabled by swapping out with a newer GEOS, but
> it shouldn't break install.  Also why GEOS 3.10.0 works and GEOS 3.10.1
> doesn't is very concerning.

But seriously, that doesn't sound right.

One issue is that the c library has a (on POSIX) DT_NEEDED for the C++,
and sometimes (libtool?) when building a program that links with
libgeos_c, the libraries that libgeos_c depend on are also added at
DT_NEEDED to the program.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20211205/fe571669/attachment.sig>

More information about the geos-devel mailing list