[R-SIG-Mac] Several R installation issues

Simon Urbanek simon.urbanek at r-project.org
Wed May 24 04:53:23 CEST 2006


On May 23, 2006, at 10:16 PM, Herve Pages wrote:

> Thanks for the work-around. It works in the sense that after this  
> removal, powerpc/R-2.2.1.dmg will not delete my previous  
> installation of R 2.3.0. But after doing this, I'm still unable to  
> launch R 2.3 from the command line:
>
>  dhcp157137:/Library/Frameworks/R.framework/Versions compbio$ 2.3/ 
> Resources/bin/R
>  2.3/Resources/bin/R: line 166: /Library/Frameworks/R.framework/ 
> Resources/etc/ppc/ldpaths: No such file or directory
>

The default R_HOME is /Library/Frameworks/R.framework/Resources and  
therefore the R script always starts the current framework. You can  
change the current framework by modifying the /Library/Frameworks/ 
R.framework/Versions/Current symlink. Lot of things rely on this  
symlink, so running R off a different version without changing this  
link is unsupported and may break. [My package building system  
actually installs a clean copy of R before building to make sure  
everything is ok, but that's my paranoia ;).]

For the record you can switch the R version e.g. to 2.3 using
sudo ln -sf /Library/Frameworks/R.framework/Versions/Current 2.3

make sure you really have a complete R 2.3.x installed as framework  
before you do that - check with
ls -l /Library/Frameworks/R.framework/Versions/

<kids don't do this at home - for experienced users only!!>
Nevertheless, if you take some care, you may run R regardless of the  
symlink in some circumstances. If you're talking about command-line  
version of R, it's actually easy, just change R_HOME in the R start  
script to point to the version-specific Resources directory. (You'll  
need separate scripts anyway, but $R_HOME/bin/R must always be  
correct and correspond to the $R_HOME).

If you want to run the GUI, you have to be more careful. First, you  
have to make sure that it is linked to the version-specific libR (see  
otool -L). If it's not, you'll have to change it (install_name_tool - 
change ...). Secondly, you have to make sure that R.app knows about  
the R_HOME. There are several ways to do it - probably the easiest is  
to add Info.plist with bundle identifier to the R framework, i.e. put  
something like this in Resources/Info.plist of each R framework (you  
may want change the version of course):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http:// 
www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
         <key>CFBundleIdentifier</key>
         <string>org.r-project.R-framework</string>
         <key>CFBundleInfoDictionaryVersion</key>
         <string>6.0</string>
         <key>CFBundleName</key>
         <string>R</string>
         <key>CFBundlePackageType</key>
         <string>FMWK</string>
         <key>CFBundleVersion</key>
         <string>2.3.0</string>
</dict>
</plist>

</kids don't do this at home - for experienced users only!!>

Cheers,
Simon



More information about the R-SIG-Mac mailing list