Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions R/tbb.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ tbbLibraryPath <- function(name = NULL) {
if (file.exists(tbbName))
return(tbbName)

tbbName <- systemFile("lib", libName)
tbbName <- archSystemFile("lib", libName)
if (file.exists(tbbName))
return(tbbName)

Expand Down Expand Up @@ -88,7 +88,7 @@ tbbLdFlags <- function() {
# on Windows, we statically link to oneTBB
if (is_windows()) {

libPath <- systemFile("libs")
libPath <- archSystemFile("libs")

ldFlags <- sprintf("-L%s -lRcppParallel", asBuildPath(libPath))
return(ldFlags)
Expand Down Expand Up @@ -123,6 +123,6 @@ tbbRoot <- function() {
if (nzchar(TBB_LIB))
return(TBB_LIB)

systemFile("lib")
archSystemFile("lib")

}
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# like system.file(), but injects the architecture-specific subdirectory
# used on Windows when set; e.g. systemFile("lib") resolves 'lib/x64'
systemFile <- function(dir, name = NULL) {
# used on Windows when set; e.g. archSystemFile("lib") resolves 'lib/x64'
archSystemFile <- function(dir, name = NULL) {
arch <- .Platform$r_arch
parts <- c(dir, if (nzchar(arch)) arch, name)
system.file(paste(parts, collapse = "/"), package = "RcppParallel")
Expand Down
2 changes: 1 addition & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ loadTbbLibrary <- function(name) {
# NOTE: resolve against the package's own library directory, where
# install.libs.R places the stub; tbbRoot() would prefer TBB_LIB,
# which on Windows points at Rtools and holds only static libraries
path <- systemFile("lib", paste0(name, ".dll"))
path <- archSystemFile("lib", paste0(name, ".dll"))
if (!file.exists(path))
return(NULL)

Expand Down
Loading