I'm trying to create a self-contained R installation, that I can put on a USB or archive and share with my colleagues who don't want to go to the trouble of installing R on their computer and all the packages I have.
I did some research and found these posts:
I tried out the solutions in the 2nd and 3rd posts on my Ubuntu box, doing make install
to a custom location and then either A). Using sed to edit the installed bin/R as in the second post, or B). Modifying the beginning of the installed bin/R according to the suggestion in the third post. On Ubuntu or other Linux this gives me a folder containing and installation of R's bin, lib, and share folders, which should be self-contained and can be moved about, put on USB and onto a different Ubuntu box.
I would like to achieve a similar result but for my Macbook Pro and OS X. When you make install
R to a custom location with --prefix
in OS X, instead of the three bin, lib, share folders you see in Linux, there is a folder called lib, and something called R.framework. The lib folder contains a folder called pkgconfig, containing a file called libR.pc. R.framework contains some symlinks and a Versions directory. This Versions directory contains a symlink called Current, and then a series of folders containing various versions of R. Each of these version folders contains a symlink called Headers, one called PrivateHeaders (containing a load of header files), and one called Resources. Finally this Resources folder contains the folders like bin, etc, share, and so on, like the R source folder.
I am unfamiliar with this OS X structure. So I would like to know, what do I need to do, now that I have make install
ed R to a local folder on OS X? I think in principle it should be like the fix for Linux - editing the paths in the bin/R script R_ROOT_DIR. However, I'm unfamiliar with these .framework things, in Linux you have a local folder with the three directories and it's quite simple to understand and edit the paths.
Any advice/solutions is greatly appreciated!
Thanks, Ben.
It seems as though it is possible to at least get to a start of this. After grabbing R 3.2.1 sources and untarring I did the following:
mkdir localinstall
./configure --prefix=`pwd`/localinstall \
--without-tcltk \
--with-cairo \
--without-aqua \
--without-x \
--enable-R-shlib \
--disable-R-framework
on a vanilla OS X system (via VMware Fusion). No other R installation was on the system.
To make it work with a .app
configuration, there are environment variables in the bin/R
script that you need to change.
R_HOME_DIR
R_SHARE_DIR
R_INCLUDE_DIR
R_DOC_DIR
Rscript
will need some attention (the dir gets hardcoded in that binary) but you may be able to tweak this to work in side an app provided you get all the other support packages your app will use installed w/o issue.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments