[R-SIG-Mac] using several versions in Library/Frameworks simultanouesly

Kasper Daniel Hansen khansen at stat.berkeley.edu
Thu Dec 11 05:54:34 CET 2008

Thanks a lot Patrick, I have now had some time to play with this in  
detail, and have compiled the script I have replicated below. I run  
that script post every make install I do.

I am slightly baffled by why R.framework/Resources is hardcoded into  
the file
and why it is not R.framework/Versions/2.9/Resources

I see no reason not to. The R in /usr/bin links to
ls -l /usr/bin/R
lrwxr-xr-x  1 root  wheel    47B Jul  2 11:13 /usr/bin/R -> /Library/ 

but /Library/Frameworks/R.framework/Resources is already a symlink to / 

If this is changes, one should be able to switch between R versions  
just by changing the symlink in Versions/Current as far as I can see  
(but there is probably something I have missed). Something might need  
to be done for Rscript as well.

This would certainly make it easier for me, and also slightly more  
logical as I see it (but I am happy to be educated). Unfortunately I  
don't think I can provide a patch to the configure script



sudo ln -f -s /Library/Frameworks/R.framework/Versions/2.8/Resources/ 
R /usr/bin/R-2.8
sudo ln -f -s /Library/Frameworks/R.framework/Versions/2.8/Resources/ 
Rscript /usr/bin/Rscript-2.8
sudo ln -f -s /Library/Frameworks/R.framework/Versions/2.9/Resources/ 
R /usr/bin/R-devel
sudo ln -f -s /Library/Frameworks/R.framework/Versions/2.9/Resources/ 
Rscript /usr/bin/Rscript-devel
sudo rm /Library/Frameworks/R.framework/Versions/Current
sudo ln -f -s /Library/Frameworks/R.framework/Versions/2.8 /Library/ 
sudo sed -i tmp "s|R.framework/Resources|R.framework/Versions/2.8/ 
Resources|" /Library/Frameworks/R.framework/Versions/2.8/Resources/bin/R
sudo sed -i tmp "s|R.framework/Resources|R.framework/Versions/2.9/ 
Resources|" /Library/Frameworks/R.framework/Versions/2.9/Resources/bin/R

On Dec 9, 2008, at 9:31 , Patrick Aboyoun wrote:

> Kasper,
> When I want to have multiple versions of R on my mac, I hand edit  
> the R script to explicitly reference the version of R I want to use.  
> My guess is that within your /Library/Frameworks/R.framework/ 
> Versions/2.9/Resources/bin/R file you have references to /Library/ 
> Frameworks/R.framework/Resources instead of /Library/Frameworks/ 
> R.framework/Versions/2.9/Resources and /Library/Frameworks/ 
> R.framework/Resources is a symbolic link to /Library/Frameworks/ 
> R.framework/Versions/2.8/Resources.
> Patrick
> Kasper Daniel Hansen wrote:
>> I have two version of R installed in
>>  /Library/Frameworks
>> version 2.8 patched and version 2.9 (R-devel). I have compiled them  
>> myself. I know of Rswitch that allows me to switch (system-wide)  
>> between the two versions. But I want to be able to use the two  
>> versions at the same time, in different terminals (I am not using  
>> R.app)
>> I thought I could do this by making a symbolic link from my ~/Bin  
>> folder (I have added this folder to my path), but even though it  
>> seems to point to the right place (ok, something is wrong, so of  
>> course it is not "right"), it still picks up the wrong version
>> kasper-hansens-macbook:~/> which R-devel
>> /Users/khansen/Bin/R-devel
>> kasper-hansens-macbook:~/> ls -l Bin/R-devel
>> lrwxr-xr-x  1 khansen  staff    60B Nov 11 12:02 Bin/R-devel -> / 
>> Library/Frameworks/R.framework/Versions/2.9/Resources/bin/R
>> kasper-hansens-macbook:~/> R-devel --version
>> R version 2.8.0 Patched (2008-12-05 r47091)
>> Copyright (C) 2008 The R Foundation for Statistical Computing
>> ISBN 3-900051-07-0
>> Right now my system wide R, according to Rswitch, is R-2.8.
>> What am I missing here? I know I can run R-devel if I just run it  
>> from the directory where I compiled it, so something seems to  
>> happen when I do make install.
>> Kasper
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

More information about the R-SIG-Mac mailing list