Thread: Trouble with readline compiling on Redhat 8.0

Trouble with readline compiling on Redhat 8.0

From
"David Busby"
Date:
List,
    I'm attempting to install PG 7.3 on my RedHat 8.0 box.
My RedHat install was minimal...but readline was installed.  I run my PG
configure script like this:
(in /usr/src/postgresql-7.3/)

./configure --prefix=/usr/local --bindir=/usr/local/bin --datadir=/usr/local
/share --enable-odbc --sysconfdir=/etc/pgsql --libdir=/usr/lib --includedir=
/usr/include --with-libs=/usr/lib --with-perl

That's how it should be for my system, as far as I know.
Now configure chokes and dies on readline with the following error message:

checking for readline... no
configure: error: readline library not found
If you have readline already installed, see config.log for details on the
failure.  It is possible the compiler isn't looking in the proper directory.
Use --without-readline to disable readline support.

psql is not that fun without readline, so I MUST have it, MUST.  I went
looking in config.log (it says to do that) and I see:

configure:5800: checking for readline
configure:5837: gcc -o conftest -O2     -L/usr/lib
conftest.c -lreadline -lcrypt -lresolv -lnsl -ldl -lm -lbsd  >&5
/usr/lib/libreadline.so: undefined reference to `tgetnum'
/usr/lib/libreadline.so: undefined reference to `tgoto'
/usr/lib/libreadline.so: undefined reference to `tgetflag'
/usr/lib/libreadline.so: undefined reference to `BC'
/usr/lib/libreadline.so: undefined reference to `tputs'
/usr/lib/libreadline.so: undefined reference to `PC'
/usr/lib/libreadline.so: undefined reference to `tgetent'
/usr/lib/libreadline.so: undefined reference to `UP'
/usr/lib/libreadline.so: undefined reference to `tgetstr'
collect2: ld returned 1 exit status
configure:5840: $? = 1
configure: failed program was:
#line 5811 "configure"
#include "confdefs.h"

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char readline ();
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
readline ();
  ;
  return 0;
}
configure:5837: gcc -o conftest -O2     -L/usr/lib
conftest.c -ledit -lcrypt -lresolv -lnsl -ldl -lm -lbsd  >&5
/usr/bin/ld: cannot find -ledit
collect2: ld returned 1 exit status
configure:5840: $? = 1
configure: failed program was:
#line 5811 "configure"
#include "confdefs.h"

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char readline ();
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
readline ();
  ;
  return 0;
}
configure:5837: gcc -o conftest -O2     -L/usr/lib
conftest.c -lreadline -ltermcap -lcrypt -lresolv -lnsl -ldl -lm -lbsd  >&5
/usr/bin/ld: cannot find -ltermcap
collect2: ld returned 1 exit status
configure:5840: $? = 1
configure: failed program was:
#line 5811 "configure"
#include "confdefs.h"

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"

All that looks like it can't load readline, cause of a problem with termcap
(or maybe curses?)
But then I look at my libreadline (from the RPM)
[root@localhost lib]# ldd /usr/lib/libreadline.so.4.3
        libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

That looks OK?  I don't see readline linking to termcap or curses (shouldn't
it?)
Here's my termcap & ncurses
[root@localhost lib]# ldd /lib/libtermcap.so.2.0.8
        libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
[root@localhost lib]# ldd /usr/lib/libncurses.so.5.2
        libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

Then I ran ld on libreadline, and I get this:
[root@localhost lib]# ld -lreadline
ld: warning: cannot find entry symbol _start; not setting start address
/usr/lib/libreadline.so: undefined reference to `tgetnum'
/usr/lib/libreadline.so: undefined reference to `tgoto'
/usr/lib/libreadline.so: undefined reference to `tgetflag'
/usr/lib/libreadline.so: undefined reference to `BC'
/usr/lib/libreadline.so: undefined reference to `tputs'
/usr/lib/libreadline.so: undefined reference to `PC'
/usr/lib/libreadline.so: undefined reference to `tgetent'
/usr/lib/libreadline.so: undefined reference to `UP'
/usr/lib/libreadline.so: undefined reference to `tgetstr'

Oh snap! what does that all mean?  Has anyone seen anything similar?  I've
built without readline for now, but I really really like that feature.
Should I just go to 7.3.1?  (is it stable? (or stable enough for someone who
runs latest PHP 4.3.0 and Apache 2.0.43 in production (nobody advises
that)?))  Perhaps my RedHat 8.0 is missing something?  (I see termcap and
ncurses) in `rpm -q`

Thanks In Advance
/B


Re: Trouble with readline compiling on Redhat 8.0

