Skip to content

Commit d7be8ab

Browse files
committed
fall back to copying when the libtbb.so symlink can't be created
1 parent 16bb567 commit d7be8ab

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/install.libs.R

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,18 @@ versionBundledTbbLibraries <- function(tbbDest) {
185185
# 'libtbb.so' -> 'libtbb.so.2', then re-create 'libtbb.so' as a
186186
# relative symlink pointing back at the versioned library
187187
file.rename(lib, versioned)
188-
file.symlink(basename(versioned), lib)
188+
linked <- tryCatch(
189+
file.symlink(basename(versioned), lib),
190+
warning = function(w) FALSE
191+
)
192+
193+
# if the symlink couldn't be created (e.g. a filesystem without symlink
194+
# support), fall back to a plain copy so that 'libtbb.so' still exists --
195+
# RcppParallel's own shared object records a load-time dependency on it
196+
if (!isTRUE(linked)) {
197+
writeLines("** could not create symlink; copying instead")
198+
file.copy(versioned, lib, overwrite = TRUE)
199+
}
189200

190201
}
191202

0 commit comments

Comments
 (0)