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
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# RcppParallel (development version)

* When building the bundled copy of oneTBB, RcppParallel no longer searches
for hwloc, and so no longer tries to build the optional 'tbbbind' library.
This fixes build failures on machines where a static hwloc library is
discoverable via pkg-config, as on the CRAN macOS machines.

* On macOS, the bundled copy of oneTBB is now built with
`__TBB_RESUMABLE_TASKS_USE_THREADS`, avoiding use of the deprecated
ucontext APIs (`getcontext`, `swapcontext`, `makecontext`).


# RcppParallel 6.0.0

Expand Down
11 changes: 11 additions & 0 deletions src/install.libs.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,23 @@ useBundledTbb <- function() {
prependFlags("CPPFLAGS", "CFLAGS")
prependFlags("CPPFLAGS", "CXXFLAGS")

# the ucontext APIs (getcontext, swapcontext, ...) are deprecated on macOS,
# so use the threads-based coroutine implementation for resumable tasks
if (Sys.info()[["sysname"]] == "Darwin") {
flags <- c(Sys.getenv("CXXFLAGS"), "-D__TBB_RESUMABLE_TASKS_USE_THREADS=1")
setenv("CXXFLAGS", flags[nzchar(flags)])
}

cmakeFlags <- c(
forwardEnvVar("CC", "CMAKE_C_COMPILER"),
forwardEnvVar("CXX", "CMAKE_CXX_COMPILER"),
forwardEnvVar("CFLAGS", "CMAKE_C_FLAGS"),
forwardEnvVar("CXXFLAGS", "CMAKE_CXX_FLAGS"),
forwardEnvVar("CMAKE_BUILD_TYPE", "CMAKE_BUILD_TYPE"),
# tbbbind requires hwloc, and hwloc's pkg-config file doesn't advertise
# the macOS frameworks needed when linking it statically; RcppParallel
# doesn't use TBB's NUMA APIs, so skip tbbbind altogether
"-DTBB_DISABLE_HWLOC_AUTOMATIC_SEARCH=1",
"-DTBB_TEST=0",
"-DTBB_EXAMPLES=0",
"-DTBB_STRICT=0",
Expand Down
Loading