R 4.0.0 and CRAN MacOS binaries

I also was having issues with multiple chains running in parallel in MacOS using latest R-4.0.0 and RStan.

I’ve found out that this is a problem of the package parallel from R-4.0.0

I’ve found this recently issue in RStudio’s GitHub that solved my problem:


cl <- parallel::makeCluster(2, setup_strategy = "sequential")
If this works, you could add the following to your ~/.Rprofile until this is fixed in R/RStudio:

## WORKAROUND: https://github.com/rstudio/rstudio/issues/6692
## Revert to 'sequential' setup of PSOCK cluster in RStudio Console on macOS and R 4.0.0
if (Sys.getenv("RSTUDIO") == "1" && !nzchar(Sys.getenv("RSTUDIO_TERM")) && 
    Sys.info()["sysname"] == "Darwin" && getRversion() == "4.0.0") {
  parallel:::setDefaultClusterOptions(setup_strategy = "sequential")
}

Hope this helps clarifying the issues surrounding RStan, MacOS and R-4.0.0

10 Likes