52

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

Hong Ooi
  • 56,353
  • 13
  • 134
  • 187
Adam Dahmani
  • 671
  • 1
  • 6
  • 5

7 Answers7

65

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
bourneli
  • 2,172
  • 4
  • 24
  • 40
  • 1
    Can you share your solution please? I am experiencing the same issue, even though I have installed readline and added the lib directory to my LD_LIBRARY_PATH I still get the same error – Dave Dec 06 '16 at 16:56
  • I have the same issue, and can't decide whether to turn it off after reading you suggestion. I'm installing in a system that does not have any kind of GUI, and can only be accessed via terminal (e.g. ssh). Would turning it off change the appearance of the interactive console? I'm considering also install R studio Server. – jimmymcheung Sep 23 '22 at 11:56
39

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..

andrewsi
  • 10,807
  • 132
  • 35
  • 51
Anup Ash
  • 935
  • 8
  • 14
16

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
Daniel H.
  • 1,782
  • 16
  • 18
13

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

falsetru
  • 357,413
  • 63
  • 732
  • 636
Dhanesh
  • 1,009
  • 1
  • 11
  • 16
5

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" \
1

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
Dr. Mian
  • 3,334
  • 10
  • 45
  • 69
1

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

Jeff
  • 113
  • 1
  • 8