Bug 25 - configure fails on Fedora 7
Summary: configure fails on Fedora 7
Status: RESOLVED FIXED
Alias: None
Product: Slony-I
Classification: Unclassified
Component: other scripts (show other bugs)
Version: 1.2
Hardware: Other Other
: medium major
Assignee: Slony Bugs List
URL: http://lists.slony.info/pipermail/slo...
Depends on:
Blocks:
 
Reported: 2007-12-05 19:00 UTC by Chad
Modified: 2007-12-11 13:28 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chad 2007-12-05 19:00:52 UTC
Building Slony-I 1.2.12 on Fedora 7 against PostgreSQL 8.2.5 as shipped.

Build log entries:
Wed Dec  5 18:09:30 MST 2007
Configure of slony fails,
 configure: error: Your version of libpq doesn't have PQunescapeBytea
 this means that your version of PostgreSQL is lower than 7.3
 and thus not supported by Slony-I.

I believe this is because configure thinks it found libpq in
/usr/lib, but since the PostgreSQL we're running is the x86_64
version it should be looking in /usr/lib64.  Let's see if we can
force that.

Should be able to use
  --with-pglibdir=/usr/lib64
with configure, but doesn't seem to work.  We know the symbol is in
there:
  cd /usr/lib64
  nm -D libpq.so.5 | grep PQunescapeBytea
    00000033d680af00 T PQunescapeBytea

Wed Dec  5 19:38:31 MST 2007
Ok, here's the deal.  configure is looking for that symbol by
compiling a little program that calls for it, and checking if the 
compile succeeds.  On the gcc command line it uses -lpq to search
for the library.  On our Fedora 7, the default behavior is to build
x86_64 (64-bit) programs, which means the configuration test program
should be linked against the libraries in /usr/lib64 instead of
/usr/lib.  The linker tries to do that, looking for
"/usr/lib64/libpq.so", but that doesn't exist.  There is a
libpq.so.5 and a libpq.so.5.0.  I believe the Fedora
postgresql-libs.x86_64 package is missing a symlink
/usr/lib64/libpq.so -> libpq.so.5.0

We prove it by extracting the conftest.c program configure generated
from the config.log, compiling it (gcc -c conftest.c) and then
linking it using the path to the library rather than -lpq (gcc -o
conftest conftest.o /usr/lib64/libpq.so.5.0).  That works.  So the
error message is misleading.  The compile of the test program failed
because the linker couldn't find the right library, not because the
library didn't contain the needed routine.

Adding the symlink, running configure again.

Success.  Slony developers should know (add to FAQ?) and whomever builds the
postgresql-libs.x86_64 yum package should add the creation of the symlink.
Comment 1 Christopher Browne 2007-12-11 12:41:04 UTC
Will add to FAQ.
Comment 2 Christopher Browne 2007-12-11 13:28:25 UTC
Added documentation to FAQ.