Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#2057 closed defect (fixed)

Raster build ignores pg_config info

Reported by: pramsey Owned by: Bborie Park
Priority: critical Milestone: PostGIS 2.0.2
Component: raster Version: 2.0.x
Keywords: history Cc:


From IRC:

fullstop: The configure script for 2.0.1 doesn't use the info from pg_config for the raster stuff.
fullstop: It will fail to find -lpq unless it is in, say, /usr/lib
fullstop: Adding -L/path/to/pgsql/lib in the Makefile works around this, but I'm guessing that the configure script is slightly broken.

Change History (6)

comment:1 by Bborie Park, 12 years ago

Owner: changed from pracine to Bborie Park
Priority: mediumcritical
Status: newassigned

comment:2 by pramsey, 12 years ago

Failure looks like this

make[2]: Entering directory `/home/postgresa/postgis-2.0.1/raster/loader'
/bin/bash ../../libtool --mode=link gcc -g -O2  -fPIC -DPIC  -Wall -Wmissing-prototypes -I../rt_core -I../../liblwgeom  -I/usr/local/include -I/usr/local/include   raster2pgsql.o ../rt_core/librtcore.a ../rt_core/librtcore.a ../../liblwgeom/ -L/usr/local/lib -lgdal -L/usr/local/lib -lgeos_c  -lc -lm -o raster2pgsql
libtool: link: gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -I../rt_core -I../../liblwgeom -I/usr/local/include -I/usr/local/include raster2pgsql.o -o .libs/raster2pgsql  ../rt_core/librtcore.a ../../liblwgeom/.libs/ -L/usr/local/lib /usr/local/lib/ /usr/local/lib/ -L/usr/lib /usr/lib/ /usr/lib/ /usr/lib/ -lpng -lpq -lz -lpthread -lrt -ldl /usr/local/lib/ /usr/local/lib/ -lc -lm
/usr/bin/ld: cannot find -lpq
collect2: ld returned 1 exit status
make[2]: *** [raster2pgsql] Error 1

comment:3 by Bborie Park, 12 years ago

By the looks of libtool's debug output, it is GDAL's dependency on libpq that brings the -lpq flag. But it looks like -L indicating where the libpq that GDAL was linked to isn't being set. So, going to have to force for the libpq that PostGIS is linking to.

comment:4 by Bborie Park, 12 years ago

The most likely scenario is that GDAL was compiled against a different PostgreSQL and/or PostgreSQL installed in a different location. So when the raster2pgsql is being linked, the PostgreSQL that GDAL was linked against doesn't exist anymore…

comment:5 by Bborie Park, 12 years ago

Resolution: fixed
Status: assignedclosed

Fixed in r10484 for 2.0. Fixed in r10485 for -trunk.

comment:6 by robe, 11 years ago

Keywords: history added
Note: See TracTickets for help on using tickets.