|
2 | 2 | # !diagnostics suppress=R_PACKAGE_DIR,SHLIB_EXT,R_ARCH |
3 | 3 | .install.libs <- function() { |
4 | 4 |
|
| 5 | + # get TBB library path |
| 6 | + tbbLib <- "@TBB_LIB@" |
| 7 | + |
5 | 8 | # copy default library |
6 | 9 | files <- Sys.glob(paste0("*", SHLIB_EXT)) |
7 | 10 | dest <- file.path(R_PACKAGE_DIR, paste0("libs", R_ARCH)) |
|
22 | 25 | tbbDest <- file.path(R_PACKAGE_DIR, paste0("lib", R_ARCH)) |
23 | 26 | dir.create(tbbDest, recursive = TRUE, showWarnings = FALSE) |
24 | 27 |
|
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 | | - |
32 | 28 | # note: on Linux, TBB gets compiled with extensions like |
33 | 29 | # '.so.2', so be ready to handle those |
34 | 30 | shlibPattern <- switch( |
|
38 | 34 | "^libtbb.*\\.so.*$" |
39 | 35 | ) |
40 | 36 |
|
41 | | - if (is.na(tbbLib)) { |
| 37 | + if (!nzchar(tbbLib)) { |
42 | 38 |
|
43 | 39 | # using bundled TBB |
44 | 40 | tbbLibs <- list.files( |
|
66 | 62 | tbbLibs <- tbbLibs[!nzchar(Sys.readlink(tbbLibs))] |
67 | 63 |
|
68 | 64 | # copy / link the libraries |
| 65 | + writeLines(paste("*", tbbLibs)) |
69 | 66 | useSymlinks <- Sys.getenv("TBB_USE_SYMLINKS", unset = "TRUE") |
70 | 67 | if (useSymlinks) |
71 | 68 | file.symlink(tbbLibs, tbbDest) |
|
0 commit comments