Skip to content
Prev 2683 / 21312 Next

[Bioc-devel] running devel and release versions of R and bioc on mac os?

Yes.

A full install on OS X installs R into

# ls -l /Library/Frameworks/R.framework/Versions/
total 8
drwxrwxr-x  7 root  admin   238B Jul 10 13:06 2.13
drwxrwxr-x  6 root  admin   204B Jul 10 12:56 2.14
lrwxr-xr-x  1 root  admin    45B Jul 10 13:06 Current ->
/Library/Frameworks/R.framework/Versions/2.13

As you can see on my system there are version directories and then a
symlink from "Current" to whatever version is current (under some
definition).  The Rswitch utility essentially switches this symlink
around.

If you grab the nighties (the tar.gz and _not_ the pkg) from
r.research it looks to be compiled code that simply adds a new
directory under /Library/Framework/R.framework (you should check
this).  But it also overwrites the "Current" link so that "Current"
points to 2.14. Using an installer tends to create a new directory,
but remove the old ones; this is why people complain about missing old
versions.

Now, assuming you have two (full) directories under OS X you need the following
  (1) decide which version should be "R" (in my script below that is
always latest stable release)
  (2) make some simple scripts/symlinks that start the other versions of R
  (3) (this is the tricky part) Make sure that the R scripts installed
inside /bin directories deep in the Framework dirs are modified
because (unfortunately) on mac certain paths are hardcorded.

This script does all of it, and it needs to be run with sudo post
installation (and you need to run it every time you re-install a
nightie).  Based on what I see in the current tarball
(R-devel-leopard-universal.tar.gz), this script should work with the
nighties tarball.

#!/bin/bash
sudo ln -f -s /Library/Frameworks/R.framework/Versions/2.13/Resources/R
/usr/bin/R-2.13
sudo ln -f -s /Library/Frameworks/R.framework/Versions/2.13/Resources/Rscript
/usr/bin/Rscript-2.13
sudo ln -f -s /Library/Frameworks/R.framework/Versions/2.14/Resources/R
/usr/bin/R-devel
sudo ln -f -s /Library/Frameworks/R.framework/Versions/2.14/Resources/Rscript
/usr/bin/Rscript-devel
sudo ln -f -s /Library/Frameworks/R.framework/Versions/2.13/Resources/R
/usr/bin/R
sudo ln -f -s /Library/Frameworks/R.framework/Versions/2.13/Resources/Rscript
/usr/bin/Rscript
sudo rm /Library/Frameworks/R.framework/Versions/Current
sudo ln -f -s /Library/Frameworks/R.framework/Versions/2.13
/Library/Frameworks/R.framework/Versions/Current
sudo sed -i tmp
"s|R.framework/Resources|R.framework/Versions/2.13/Resources|"
/Library/Frameworks/R.framework/Versions/2.13/Resources/bin/R
sudo sed -i tmp
"s|R.framework/Resources|R.framework/Versions/2.14/Resources|"
/Library/Frameworks/R.framework/Versions/2.14/Resources/bin/R

The first 6 lines just sets up symlinks in /usr/bin  (R (pointing to
2.13), R-2.13 and R-devel, expand as needed for more versions).  That
is, they solve (1) above
The next two lines makes sure that Current links to 2.13, solving (2) above
The last line fixes the hard-coded path in the scripts, solving (3) above.

Kasper

On Wed, Jul 20, 2011 at 11:57 AM, Paul Shannon
<pshannon at systemsbiology.org> wrote: