renjin
renjin copied to clipboard
Package 'parallel' does not implement makeCluster function
First of all, the library(parallel)
does not work. I believe it should? (Well I'm testing it on R ver > 2.14.2 so maybe it was different back then).
Second, there is a strange problem regarding parallel package in relation to gbm package. I checked the gbm's test logs. One of the tests fails because there is no makeCluster()
function in the parallel package. The strange thing is that gbm depends on both R >= 2.9.0 and parallel (this is not listed in your webpage but is specified on CRAN). As I can see, parallel is not the base package for R v.2.9.0, and on the other hand, the parallel package from R v. 2.14.2 (which I believe is the Renjin's version) does not contain the makeCluster()
function, so no surprise the test fails. I have no idea whether the cran/renjin dependencies are incorrectly specified or there is some other kind of problem, but something is clearly wrong. The parallel package needs the makeCluster()
function in order to make gbm v. 2.1.1 work.
Renjin was initially based on R 2.14.2 but is now closer to GNU R 3.2.2. We've been trying to keep the core packages in sync with those from GNU R -- adding functions newly introduced functions like paste0' or
anyNA`.
The parallel
package was added as core package to GNU R sometime after 2.14, and then subsequently added to Renjin. You can find Renjin's sources in packages/parallel/src/main/R.
Add this stage, Renjin's version is only meant to be a stub to allow packages using the parallel
API to run. I wouldn't have expected a package to call makeCluster()
but if that's the case, you can add a stub for that to stubs.R. In might be sufficient to add:
makeCluster <- function(spec, type, ...) NULL
Along with an entry in NAMESPACE.
I've seen the parallel package in base R 2.14.2 already, but well that's not important, might be my mistake. Anyway, I will add the stub as you suggested. By the way, I suppose only the test case calls makeCluster, not the package itself.
Looks like returning NULL
is insufficient:
http://packages.renjin.org/package/org.renjin.cran/gbm/2.1.1/build/234#test-print.gbm-examples
Think it might be helpful to extract a test case from this package and add to packages/parallel/src/test/R.