[postgis-devel] linkage against libpq.so (Sandro Santilli)

Jeff Janes jeff.janes at gmail.com
Fri Oct 5 09:48:42 PDT 2012


(Sandro Santilli wrote:)
>
> On Thu, Oct 04, 2012 at 07:42:42PM -0700, Jeff Janes wrote:
>
>> ticket: http://trac.osgeo.org/postgis/ticket/1830
>
> [..]
>
>> What I don't understand is why it is linking against an ancient libpq
>> in the first place.  There is a perfectly modern libpq on my system,
>> and it is located right where pg_config says it is.  So why isn't that
>> one getting preferentially used?  postgis seems to be using pg_config
>> to pick up other configuration settings, just not this one.
>>
>> I poked around in the Makefiles, but I can't figure it out.
>
> Are you saying that PGSQL_FE_LDFLAGS in loader/Makefile is wrong ?

I think that it is set properly:

PGSQL_FE_LDFLAGS=-L/usr/local/pgsql/lib -lpq

lrwxrwxrwx. 1 root root 12 Sep 26 11:06
/usr/local/pgsql/lib/libpq.so.5 -> libpq.so.5.4

But for some reason, it does not seem to be taking effect.  If I do a
"make install" (despite make check failing), then run the link
debugger:

ldd /usr/local/pgsql/bin/pgsql2shp| fgrep pq
        libpq.so.5 => /usr/lib64/libpq.so.5 (0x0000003660800000)

lrwxrwxrwx. 1 root root 12 Oct  4 11:18 /usr/lib64/libpq.so.5 -> libpq.so.5.2

So it is linking against the old version anyway.

If I remove the rpm which is providing /usr/lib64/libpq.so.5 and then
redo the config, make, and make install from scratch, it still doesn't
link the appropriate libpq, now it links nothing at all:

ldd /usr/local/pgsql/bin/pgsql2shp| fgrep pq
        libpq.so.5 => not found



Thanks,

Jeff



More information about the postgis-devel mailing list