[postgis-tickets] [PostGIS] #2345: Postgis subbornly ignores specific instructions to link libraries like a child with severe ADHD
PostGIS
trac at osgeo.org
Wed May 29 01:54:38 PDT 2013
#2345: Postgis subbornly ignores specific instructions to link libraries like a
child with severe ADHD
---------------------------------------------+------------------------------
Reporter: thx1138 | Owner: pramsey
Type: defect | Status: new
Priority: high | Milestone: PostGIS 2.1.0
Component: postgis | Version: trunk
Keywords: compiler,rpath,shared libraries |
---------------------------------------------+------------------------------
Version 2.1.0SVN (today)
OS Ubuntu 12.10 Server AMD64
GEOS: 3.4.0DEV
GDAL: 1.10.0
I have spent the past few days of my life trying to figure out how to get
postgis to function properly with a non-standard directory installation of
postgres 9.3, but have been unable to resolve the following obnoxious
errors:
ERROR: could not load library
"/pginstall/postgresql93/lib/postgis-2.1.so": libgeos_c.so.1: cannot open
shared object file: No such file or directory
********** Error **********
ERROR: could not load library
"/pginstall/postgresql93/lib/postgis-2.1.so": libgeos_c.so.1: cannot open
shared object file: No such file or directory
SQL state: 58P01
I installed geos,gdal and postgres into self-contained directories in
order to be able to update components without needing to manually find
individual files and remove them.
Thus my libraries would be located in the following installation
directories:
/pginstall/postgresql93/lib
/pginstall/gdal110/lib
/pginstall/geos34/lib
All other dependencies are installed using standard apt packages and I am
using the standard build-essential package.
I tried setting various environment variables
export LD_LIBRARY_PATH=/pginstall/geos34/lib:/pginstall/gdal110/lib
export
LDFLAGS="-Wl,-rpath,/pginstall/geos34/lib/,-rpath,/pginstall/postgresql93/lib,-rpath,/pginstall/gdal110/lib"
export
LDFLAGS="-Wl,L,/pginstall/geos34/lib,L,/pginstall/postgresql93/lib,L,/pginstall/gdal110/lib"
export LDFLAGS="-L/pginstall/geos34/lib
-Wl,-rpath,/pginstall/geos34/lib"
export
LDFLAGS="-Wl,-rpath,/pginstall/geos34/lib/,-rpath,/pginstall/gdal110/lib"
But they all failed to work with the configuration below
./configure \
--prefix=/pginstall/postgresql93 \
--with-pgconfig=/pginstall/postgresql93/bin/pg_config \
--with-geosconfig=/pginstall/geos34/bin/geos-config \
--with-gdalconfig=/pginstall/gdal110/bin/gdal-config \
--with-topology \
--with-raster
I did manage to get this working by adding the LD_LIBRARY_PATH variable to
my upstart configuration for postgres --but this is a crude hack and is
clearly not suitable for any kind of pre-production or production
environment. I don't want to go the ldconfig route either, as that
requires root access which is unnecessary.
I can verify that this issue is that the postgis configure process is
ignoring my direct commands to add the paths to the binaries, by running
the following command:
chrpath -l /pginstall/postgis/postgis-2.1.0SVN/postgis/postgis-2.1.so
which yields
RPATH=/pginstall/postgresql93/lib
The LDFLAG commands work when compiling GDAL with GEOS and Postgres, so I
believe this is a postgis specific issue.
One would assume that postgis should know where the libraries are, given
that I set them explicitly in the configure step and after concurrently
setting LD_LIBRARY_PATH and LD_FLAGS. This is pretty depressing. What more
should one need to specify?
Is there a workaround?
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2345>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list