[R-SIG-Mac] Install multiple versions of R on Mac

Steven McKinney smckinney at bccrc.ca
Mon Aug 15 21:58:45 CEST 2011



> -----Original Message-----
> From: m_hofert at web.de [mailto:m_hofert at web.de]
> Sent: August-15-11 12:22 PM
> To: Steven McKinney
> Subject: Re: [R-SIG-Mac] Install multiple versions of R on Mac
> 
> Hi Steven,
> 
> thanks a lot for your help. Below are my comments.
> 
> Cheers,
> 
> Marius
> 
> On 2011-08-15, at 20:24 , Steven McKinney wrote:
> 
> > Hi Marius,
> >
> > What I have found is that RSwitch does not work if you only have one instance of R.app in
> > your Applications folder.  RSwitch does not modify R.app in the Applications folder, so after
> > you switched back to R-2.13.? with RSwitch, the R-2.13 startup is interacting with the
> > R-2.14 R.app in some fashion that Simon Urbanek might be able to explain but which I
> > have not yet worked out.
> >
> > When I needed both R-2.12.2 and R-2.13.1, I made a folder
> > called "temp" in Applications, then copied the R.app from R-GUI-5732-2.12-leopard_Leopard64.dmg
> > to Applications/temp and renamed it R-2.12.2_64bit.app, then moved that to the
> > Applications folder.  Next I copied the R.app from R-GUI-5885-2.13-leopard-Leopard64.dmg
> > to Applications/temp, renamed it to R-2.13.1_64bit.app, then moved it to the Applications
> > folder.  Now after I use RSwitch, if I run the appropriate R-<version>.app the Mac R GUI
> > initialization and startup works.  See e.g.
> >
> > http://www.mail-archive.com/r-sig-mac@r-project.org/msg00559.html
> >
> > R-GUI-5732-2.12-leopard_Leopard64.dmg and the like available from
> > http://r.research.att.com/
> >
> > Your R.app in the Applications directory is the one from the last R you installed,
> > which appears to be the current development version.  So rename R.app to
> > something such as R-2.14.0_devel_64bit.app.
> 
> (1) I renamed it to R_2.14_devel_32bit since R.app is the one for 32bit; the R64.app I renamed to
> R_2.14_devel_64bit. Afterwards, I only had R_2.14_devel_32bit.app and R_2.14_devel_64bit.app in the
> Applications folder.
> (2) I then reinstalled R 2.13 (from CRAN) and executed "sudo pkgutil --forget org.r-
> project.R.Leopard.fw.pkg"
> (3) Then, I got another R.app and R64bit.app in the Applications folder (of course)
> (4) I renamed them as R_2.13_32bit and R_2.13_64bit, respectively; so I had four R*.apps in the
> Applications folder
> (5) Then I started Rswitch. It said: 2.13.1 for version 2.13 and <incomplete installation> for 2.14.
> Nevertheless, I chose 2.14 and started R_2.14_devel_64bit.app. It crashed on startup.
> (6) I then realized that this pkgutil command only works for *earlier* versions than the one installed
> (7) So I then installed R 2.14 again (and also again using the pkgutil command)
> (8) If I now start RSwitch, I get: 2.13.1 for version 2.13 and 2.14.0 for version 2.14; looks good,
> right?
> 
> Okay, here is what I figured out:
> - (8) tells me that both versions are correctly installed.
> - If I start one of the versions with its corresponding *.app and RSwitch is set to this version, then
> this version starts fine
> - However, if I start one of the version (with its *.app) with the other version being set in RSwitch,
> then I get this messy segfault output
> 
> So, it seems crucial to use the correct version on startup. It would be nice if RSwitch could select
> this.

Yes, it would be great if RSwitch could be set up in such a 
fashion - I don't know if Simon Urbanek has any plans to do 
so.  I think at this point RSwitch is meant to switch versions 
properly for unix shell command line invocation, but not 
invocation via R.app in the Applications directory (unless you 
manually set up and select the properly renamed R-<version>.app 
as above).

Simon Urbanek is clear about RSwitch:  "The following binaries 
are not maintained or supported by R-core and are provided 
without any guarantee and for convenience only" so use carefully.

