Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install R from source

Tags:

r

I'm trying to install R from source in my home directory on a server running CentOS.

I do not have root rights, and I'm not permitted to write to `usr/local/include/'.

I use the following code:

 wget http://cran.rstudio.com/src/base/R-3/R-3.2.0.tar.gz
 tar xvf R-3.2.0.tar.gz
 cd R-3.2.0
 ./configure --prefix=$HOME/R

In configuration step, I get error

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

In my understanding, it tells me that readline library is not available. So I try to install readline. I downloaded tar.gz file. and then I use the following command

 tar xvf readline-6.3.tar.gz
 cd readline-6.3
 ./configure --prefix=$HOME/readline
 make
 make install

Things are fine, and there's an additional folder in my home directory named "readline".

When I go back and try to configure R again, I still get the same error message. How can I fix it?

like image 332
Chen Avatar asked Aug 23 '26 05:08

Chen


1 Answers

Try using these flags for your ./configure script

CXXFLAGS="-ggdb -pipe -Wall -pedantic -I/path/readline/6.3/include"
CPPFLAGS="-I/path/readline/6.3/include"
LDFLAGS="-L/path/readline/6.3/lib"

Then if you get an error about X11, set --with-x=no and try again.

like image 186
Sebastian Avatar answered Aug 25 '26 15:08

Sebastian