Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions R/platform.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ is_windows <- function() {
.Platform$OS.type == "windows"
}

is_mac <- function() {
Sys.info()[["sysname"]] == "Darwin"
}

is_unix <- function() {
.Platform$OS.type == "unix"
}
Expand Down
4 changes: 2 additions & 2 deletions R/tbb.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ tbbLdFlags <- function() {
return(sprintf(fmt, asBuildPath(tbbLib)))
}

# on Windows and Solaris, we need to explicitly link
needsExplicitFlags <- is_windows() || (is_solaris() && !is_sparc())
# on Mac, Windows and Solaris, we need to explicitly link (#206)
needsExplicitFlags <- is_mac() || is_windows() || (is_solaris() && !is_sparc())
if (needsExplicitFlags) {
libPath <- asBuildPath(tbbLibraryPath())
libFlag <- paste0("-L", libPath)
Expand Down
5 changes: 5 additions & 0 deletions src/Makevars.in
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ ifneq (@COMPILER@, )
MAKE_ARGS += compiler=@COMPILER@
endif

# When TBB_LIB is unset on MacOS, link to the bundled version (#206)
ifeq ($(USE_TBB)$(TBB_LIB),Mac)
PKG_LIBS += -Ltbb/build/lib_release -ltbb -Wl,-rpath,'@loader_path/../lib'
endif

# For Solaris detect if this is 32-bit R on x86 and if so forward that to TBB
ifeq ($(USE_TBB), SunOS)
R_32BIT = $(shell ${R_HOME}/bin/Rscript -e 'cat(.Machine$$sizeof.pointer == 4)')
Expand Down