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

Kasper Daniel Hansen kasperdanielhansen at gmail.com
Wed Jul 20 18:14:55 CEST 2011


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:
> Thanks, Kasper.
>
> I, too, run R from emacs using ESS, and my hope is to run (with or without ESS) the two versions in separate buffers, making for easy comparisons in a familiar environment.
>
> Rather than building from source, I am inclined to get the latest build from
>
>  http://r.research.att.com/#nightly
>
> Any further suggestions?
>
> Thanks!
>
>  - Paul
>
>
>
>
> On Jul 20, 2011, at 8:34 AM, Kasper Daniel Hansen wrote:
>
>> I do this routinely, but I access R from the terminal or from within
>> Emacs, using ESS.  I also compile R myself.
>>
>> It is possible to do this using the Rgui by using the Rswitch
>> application, but that depends quite a bit on how you install R-devel
>> (installer (is that possible?), compile or untar compiled code).
>> However, using Rswitch you will only ever have a single R running.  If
>> you want to run them side by side I think you need to modify stuff
>> (which I do and which is not that hard).
>>
>> This seems like a reasonable request so I wonder what other people do
>> (although I predict most people will say compile from source).
>>
>> Kasper
>>
>> On Wed, Jul 20, 2011 at 11:16 AM, Paul Shannon
>> <pshannon at systemsbiology.org> wrote:
>>> Are there any special techniques you can advise me of, for installing and running two concurrent R/bioc versions installed on Mac OS?
>>>
>>> I wish to have the latest build of the devel version without sacrificing the current release as well.
>>>
>>> Thanks,
>>>
>>>  - Paul
>>>
>>> _______________________________________________
>>> Bioc-devel at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>>>
>
>



More information about the Bioc-devel mailing list