Skip to content

Commit 1b0066c

Browse files
committed
pass through TBB_LIB from configure
1 parent d431522 commit 1b0066c

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ src-x64
1313
tbb.log
1414

1515
R/tbb-autodetected.R
16+
src/install.libs.R
17+

src/install.libs.R renamed to src/install.libs.R.in

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# !diagnostics suppress=R_PACKAGE_DIR,SHLIB_EXT,R_ARCH
33
.install.libs <- function() {
44

5+
# get TBB library path
6+
tbbLib <- "@TBB_LIB@"
7+
58
# copy default library
69
files <- Sys.glob(paste0("*", SHLIB_EXT))
710
dest <- file.path(R_PACKAGE_DIR, paste0("libs", R_ARCH))
@@ -22,13 +25,6 @@
2225
tbbDest <- file.path(R_PACKAGE_DIR, paste0("lib", R_ARCH))
2326
dir.create(tbbDest, recursive = TRUE, showWarnings = FALSE)
2427

25-
# check for bundled vs. system tbb
26-
tbbRoot <- Sys.getenv("TBB_ROOT", unset = NA)
27-
28-
tbbLib <- Sys.getenv("TBB_LIB", unset = NA)
29-
if (is.na(tbbLib) && !is.na(tbbRoot))
30-
tbbLib <- file.path(tbbRoot, "lib")
31-
3228
# note: on Linux, TBB gets compiled with extensions like
3329
# '.so.2', so be ready to handle those
3430
shlibPattern <- switch(
@@ -38,7 +34,7 @@
3834
"^libtbb.*\\.so.*$"
3935
)
4036

41-
if (is.na(tbbLib)) {
37+
if (!nzchar(tbbLib)) {
4238

4339
# using bundled TBB
4440
tbbLibs <- list.files(
@@ -66,6 +62,7 @@
6662
tbbLibs <- tbbLibs[!nzchar(Sys.readlink(tbbLibs))]
6763

6864
# copy / link the libraries
65+
writeLines(paste("*", tbbLibs))
6966
useSymlinks <- Sys.getenv("TBB_USE_SYMLINKS", unset = "TRUE")
7067
if (useSymlinks)
7168
file.symlink(tbbLibs, tbbDest)

0 commit comments

Comments
 (0)