Skip to content

readline detection problems

6 messages · Benjamin Otto, Brian Ripley, Hin-Tak Leung

#
Moved to R-devel: please see the posting guide.  This WAY off topic for 
R-help.

Please do read the installation manual:  configure --help says

   --with-readline         use readline library (if available) [yes]

and note, no path can be specified.  The installation manual says

   If you have libraries and header files, e.g., for GNU readline, in
   non-system directories, use the variables LDFLAGS (for libraries, using
   `-L' flags to be passed to the linker) and CPPFLAGS (for header files,
   using `-I' flags to be passed to the C/C++ preprocessors), respectively,
   to specify these locations. These default to LDFLAGS=-L/usr/local/lib
   (/usr/local/lib64 on most 64-bit Linux OSes) and
   CPPFLAGS=-I/usr/local/include to catch the most common cases.

My guess is that you need something like

CPPFLAGS=-I/usr/local/include -I/home3/fa/faga001/vol/readline-5.1/include
LDFLAGS=-L/usr/local/lib -L/home3/fa/faga001/vol/readline-5.1/lib

If this really is readline-5.1, don't use it.  It needs a patch (I believe 
the one found on the GNU mirror suffices) or it is badly broken, enough to 
crash the calling application.
On Thu, 2 Feb 2006, Benjamin Otto wrote:

            

  
    
#
Dear Mr. Ripley,

thanks for the quick reply. I set these flags now, however there still seem
to be some problems with readline. The corresponding cofigure output is:

checking readline/history.h usability... yes
checking readline/history.h presence... yes
checking for readline/history.h... yes
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
checking for rl_callback_read_char in -lreadline... no
checking for main in -lncurses... no
checking for main in -ltermcap... yes
checking for rl_callback_read_char in -lreadline... no
checking for history_truncate_file... no
configure: error: --with-readline=yes (default) and headers/libs are not
available

The existing compiler is gcc version 2.8.1 and the linker editor used by gcc
is an IRIX ld version 7.30. By the way I had read the installation manual
and already patched readline 5.1.
The lpack linking

--with-lapack="-L/path/to/libs -llapack -lcblas"

was the reason why I thought I could at least give it a try with the command

--with-readline="-L/$HOME/vol/readline"

However, I admit I missed the passage about the LDFLAGS and should have
search more thoroughly in the docu. Still I'm a little bit confused where
the current remaining problem is. I gave it a try with readline 5.0, which
seem to me to be the newest version not needing any patches, same problem.
Is this some compiler and linker problem?

regards,
benjamin


 which was the reason why I thought I could give it
#
On Fri, 3 Feb 2006, Benjamin Otto wrote:

            
What does config.log say?  It looks like it is not finding libreadline.so.
You may need LD_LIBRARY_PATH set to include where it is.
Wow, that is really old!

  
    
#
look into config.log towards the end - it gives you the details of what
happened during the failed configure. (the file is created by configure
as it runs).

As for consistency of what --someopt should take, it is all part of
the mess of autoconf. You could read it up at http://www.gnu.org/ and 
look for autoconf docs there.

Prof Ripley had already give you CPPFLAGS and LDFLAGS ; if in doubt, 
stick the -I<readline_include_loc> and -L<readlne_lib_loc>  into CFLAGS 
  FFLAGS and CXXFLAGS as well, like

CFLAGS= -I/home3/fa/faga001/vol/readline-5.1/include \
-L/home3/fa/faga001/vol/readline-5.1/lib

I suspect what you needed was CFLAGS, rather than CPPFLAGS .
This is barbaric, but the alternative is that you'll need to understand
how autoconf works, which is not a easy task.

Good luck.

HTL
Benjamin Otto wrote:
#
Prof Brian Ripley wrote:
LD_LIBRARY_PATH affects the dynamic link loader, which is probably not
the issue here. the barbaric manipulation of CFLAGS (=-I and -L)
is needed.
2.8.1 would be pre-cygnus/egcs , 1997-1998 ... should breath down the 
sys-admin's neck to get it upgraded - ncurse, termcap, tcltk, etc
would be rather old as well...
5 days later
#
Dear Mr. Ripley, Mr. Leung, Mrs. Hawkins,

many thanks for the intensive help you provided me concerning the readline
problem although I should have looked in the installation manual more
thoroughly. It turned out as you already suspected that the problem with
getting the configure script detecting the new readline library could be
easily solved by setting the CFLGAS. In fact, setting the CPPFLGAS and
LDFLAGS alone results in detection of the header files but not the library
files.

On the other hand setting the CFLAGS alone seems to be enough for the
detection of both library and header files thus solving the problem without
necessity of the previous two flags. However that seems to apply only for
the configure script. Under native conditions with the flags set the make
command fails in locating the -lreadline flag during compilation. I suppose
that should be solved with linking the library via ldconfig in a personal
local cache file. I'm working on that.


regards,
Benjamin Otto