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:
- Deploying desktop apps with R (Windows specific)
- Modifying R to obtain a relocatable tarball
- Let R and Rscript infer paths from their own location
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.