[geos-devel] cmake detailed comments

Greg Troxel gdt at lexort.com
Thu Oct 14 07:02:03 PDT 2021


Sandro Santilli <strk at kbt.io> writes:

> On Wed, Oct 13, 2021 at 12:08:50PM -0400, Greg Troxel wrote:
>> 
>> Sandro Santilli <strk at kbt.io> writes:
>> 
>> > What do you mean by "I like how our tests work now" ? How do they work
>> > for you ? Are them guaranteed to be using the *just_built* (rather
>> > than the *installed*) libraries ?
>> 
>> I believe I've found a bug in running tests.  When one passes in
>> -W,-R/usr/foo/lib to the build (in LDFLAGS), the not-installed tests end
>> up having two RPATH entries:
>> 
>>   /usr/foo/lib
>>   /path/to/build/tree/lib
>> 
>> and they are ordered that way, resulting in libgeos_c being found in
>> /usr/foo/lib.
>
> Before I go on testing this let me please ask: why would you
> pass -W,-R/usr/foo/lib to the build ?

Well, you did test (thanks!), and you did reproduce the problem, but:

Stepping back from just thinking about geos, in the context of a
packaging system, there is a desire to do things in a way that works in
the general case, rather than tightly adapating to particular systems.

In general:

  ${PREFIX}/lib is not necessarily in the default linker search path

  a given package may depend on other libraries which are already in
  ${PREFIX}/lib as dependency packages

  build systems often either check for libraries with a test program
  with #include <foo.h> and compiled with -lfoo, and for this to work
  the -R needs to be present.

  some build systems just add -lfoo because it's documented they need
  them and don't check, and in that case -R needs to be present

and in the case of pkgsrc, passing -R in LDFLAGS as the standard
approach has survived the test of time in a system that runs on many (20
in theory, probably only 10 of which have users - HP-UX no longer
counts) systems with ~25K packages.

So there could be special logic to avoid it, but on the other hand it's
possible that on one of those systems pthreads is not part of the OS and
is a package that gets depended on, and thus it would be necessary.



I realize that the world is moving from "just use it" to "packages are
expected to use pkg-config", and that's a good thing as it's a single
uniform interface.  Packaging systems have to deal with such interfaces,
and do -- but it imposes a lot of work when there are boutique methods
to do things.  Fortunately geos is producing a pc file, and in general
things are getting more regularized.
-------------- 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/20211014/d2e10aef/attachment.sig>


More information about the geos-devel mailing list