Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing the R interpeter and R as a shared library uder the same tree

I am a bit confused about how to install R (via compilation) as a shared library.

The instructions here (Rpy2) say that I should do the following:

  # <go to the R source directory>
  make distclean
  ./configure --enable-R-shlib
  make
  make install

but the first make (make distclean) would remove any previous installation of R under the same directory tree (e.g. the contents of the bin folder).

What if I want to use the same installation for the R interpreter and the shared libraries? For example, say I want to use the interpreter to install R packages, and then the shared library of the installation to call R (and those packages) from Rpy2.

Otherwise, how can I install R packages for use through Rpy2?

like image 448
Amelio Vazquez-Reina Avatar asked Nov 05 '12 01:11

Amelio Vazquez-Reina


People also ask

Do I need to install R before RStudio?

Regardless of your operating system, you should install R before installing RStudio.


1 Answers

./configure --enable-R-shlib

Will tell to build R's shared libraries in addition to what is normally built (the executable, the documentation, etc...)

Also

make install

will install R (default is /usr/local). This is where you'll want to find your R executable. Calling make distclean will only affect the build directory, not the installed R.

like image 135
lgautier Avatar answered Nov 16 '22 02:11

lgautier