File tree Expand file tree Collapse file tree 1 file changed +15
-12
lines changed
Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change 2020 if (is.na(tbbLib ) && ! is.na(tbbRoot ))
2121 tbbLib <- file.path(tbbRoot , " lib" )
2222
23- shlibPattern <- " [.](?:so|dylib|dll)$"
23+ # note: on Linux, TBB gets compiled with extensions like
24+ # '.so.2', so be ready to handle those
25+ shlibPattern <- switch (
26+ Sys.info()[[" sysname" ]],
27+ Windows = " [.]dll$" ,
28+ Darwin = " [.]dylib$" ,
29+ " [.]so(?:[.][[:digit:]]+)?$"
30+ )
2431
2532 if (is.na(tbbLib )) {
2633
2734 # using bundled TBB
28- sysname <- Sys.info()[[" sysname" ]]
29-
30- tbbExt <- switch (
31- sysname ,
32- Windows = " .dll" ,
33- Darwin = " .dylib" ,
34- " .so.2"
35+ tbbLibs <- list.files(
36+ path = " tbb/build/lib_release" ,
37+ pattern = shlibPattern ,
38+ full.names = TRUE
3539 )
3640
37- fmt <- " cp -R tbb/build/lib_release/*%s '%s/'"
38- cmd <- sprintf(fmt , tbbExt , tbbDest )
39-
40- system(cmd )
41+ # only copy real files; don't copy symlinks
42+ links <- Sys.readlink(tbbLibs )
43+ file.copy(tbbLibs [! nzchar(links )], tbbDest )
4144
4245 } else {
4346
You can’t perform that action at this time.
0 commit comments