rr-packagerparallel

Package that suggests `parallel` fails compile in windows


I am developing a package that suggests R's parallel package (So my DESCRIPTION has a Suggests: parallel (>= 1.13.1) statement. It compiles fine under OSX and Linux but fails when building on windows (using win-builder). Here is the end of the install.log that win-builder spits out:

*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
*** arch - i386
Error: package or namespace load failed for 'spectrolab' in 
library.dynam(lib, package, package.lib):
DLL 'parallel' not found: maybe not installed for this architecture?
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'd:/RCompile/CRANguest/R-devel/lib/spectrolab'

Find the full output from win-builder here https://win-builder.r-project.org/4k9QC0st397H/

There is only one function that tries to use parallel. It goes more or less like this:

#' Smooth spline functions for spectra
#' ... roxygen stuff ...
#' @importFrom stats smooth.spline
#' @importFrom parallel detectCores mclapply
smooth.spectra = function(x, ...){

  p = requireNamespace("parallel", quietly = TRUE) && .Platform$OS.type != "windows"

  if(p){
     r = parallel::mclapply(x, stats::smooth.spline)
  } else {
     r = lapply(x, stats::smooth.spline)
  }
  r
}

Any ideas of what the problem is?


Solution

  • It's most likely a win-builder hiccup. I've just recently observed the same on CRAN Windows tests (same setup as win-builder) for no good reasons:

    https://www.r-project.org/nosvn/R.check/r-devel-windows-ix86+x86_64/doFuture-00install.html

    Unless win-builder maintainer (Uwe Ligges) gets to it himself, you could drop him an email.