diff --git a/NEWS.md b/NEWS.md index 536b3d0f..239f62cb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # RcppParallel (development version) +* Fixed installation on Windows systems whose Rtools does not provide TBB + (R < 4.2.0): configure no longer requires cmake there, and the tbb stub + library is no longer built when the TBB backend is disabled. + * RcppParallel now reports which TBB headers and libraries are installed with the package, and from where, during package installation. In addition, setting the `VERBOSE` environment variable to a value other diff --git a/src/install.libs.R b/src/install.libs.R index 48ce73be..67287413 100644 --- a/src/install.libs.R +++ b/src/install.libs.R @@ -76,8 +76,11 @@ } # on Windows, we create a stub library that links to us so that - # older binaries (like rstan) can still load - if (.Platform$OS.type == "windows") { + # older binaries (like rstan) can still load. this is only relevant + # when TBB is available: the stub cannot link without it, and old + # TBB-using binaries could not run against a TBB-less RcppParallel + # regardless + if (.Platform$OS.type == "windows" && TBB_ENABLED) { tbbDll <- file.path(tbbDest, "tbb.dll") if (file.exists(tbbDll)) { writeLines("** tbb.dll already exists; skipping tbb stub library") diff --git a/tools/config/configure.R b/tools/config/configure.R index a001e63b..544b39ad 100644 --- a/tools/config/configure.R +++ b/tools/config/configure.R @@ -267,8 +267,10 @@ if (.Platform$OS.type == "windows") { define(PKG_LIBS = paste(pkgLibs, collapse = " ")) # if we're going to build tbb from sources, check for cmake +# (not required on Windows, where the bundled TBB is never built; +# without an Rtools TBB, the tinythread fallback is used instead) define(CMAKE = "") -if (is.na(tbbLib)) { +if (is.na(tbbLib) && .Platform$OS.type != "windows") { cmake <- local({