From
Michael Carmack
Date:
On Sun, Dec 29, 2002 at 03:37:57PM -0800, David Busby wrote:
> List,
>     I'm attempting to install PG 7.3 on my RedHat 8.0 box.
> My RedHat install was minimal...but readline was installed.  I run my PG
> configure script like this:

Force configure to pick up the ncurses libraries and headers. Compiling
with readline always requires ncurses now (as of v4.3 I think), even
though it doesn't show up in ldd.

m.



Re: Trouble with readline compiling on Redhat 8.0

From
Tom Lane
Date:
"David Busby" <busby@edoceo.com> writes:
>     I'm attempting to install PG 7.3 on my RedHat 8.0 box.
> My RedHat install was minimal...but readline was installed.

I think you need both libtermcap and libtermcap-devel.  Certainly
at least the former.

> Should I just go to 7.3.1?  (is it stable?

More so than 7.3 ...

            regards, tom lane

Fixed: Trouble with readline compiling on Redhat 8.0

From
"David Busby"
Date:
Tom, Michael, List,
    Thank you for the replies, I've got it working...incase anyone else
reading (or for the archives) the fix is:
for the '--with-libs' parameter add the location of both readline and
libtermcap.  On RedHat Linux 8.0 libreadline and libncurses are in
'/usr/lib' and libtermcap is in '/lib' so when building PostgreSQL 7.3 from
source on RedHat 8.0 with RPM versions of necessary stuff for PostgreSQL
installed...
Fix:
The '--with-libs' parameter for ./configure should be
'--with-libs=/lib:/usr/lib'.

/B


----- Original Message -----
From: "David Busby" <busby@edoceo.com>
To: <pgsql-general@postgresql.org>
Sent: Sunday, December 29, 2002 15:37
Subject: [GENERAL] Trouble with readline compiling on Redhat 8.0


> List,
>     I'm attempting to install PG 7.3 on my RedHat 8.0 box.
> My RedHat install was minimal...but readline was installed.  I run my PG
> configure script like this:
> (in /usr/src/postgresql-7.3/)
>
>
./configure --prefix=/usr/local --bindir=/usr/local/bin --datadir=/usr/local
>
/share --enable-odbc --sysconfdir=/etc/pgsql --libdir=/usr/lib --includedir=
> /usr/include --with-libs=/usr/lib --with-perl
>
> That's how it should be for my system, as far as I know.
> Now configure chokes and dies on readline with the following error
message:
>
> checking for readline... no
> configure: error: readline library not found
> If you have readline already installed, see config.log for details on the
> failure.  It is possible the compiler isn't looking in the proper
directory.
> Use --without-readline to disable readline support.
>
> psql is not that fun without readline, so I MUST have it, MUST.  I went
> looking in config.log (it says to do that) and I see:
>
> configure:5800: checking for readline
> configure:5837: gcc -o conftest -O2     -L/usr/lib
> conftest.c -lreadline -lcrypt -lresolv -lnsl -ldl -lm -lbsd  >&5
> /usr/lib/libreadline.so: undefined reference to `tgetnum'
> /usr/lib/libreadline.so: undefined reference to `tgoto'
> /usr/lib/libreadline.so: undefined reference to `tgetflag'
> /usr/lib/libreadline.so: undefined reference to `BC'
> /usr/lib/libreadline.so: undefined reference to `tputs'
> /usr/lib/libreadline.so: undefined reference to `PC'
> /usr/lib/libreadline.so: undefined reference to `tgetent'
> /usr/lib/libreadline.so: undefined reference to `UP'
> /usr/lib/libreadline.so: undefined reference to `tgetstr'
> collect2: ld returned 1 exit status
> configure:5840: $? = 1
> configure: failed program was:
> #line 5811 "configure"
> #include "confdefs.h"
>
> /* Override any gcc2 internal prototype to avoid an error.  */
> #ifdef __cplusplus
> extern "C"
> #endif
> /* We use char because int might match the return type of a gcc2
>    builtin and then its argument prototype would still apply.  */
> char readline ();
> #ifdef F77_DUMMY_MAIN
> #  ifdef __cplusplus
>      extern "C"
> #  endif
>    int F77_DUMMY_MAIN() { return 1; }
> #endif
> int
> main ()
> {
> readline ();
>   ;
>   return 0;
> }
> configure:5837: gcc -o conftest -O2     -L/usr/lib
> conftest.c -ledit -lcrypt -lresolv -lnsl -ldl -lm -lbsd  >&5
> /usr/bin/ld: cannot find -ledit
> collect2: ld returned 1 exit status
> configure:5840: $? = 1
> configure: failed program was:
> #line 5811 "configure"
> #include "confdefs.h"
>
> /* Override any gcc2 internal prototype to avoid an error.  */
> #ifdef __cplusplus
> extern "C"
> #endif
> /* We use char because int might match the return type of a gcc2
>    builtin and then its argument prototype would still apply.  */
> char readline ();
> #ifdef F77_DUMMY_MAIN
> #  ifdef __cplusplus
>      extern "C"
> #  endif
>    int F77_DUMMY_MAIN() { return 1; }
> #endif
> int
> main ()
> {
> readline ();
>   ;
>   return 0;
> }
> configure:5837: gcc -o conftest -O2     -L/usr/lib
> conftest.c -lreadline -ltermcap -lcrypt -lresolv -lnsl -ldl -lm -lbsd  >&5
> /usr/bin/ld: cannot find -ltermcap
> collect2: ld returned 1 exit status
> configure:5840: $? = 1
> configure: failed program was:
> #line 5811 "configure"
> #include "confdefs.h"
>
> /* Override any gcc2 internal prototype to avoid an error.  */
> #ifdef __cplusplus
> extern "C"
>
> All that looks like it can't load readline, cause of a problem with
termcap
> (or maybe curses?)
> But then I look at my libreadline (from the RPM)
> [root@localhost lib]# ldd /usr/lib/libreadline.so.4.3
>         libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
>
> That looks OK?  I don't see readline linking to termcap or curses
(shouldn't
> it?)
> Here's my termcap & ncurses
> [root@localhost lib]# ldd /lib/libtermcap.so.2.0.8
>         libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
> [root@localhost lib]# ldd /usr/lib/libncurses.so.5.2
>         libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
>
> Then I ran ld on libreadline, and I get this:
> [root@localhost lib]# ld -lreadline
> ld: warning: cannot find entry symbol _start; not setting start address
> /usr/lib/libreadline.so: undefined reference to `tgetnum'
> /usr/lib/libreadline.so: undefined reference to `tgoto'
> /usr/lib/libreadline.so: undefined reference to `tgetflag'
> /usr/lib/libreadline.so: undefined reference to `BC'
> /usr/lib/libreadline.so: undefined reference to `tputs'
> /usr/lib/libreadline.so: undefined reference to `PC'
> /usr/lib/libreadline.so: undefined reference to `tgetent'
> /usr/lib/libreadline.so: undefined reference to `UP'
> /usr/lib/libreadline.so: undefined reference to `tgetstr'
>
> Oh snap! what does that all mean?  Has anyone seen anything similar?  I've
> built without readline for now, but I really really like that feature.
> Should I just go to 7.3.1?  (is it stable? (or stable enough for someone
who
> runs latest PHP 4.3.0 and Apache 2.0.43 in production (nobody advises
> that)?))  Perhaps my RedHat 8.0 is missing something?  (I see termcap and
> ncurses) in `rpm -q`
>
> Thanks In Advance
> /B
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly


Re: Fixed: Trouble with readline compiling on Redhat 8.0

From
Tom Lane
Date:
"David Busby" <busby@edoceo.com> writes:
> Fix:
> The '--with-libs' parameter for ./configure should be
> '--with-libs=/lib:/usr/lib'.

[ scratches head... ] It works fine for me on RHL 8.0 without that.

On my system there's a symlink from /usr/lib/ to /lib, which perhaps
explains why it's okay here.  Are you missing this link?

lrwxrwxrwx    1 root     root           29 Nov  1 12:47 /usr/lib/libtermcap.so -> ../../lib/libtermcap.so.2.0.8*

            regards, tom lane

Re: Fixed: Trouble with readline compiling on Redhat 8.0

From
"David Busby"
Date:
Tom,
    [more head scratching]
    I have that link, repeat (in disbelief) That link is present.
My PgSQL was compiled from /usr/src as root should be able to find the
files, cause the link is there.  This doesn't make sense to me right now.
Is this a bug or just a differience in configuration?

----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "David Busby" <busby@edoceo.com>
Cc: <pgsql-general@postgresql.org>
Sent: Sunday, December 29, 2002 19:25
Subject: Re: [GENERAL] Fixed: Trouble with readline compiling on Redhat 8.0


> "David Busby" <busby@edoceo.com> writes:
> > Fix:
> > The '--with-libs' parameter for ./configure should be
> > '--with-libs=/lib:/usr/lib'.
>
> [ scratches head... ] It works fine for me on RHL 8.0 without that.
>
> On my system there's a symlink from /usr/lib/ to /lib, which perhaps
> explains why it's okay here.  Are you missing this link?
>
> lrwxrwxrwx    1 root     root           29 Nov  1 12:47
/usr/lib/libtermcap.so -> ../../lib/libtermcap.so.2.0.8*
>
> regards, tom lane