Re: [R-SIG-Mac] Using multiple CRAN R-versions for building binary packages in a single machine?

2015-04-28 Thread Reijo Sund
> You can have as many version as you want, OS X is using the standard 
> framework versioning scheme
> This means that you can use any version at a given time by simply changing 
> the "Current" symlink.
> This applies to compilation as well - the CRAN R is setup correctly to 
> compile the correct paths
> for each version. Note, however, that you cannot run different versions *at 
> the same time*.


Thank you very much Simon, everything is working fine for me now!

I suggest that the information you provided will be included to the R-admin 
manual Chapter "4 Installing R under OS X". So the subchapter "4.3 Multiple 
versions" could be updated to something like:

- - -

4.3 Multiple versions under OS X

The installer will remove any previous version of the R framework which it 
finds installed. This can be avoided by using pkgutil --forget (see the 
previous section and a note on the installer, e.g. for the Maverics build use: 
pkgutil --forget org.r-project.R.mavericks.fw.pkg). However, note that 
different versions are installed under /Library/Frameworks/R.framework/Versions 
as 3.0, 3.1 and so on, so it is not possible to have different ‘3.x.y’ versions 
installed for the same ‘x’. Note also that you cannot run different versions at 
the same time.

If you want to switch the R version in use, change the symlink of ‘current’ 
version (e.g. ln -sfn 3.1 /Library/Frameworks/R.framework/Versions/Current). A 
small utility, Rswitch.app (available at http://r.research.att.com/#other), can 
also be used to change the ‘current’ version. However, this is of limited use 
if you are using R.APP, because R.APP is compiled against a particular version 
of R and will likely crash if switched to an earlier version. This may still 
allow you to e.g. build, check or test packages using a development version of 
R (installed with de-selecting R.APP) and then switch back to the release 
version.

- - -


Best wishes,

Reijo Sund
Centre for Research Methods,
Department of Social Research,
University of Helsinki,
Finland

___
R-SIG-Mac mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac


Re: [R-SIG-Mac] Using multiple CRAN R-versions for building binary packages in a single machine?

2015-04-26 Thread Simon Urbanek
What you describe is true on Linux but not on OS X where R uses a framework by 
default.

You can have as many version as you want, OS X is using the standard framework 
versioning scheme - see also
https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html

This means that you can use any version at a given time by simply changing the 
"Current" symlink. This applies to compilation as well - the CRAN R is setup 
correctly to compile the correct paths for each version. Note, however, that 
you cannot run different versions *at the same time*.

Cheers,
Simon

PS: If you want to redistribute your binaries you have to be careful - you'll 
have to change libraries linked from your local locations to those inside R if 
you want them to be usable by others.


On Apr 26, 2015, at 3:23 PM, Reijo Sund  wrote:

> I try to maintain a build system for the R packages so that I can easily 
> produce all required Windows and Mac OS X binaries (for R versions 2.15.x and 
> up) whenever I update my packages. I acknowledge that excellent services such 
> as CRAN or RForge could be used, but to maximise the flexibility required by 
> my packages, I prefer to have my own private building system. Currently the 
> build system uses several virtual machines and a separate VM is needed for 
> Mac OS X Leopard, Snow Leopard and Mavericks. I would like to use the CRAN 
> versions of R to maximise the compatibility of binaries.
> 
> Unfortunately I have had problems to install multiple CRAN versions of R to 
> the same VM. The R-admin manual (chapter 4) gives instructions for installing 
> multiple versions (subchapter 4.3), but even if I use pkgutil to forget the 
> old version and use command line such as 
> /Library/Frameworks/R.framework/Versions/3.1/Resources/bin/R to run R, it 
> always launches the version installed latest.
> 
> A quick look to the R ”binary" (for which the command line refers to) reveals 
> that it is actually a shell wrapper for R executable that contains paths not 
> including the version information. It is not difficult to change "hard coded" 
> paths R_HOME_DIR, R_SHARE_DIR, R_INCLUDE_DIR and R_DOC_DIR in the wrapper and 
> then indeed the correct version launches.
> 
> Unfortunately, the building of packages including C code using different 
> versions seems not to work for other than the version installed latest even 
> after changing the paths; or actually the compilation phase seems to work 
> fine and linking paths etc. are conditional to the version, but the "testing 
> if installed package can be loaded” results in a segfault. The similar 
> procedure works fine for me if I (instead of installing CRAN version of R) 
> manually build R from sources to some directory and use it for building of 
> packages (I use this technique to build against Aqua Tcl/Tk), but then the 
> compatibility of builded binary packages will be restricted to my 
> configuration if I have understood correctly.
> 
> Currently the only working solution I have found has been to install a new VM 
> for each (major) version of R. That is actually a good way also to to update 
> the toolchains, but probably and hopefully that is not required for each 
> version of R as each new VM increases the burden for maintaining a building 
> system.
> 
> So even after reading the manuals and FAQs several times, I have not so far 
> been able to sort this out myself (i.e. how to use several CRAN R versions to 
> build packages containing C code on a same Mac OS X VM), so any tips would be 
> appreciated. 
> 
> 
> Best wishes,
> 
> Reijo Sund
> Centre for Research Methods,
> Department of Social Research,
> University of Helsinki,
> Finland
> 
> ___
> R-SIG-Mac mailing list
> [email protected]
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

___
R-SIG-Mac mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac