Adam Dahmani
Adam Dahmani

Reputation: 731

error: --with-readline=yes (default) and headers/libs are not available

I am installing R. I am getting this error when runing ./configure :

checking for history_truncate_file... no
configure: error: --with-readline=yes (default) and headers/libs are not available

Any hint, Thanks

Upvotes: 58

Views: 64591

Answers (8)

NiallJG
NiallJG

Reputation: 1961

I fixed this error by installing the ncurses 6.2 package available here : https://ftp.gnu.org/gnu/ncurses/

When you run the configure script, the step here fails :

checking for rl_callback_read_char in -lreadline... no

With ncurses installed, configure can proceed a few steps later

checking for rl_callback_read_char in -lreadline... no
checking for main in -lncurses... yes
checking for rl_callback_read_char in -lreadline... yes

Upvotes: 0

Jeff
Jeff

Reputation: 113

The error means your system cannot find the required package. On Ubuntu, you can refer to this document to install all missing dependencies. It works for R 4.0

https://github.com/Jiefei-Wang/Painless-R-compilation-and-installation-on-Ubuntu

Upvotes: 1

drmaa
drmaa

Reputation: 3684

On Centos 7, building R-3.5.0, If you want to install in /data/R-3.0.5.

wget https://www.stats.bris.ac.uk/R/src/base/R-3/R-3.5.0.tar.gz
tar -zxvf R-3.5.0.tar.gz
cd R-3.5.0.tar.gz
mkdir -p /data/R-3.0.5   
yum group install "Development tools" -y
yum install readline-devel -y
yum install xorg-x11-server-devel libX11-devel libXt-devel -y
yum yum install libbz2-devel -y
yum install lzma -y
yum install xz xz-devel -y
yum install pcre pcre-devel -y
yum install libcurl-devel -y
yum install texinfo -y
yum install texinfo-tex -y
yum install texlive -y
yum install texlive-fonts-extra -y
yum install levien-inconsolata-fonts -y
yum install java-1.8.0-openjdk -y

./configure --prefix=/data/R-3.0.5 '--with-cairo' \
'--with-jpeglib' '--with-readline' '--with-tcltk' \
'--with-blas' '--with-lapack' '--enable-R-profiling' \
'--enable-R-shlib' \
'--enable-memory-profiling'

make
make install

Upvotes: 2

bourneli
bourneli

Reputation: 2230

Use the following command will solve this problem

./configure --with-readline=no --with-x=no

--with-x=no turns off the X Windows System . It is the GUI for the Linux and Unix-like OS. My computer has no X Windows installed, so I turn off.
But I highly recommand to install readline library before R installtion with '--with-readline=yes', as the command operation style is quitely unfriendly with '--with-readline=no' . See more libreadline installation in linux for more details

you can use the following command for more install configuration details

./configure --help

Upvotes: 70

Anup Ash
Anup Ash

Reputation: 964

on I found problem on compiling R 3.1.1 so as a part of solution , i recommend to install the below libraries first before you compile this R and use

sudo apt-get install build-essential
sudo apt-get install fort77
sudo apt-get install xorg-dev
sudo apt-get install liblzma-dev  libblas-dev gfortran
sudo apt-get install gcc-multilib
sudo apt-get install gobjc++
sudo apt-get install aptitude
sudo aptitude install libreadline-dev

Thank you other people who posted and kept the knowledge going..

Upvotes: 41

Dhanesh
Dhanesh

Reputation: 1049

On Linux version 2.6.18-371.3.1.el5 (centos) the following worked for me

yum install readline-devel 

and use --with-x=no in configure option as mentioned by others

Upvotes: 13

I added this in the file taken here: http://www.personal.psu.edu/mar36/blogs/the_ubuntu_r_blog/2012/08/installing-the-development-version-of-r-on-ubuntu-alongside-the-current-version-of-r.html

CXXFLAGS="-ggdb -pipe -Wall -pedantic -I/usr/include/readline5" \
CPPFLAGS="-I/usr/include/readline5" \
LDFLAGS="-L/usr/lib64/readline5" \

Upvotes: 5

Daniel H.
Daniel H.

Reputation: 1842

I think you need the GNU readline package. You can install it with apt-get, aptitude, or the appropiate tool for your distribution. In Ubuntu:

aptitude install libreadline-dev

Upvotes: 16

Related Questions