Skip to content

Commit 110d217

Browse files
committed
more tbb path fixups
1 parent 9b80fcd commit 110d217

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

R/tbb.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ tbbCxxFlags <- function() {
5757
if (!is.na(tbbInc)) {
5858

5959
# add include path
60-
flags <- c(flags, paste0("-I", shQuote(asBuildPath(tbbInc))))
60+
flags <- c(flags, paste0("-I", asBuildPath(tbbInc)))
6161

6262
# prefer new interface if version.h exists
6363
versionPath <- file.path(tbbInc, "tbb/version.h")
@@ -78,14 +78,14 @@ tbbLdFlags <- function() {
7878
tbbLib <- Sys.getenv("TBB_LIB", unset = NA)
7979
if (!is.na(tbbLib)) {
8080
fmt <- "-L%1$s -Wl,-rpath,%1$s -ltbb -ltbbmalloc"
81-
return(sprintf(fmt, shQuote(asBuildPath(tbbLib))))
81+
return(sprintf(fmt, asBuildPath(tbbLib)))
8282
}
8383

8484
# on Windows and Solaris, we need to explicitly link
8585
needsExplicitFlags <- is_windows() || (is_solaris() && !is_sparc())
8686
if (needsExplicitFlags) {
8787
libPath <- asBuildPath(tbbLibraryPath())
88-
libFlag <- paste0("-L", shQuote(libPath))
88+
libFlag <- paste0("-L", libPath)
8989
return(paste(libFlag, "-ltbb", "-ltbbmalloc"))
9090
}
9191

@@ -100,7 +100,7 @@ tbbRoot <- function() {
100100
# parts <- c("libs", if (nzchar(rArch)) rArch, "tbb")
101101

102102
rArch <- .Platform$r_arch
103-
parts <- c("lib/tbb", if (nzchar(rArch)) rArch)
103+
parts <- c("lib", if (nzchar(rArch)) rArch)
104104
libDir <- paste(parts, collapse = "/")
105105
system.file(libDir, package = "RcppParallel")
106106

R/utils.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11

2-
# Helper function to ape the behavior of the R build system
3-
# when providing paths to libraries
2+
# generate paths consumable by the compilers and linkers
3+
# in particular, on Windows, this means the path _cannot_ be quoted !!
44
asBuildPath <- function(path) {
55

6-
# nothing to do for non-Windows
76
if (!is_windows())
8-
return(path)
7+
return(shQuote(path))
98

109
# normalize paths using forward slashes
1110
path <- normalizePath(path, winslash = "/", mustWork = FALSE)

src/install.libs.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
# copy tbb
1313
# TODO: use 'dest' library directory once rstan is updated
14-
tbbDest <- file.path(R_PACKAGE_DIR, "lib/tbb", R_ARCH)
14+
tbbDest <- file.path(R_PACKAGE_DIR, "lib", R_ARCH)
1515
dir.create(tbbDest, recursive = TRUE, showWarnings = FALSE)
1616

1717
# check for bundled vs. system tbb

0 commit comments

Comments
 (0)