Thread: Installation on CentOS 5.2 (readline trouble)

Installation on CentOS 5.2 (readline trouble)

From
Carlos Moreno
Date:
Hi,

I just downloaded the latest, 8.3.4, and I'm trying to install it on
a CentOS 5.2 machine with all the updates  (64-bit --- the system
is an Opteron DC)

The configure script fails reporting it doesn't find readline.

The package readline-devel *is* installed, and indeed the .so
file is under /usr/lib and /usr/lib64

The problem seems to be with readline dependencies:  if I try
a dummy program (i.e., a file with a main that says return 0;)
and compile it with readline:

[ ... ]$ gcc -o tt test.c -lreadline

I get the following bunch of errors:

 gcc -o tt test.c -lreadline
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so:
undefined reference to `PC'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so:
undefined reference to `tgetflag'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so:
undefined reference to `tgetent'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so:
undefined reference to `UP'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so:
undefined reference to `tputs'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so:
undefined reference to `tgoto'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so:
undefined reference to `tgetnum'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so:
undefined reference to `BC'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so:
undefined reference to `tgetstr'

I know the problem seems to be more a CentOS or RH specific
thing, than a PostgreSQL specific one, but I guess someone out
here may have run into this, and perhaps have some suggestions?

I also tried with libedit  (downloaded it from sourceforge, since I
could not find RPM packages native to the distribution).  Anyway,
I get the exact same error --- configure reports the same error, and
the little test program, when compiled with -ledit instead of
-lreadline, produces almost the same error messages (six of the
above lines --- the ones in lowercase, coincidentally)

The installation was completed with the switch --without-readline,
except that the functionality is somwhat crippled, so I'd much
rather avoid the issue.

Thanks for any tips/pointers!

Carlos
--


Re: Installation on CentOS 5.2 (readline trouble)

From
"Scott Marlowe"
Date:
On Mon, Oct 6, 2008 at 7:17 PM, Carlos Moreno <morenopg@mochima.com> wrote:
>
> Hi,
>
> I just downloaded the latest, 8.3.4, and I'm trying to install it on
> a CentOS 5.2 machine with all the updates  (64-bit --- the system
> is an Opteron DC)
>
> The configure script fails reporting it doesn't find readline.

Why not just install the PGDG RHEL 5 rpms?  They work just fine for me
on CentOS 5.2

Re: Installation on CentOS 5.2 (readline trouble)

From
Greg Smith
Date:
On Mon, 6 Oct 2008, Carlos Moreno wrote:

> The configure script fails reporting it doesn't find readline.
> The package readline-devel *is* installed, and indeed the .so
> file is under /usr/lib and /usr/lib64

If I remember correctly this happens if you try to build from source but
are missing ncurses-devel on CentOS 5.  (search search search) Ah, here's
an example that looks like yours that says the same thing:
http://www.mail-archive.com/sqlite-users@sqlite.org/msg07533.html

--
* Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD

Re: Installation on CentOS 5.2 (readline trouble)

From
Tom Lane
Date:
Carlos Moreno <morenopg@mochima.com> writes:
> I just downloaded the latest, 8.3.4, and I'm trying to install it on
> a CentOS 5.2 machine with all the updates  (64-bit --- the system
> is an Opteron DC)

> The configure script fails reporting it doesn't find readline.

libreadline depends on libtermcap in RHEL-5, but so far as I can see
this dependency is explicit in the RPM, so it shouldn't have been
possible to not install termcap.  (However, I'm not sure just how bright
the dependency solver was in RHEL-5 ... maybe it let you install a
64-bit readline but only the 32-bit version of termcap?)

If you're sure both libraries are there, please show the config.log
output that's probing for readline and not finding it.

            regards, tom lane

Re: Installation on CentOS 5.2 (readline trouble)

From
Carlos Moreno
Date:
Tom Lane wrote:
>
> libreadline depends on libtermcap in RHEL-5, but so far as I can see
> this dependency is explicit in the RPM, so it shouldn't have been
> possible to not install termcap.  (However, I'm not sure just how bright
> the dependency solver was in RHEL-5 ... maybe it let you install a
> 64-bit readline but only the 32-bit version of termcap?)
>

I suspected something like that after the results of a Google
search (before posting here) --- I tried termcap-devel, and it
tells me that there's no such package;  then I noticed that
there is the package termcap, and also libtermcap, with the
accompanying libtermcap-devel.

Turns out that, as Greg pointed out, it was the missing
ncurses-devel.

Strangely enough, the little dummy test program still reports
the exact same errors when compiling with -lreadline.   But
PostgreSQL's configure script now runs successfully!


Thanks, and thanks Greg for the valuable tip !

Carlos
--