Thread: BUG #5062: 8.4.1 compile fails on debian can't find libdl

BUG #5062: 8.4.1 compile fails on debian can't find libdl

From
"philip wright"
Date:
The following bug has been logged online:

Bug reference:      5062
Logged by:          philip wright
Email address:      zphw@de1.uga.duke.edu
PostgreSQL version: 8.4.1
Operating system:   Linux Debian Debian 4.1.2-25
Description:        8.4.1 compile fails on debian can't find libdl
Details:

./configure --prefix=/opt/pgsql8.4.1 -enable-integer-datetimes
--enable-thread-safety --with-openssl --with-perl
--with-libs=/opt/zlib/lib:/opt/openssl/lib
--with-includes=/opt/zlib/include:/opt/openssl/include

root@de2 /pkgs/postgresql-8.4.1 > cd /opt
root@de2 /opt > ls -ltra
total 712
drwxr-xr-x 22 root root   4096 2009-07-16 08:42 ..
drwxrwxr-x  5 zphw zphw   4096 2009-07-16 09:08 zlib-1.2.3
lrwxrwxrwx  1 zphw zphw     10 2009-07-16 09:09 zlib -> zlib-1.2.3
drwxrwxr-x  6 zphw zphw   4096 2009-07-16 09:20 openssl-0.9.8k
lrwxrwxrwx  1 zphw zphw     14 2009-07-16 09:24 openssl -> openssl-0.9.8k
drwxrwxr-x  7 zphw zphw   4096 2009-07-16 09:33 openssh-5.1p1
lrwxrwxrwx  1 zphw zphw     13 2009-07-16 09:33 openssh -> openssh-5.1p1
drwxrwxr-x  6 zphw zphw   4096 2009-08-31 11:25 perl
-rw-rw-r--  1 zphw zphw 692448 2009-08-31 11:42 perl_install_log.txt
drwxr-xr-x 10 root root   4096 2009-09-17 09:34 jdk1.6.0_16
lrwxrwxrwx  1 root root     11 2009-09-17 09:34 java -> jdk1.6.0_16
drwxr-xr-x  7 zphw root   4096 2009-09-17 09:34 .
root@de2 /opt >


root@de2 /opt > uname -a
Linux XXXXX 2.6.26-2-686 #1 SMP Sun Jun 21 04:57:38 UTC 2009 i686 GNU/Linux

root@de2 /opt > cat /proc/version
Linux version 2.6.26-2-686 (Debian 2.6.26-17) (dannf@debian.org) (gcc
version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)) #1 SMP Sun Jun 21
04:57:38 UTC 2009


Error at end of make

gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv
pg_ctl.o  -L../../../src/port -lpgport -L../../../src/interfaces/libpq -lpq
-L../../../src/port -L/opt/zlib/lib -L/opt/openssl/lib -Wl,--as-needed
-Wl,-rpath,'/opt/pgsql8.4.1/lib' -lpgport -lssl -lcrypto -lz -lreadline
-lcrypt -ldl -lm  -o pg_ctl
../../../src/interfaces/libpq/libpq.so: undefined reference to `dlsym'
../../../src/interfaces/libpq/libpq.so: undefined reference to `dlerror'
../../../src/interfaces/libpq/libpq.so: undefined reference to `dlopen'
../../../src/interfaces/libpq/libpq.so: undefined reference to `dlclose'
collect2: ld returned 1 exit status
make[3]: *** [pg_ctl] Error 1
make[3]: Leaving directory `/pkgs/postgresql-8.4.1/src/bin/pg_ctl'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/pkgs/postgresql-8.4.1/src/bin'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/pkgs/postgresql-8.4.1/src'
make: *** [all] Error 2


root@de2 /opt > locate libdl
/lib/libdl-2.7.so
/lib/libdl.so.2
/lib/i686/cmov/libdl-2.7.so
/lib/i686/cmov/libdl.so.2
/usr/lib/libdl.a
/usr/lib/libdl.so
/usr/lib/xen/libdl.a

Re: BUG #5062: 8.4.1 compile fails on debian can't find libdl

From
Tom Lane
Date:
"philip wright" <zphw@de1.uga.duke.edu> writes:
> Description:        8.4.1 compile fails on debian can't find libdl

Our Debian packager would certainly have complained before now if PG
didn't build on Debian.  I suspect that you have forgotten to install
some needed support files.  Does Debian have the equivalent of -devel
subpackages?  If so you're probably missing whatever -devel package
goes with libdl.

            regards, tom lane

Re: BUG #5062: 8.4.1 compile fails on debian can't find libdl

From
Dimitri Fontaine
Date:
Tom Lane <tgl@sss.pgh.pa.us> writes:

> "philip wright" <zphw@de1.uga.duke.edu> writes:
>> Description:        8.4.1 compile fails on debian can't find libdl
>
> Our Debian packager would certainly have complained before now if PG
> didn't build on Debian.  I suspect that you have forgotten to install
> some needed support files.  Does Debian have the equivalent of -devel
> subpackages?  If so you're probably missing whatever -devel package
> goes with libdl.

debian provides friendly package building tools:

  http://packages.debian.org/source/sid/postgresql-8.4

  # install all build dependancies for postgresql-8.4
  apt-get build-dep postgresql-8.4

  # build it with debian defaults etc
  apt-get source -b postgresql-8.4

  # or only get the sources
  apt-get source postgresql-8.4

If you want to tweak the debian options choices, see apt-build.

And if the problem is related to building client or server tools for
postgresql, then you have the -devel kind of packages:

  apt-get install postgresql-server-dev-8.4 libpq-dev

Regards,
--
dim

Re: BUG #5062: 8.4.1 compile fails on debian can't find libdl

From
pwright
Date:
Thanks I am doing it all the hard way.
I will do it again when I can find time.
pw

Dimitri Fontaine wrote:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>
>> "philip wright" <zphw@de1.uga.duke.edu> writes:
>>> Description:        8.4.1 compile fails on debian can't find libdl
>> Our Debian packager would certainly have complained before now if PG
>> didn't build on Debian.  I suspect that you have forgotten to install
>> some needed support files.  Does Debian have the equivalent of -devel
>> subpackages?  If so you're probably missing whatever -devel package
>> goes with libdl.
>
> debian provides friendly package building tools:
>
>   http://packages.debian.org/source/sid/postgresql-8.4
>
>   # install all build dependancies for postgresql-8.4
>   apt-get build-dep postgresql-8.4
>
>   # build it with debian defaults etc
>   apt-get source -b postgresql-8.4
>
>   # or only get the sources
>   apt-get source postgresql-8.4
>
> If you want to tweak the debian options choices, see apt-build.
>
> And if the problem is related to building client or server tools for
> postgresql, then you have the -devel kind of packages:
>
>   apt-get install postgresql-server-dev-8.4 libpq-dev
>
> Regards,