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?
Regardless of your operating system, you should install R before installing RStudio.
./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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With