Packages/BioArchLinux/r-rstan/fix-plugin.patch
Pekka Ristola 46bff6584c
r-*: use system onetbb in r-rcppparallel
- use metadata checks for r-rcppparallel and r-stanheaders
- fix r-rcppparallel, r-rstan and r-stanheaders to emit build
  flags for using system onetbb
- add onetbb dependency to related packages
- the r-rcppparallel AUR package doesn't use system onetbb, so
  the build flag logic is conditional depending on which
  r-rcppparallel package is installed on the system
2024-02-08 13:55:16 +02:00

17 lines
848 B
Diff

diff --git a/rstan/R/plugin.R b/rstan/R/plugin.R
index d254ce4..659c48a 100644
--- a/rstan/R/plugin.R
+++ b/rstan/R/plugin.R
@@ -96,8 +96,10 @@ rstanplugin <- function() {
else {
StanHeaders_pkg_libs <- system.file("lib", .Platform$r_arch,
package = "StanHeaders", mustWork = TRUE)
- RcppParallel_pkg_libs <- system.file("lib", .Platform$r_arch,
- package = "RcppParallel", mustWork = TRUE)
+ RcppParallel_pkg_libs <- file.path(system.file(package = "RcppParallel", mustWork = TRUE), "lib")
+ if (!dir.exists(RcppParallel_pkg_libs)) {
+ RcppParallel_pkg_libs <- "/usr/lib"
+ }
rstan_StanServices <- system.file("lib", .Platform$r_arch, "libStanServices.a",
package = "rstan", mustWork = TRUE)
}