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
8 changes: 7 additions & 1 deletion src/Makevars.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ ifdef TBB_ROOT

endif

# If TBB_LIB is defined by TBB_INC is not, make a guess.
# If TBB_LIB is not defined, try to use autodetection
ifndef TBB_LIB
TBB_LIB = @TBB_LIB_AUTO@
TBB_INC = @TBB_INC_AUTO@
endif

# If TBB_LIB is defined but TBB_INC is not, make a guess.
ifdef TBB_LIB
ifndef TBB_INC
TBB_INC = $(TBB_LIB)/../include
Expand Down
20 changes: 20 additions & 0 deletions tools/config/configure.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,23 @@ if (Sys.info()[["sysname"]] == "SunOS") {
}
}

# tbb autodetection on Unix
define(TBB_LIB_AUTO = "", TBB_INC_AUTO = "")
if (.Platform$OS.type == "unix") {
tbbLib <- Sys.glob(c(
"/usr/*/libtbb.so",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we wanted to support common macOS configurations (on arm64 machines) we could check /opt/homebrew/lib and /opt/homebrew/include/tbb.

"/usr/*/*/libtbb.so",
"/usr/*/*/*/libtbb.so"
))
tbbInc <- Sys.glob(c(
"/usr/include/tbb.h",
"/usr/include/*/tbb.h"
))
if (length(tbbLib) && length(tbbInc)) {
define(
TBB_LIB_AUTO = dirname(tbbLib[1]),
TBB_INC_AUTO = dirname(tbbInc[1])
)
}
}