Opened 6 years ago

Closed 6 years ago

Last modified 6 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:

Description

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 Changed 6 years ago by Bborie Park

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

comment:2 Changed 6 years ago by pramsey

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/liblwgeom.la -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/liblwgeom.so -L/usr/local/lib /usr/local/lib/libproj.so /usr/local/lib/libgdal.so -L/usr/lib /usr/lib/libexpat.so /usr/lib/libgif.so /usr/lib/libjpeg.so -lpng -lpq -lz -lpthread -lrt -ldl /usr/local/lib/libgeos_c.so /usr/local/lib/libgeos.so -lc -lm
/usr/bin/ld: cannot find -lpq
collect2: ld returned 1 exit status
make[2]: *** [raster2pgsql] Error 1

comment:3 Changed 6 years ago by Bborie Park

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 Changed 6 years ago by Bborie Park

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 Changed 6 years ago by Bborie Park

Resolution: fixed
Status: assignedclosed

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

comment:6 Changed 6 years ago by robe

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