> 
> Cheers & many thanks again.
> 
> Marius
> 
> 
> > Then reinstall R-2.13.1 or use the strategy
> > I outlined above, and get the R-2.13.1 R.app renamed to R-2.13.1_64bit.app
> >
> > Then after you use RSwitch, run the appropriate R-<version>.app
> >
> >
> > HTH
> >
> > Steven McKinney
> > ________________________________________
> > From: r-sig-mac-bounces at r-project.org [r-sig-mac-bounces at r-project.org] On Behalf Of Marius Hofert
> [m_hofert at web.de]
> > Sent: August 15, 2011 6:35 AM
> > To: Help R
> > Subject: [R-SIG-Mac] Install multiple versions of R on Mac
> >
> > Dear expeRts,
> >
> > I would like to run R 2.13 and R 2.14 on a MacBook Pro (2.53 GHz Intel Core 2 Duo, 4 GB 1067 MHz
> DDR3) with Mac OS X 10.6.8. I installed Rswitch to switch between the two versions. On installing the
> second version (2.14), I executed
> > sudo pkgutil --forget org.r-project.R.Leopard.fw.pkg
> > in the Terminal as suggested on the installation process. Then I finished the installation. 2.14
> runs great (64-bit), but when I switch to R 2.13 and start R, I get the output below.
> >
> > What did I do wrong?
> >
> > Note: I previously had only R 2.14 running. Then I installed R 2.13 (because some things are not
> available for 2.14). On the installation I missed the fact that R 2.14 is not available anymore [I
> missed the note on using pkgutil...], so I only had R 2.13 (also running fine). After that I
> downloaded R 2.14 and executed the pkgutil command during the installation process. I'm not sure if
> this matters (I guess not, since that's probably the more typical way [first having 2.13 installed and
> then 2.14 :-)]).
> >
> > Cheers,
> >
> > Marius
> >
> >
> > *** caught segfault ***
> > address 0x54d8, cause 'memory not mapped'
> >
> > Traceback:
> > 1: .Call("R_initMethodDispatch", as.environment(where), PACKAGE = "methods")
> > 2: initMethodDispatch(where)
> > 3: ..First.lib(libname, pkgName, env)
> > 4: fun(...)
> > 5: doTryCatch(return(expr), name, parentenv, handler)
> > 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
> > 7: tryCatchList(expr, classes, parentenv, handlers)
> > 8: tryCatch(fun(...), error = identity)
> > 9: runHook(".onLoad", package, env, package.lib, package)
> > 10: loadNamespace(package, c(which.lib.loc, lib.loc), keep.source = keep.source)
> > 11: doTryCatch(return(expr), name, parentenv, handler)
> > 12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
> > 13: tryCatchList(expr, classes, parentenv, handlers)
> > 14: tryCatch(expr, error = function(e) {    call <- conditionCall(e)    if (!is.null(call)) {
> if (identical(call[[1L]], quote(doTryCatch)))             call <- sys.call(-4L)        dcall <-
> deparse(call)[1L]        prefix <- paste("Error in", dcall, ": ")        LONG <- 75L        msg <-
> conditionMessage(e)        sm <- strsplit(msg, "\n")[[1L]]        w <- 14L + nchar(dcall, type = "w")
> + nchar(sm[1L], type = "w")        if (is.na(w))             w <- 14L + nchar(dcall, type = "b") +
> nchar(sm[1L],                 type = "b")        if (w > LONG)             prefix <- paste(prefix, "\n
> ", sep = "")    }    else prefix <- "Error : "    msg <- paste(prefix, conditionMessage(e), "\n", sep
> = "")    .Internal(seterrmessage(msg[1L]))    if (!silent &&
> identical(getOption("show.error.messages"),         TRUE)) {        cat(msg, file = stderr())
> .Internal(printDeferredWarnings())    }    invisible(structure(msg, class = "try-error"))})
> > 15: try({    ns <- loadNamespace(package, c(which.lib.loc, lib.loc), keep.source = keep.source)
> dataPath <- file.path(which.lib.loc, package, "data")    env <- attachNamespace(ns, pos = pos,
> dataPath = dataPath,         deps)})
> > 16: library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,
> warn.conflicts = warn.conflicts, quietly = quietly, keep.source = keep.source)
> > 17: doTryCatch(return(expr), name, parentenv, handler)
> > 18: tryCatchOne(expr, names, parentenv, handlers[[1L]])
> > 19: tryCatchList(expr, classes, parentenv, handlers)
> > 20: tryCatch(library(package, lib.loc = lib.loc, character.only = TRUE,     logical.return = TRUE,
> warn.conflicts = warn.conflicts, quietly = quietly,     keep.source = keep.source), error =
> function(e) e)
> > 21: require("methods", quietly = TRUE, warn.conflicts = FALSE, character.only = TRUE)
> > 22: .OptRequireMethods()
> >
> > Possible actions:
> > 1: abort (with core dump, if enabled)
> > 2: normal R exit
> > 3: exit R without saving workspace
> > 4: exit R saving workspace
> > Selection:
> > _______________________________________________
> > R-SIG-Mac mailing list
> > R-SIG-Mac at r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-mac



More information about the R-SIG-Mac mailing list