A self-contained R in OS X

Ward9250

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 installed 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.

hrbrmstr

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Is memtest86 self-contained or does it have an underlying OS?

From Dev

Self Contained WPF .net

From Dev

Self-contained generic memento

From Dev

Self-contained shared library

From Dev

Self-Contained Linked List

From Dev

Snappy and self-contained programs

From Dev

Mimic R CMD build HTML vignette: Embed external images as self contained

From Dev

What is the equivalent of /proc/self/exe on Macintosh OS X Mavericks?

From Dev

Self-Hosted FontAwesome Icons Not Rendering on OS X Sierra

From Dev

rattle in R on OS X Mavericks

From Dev

rattle in R on OS X Mavericks

From Dev

A web crawler in a self-contained python file

From Dev

Ensuring that a maven build is self-contained

From Dev

Fully self-contained HTML files with Pandoc

From Dev

completely self-contained virtual environment

From Java

Is a python virtual environment entirely self-contained?

From Dev

AngularJS self contained directives for designer use

From Dev

Pass self reference to contained object's function

From Dev

Deploying self-contained native OCaml application

From Dev

self-contained/serverless nosql databases

From Dev

How to Make RStudio Presentation Self-contained?

From Dev

Include icon in Self-Contained JavaFX application

From Dev

Self contained login using HTML and/or Javascript

From Dev

Self-Contained Applications, built in Java

From Dev

Get self-contained EXE's path?

From Dev

Backup mysql databases into self contained files

From Dev

Does dlopen require a lib to be self-contained?

From Dev

Fully self-contained HTML files with Pandoc

From Dev

Self contained login using HTML and/or Javascript