Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Intel oneAPI TBB / oneTBB #144

Merged
merged 7 commits into from Jan 4, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 34 additions & 0 deletions README.md
Expand Up @@ -10,6 +10,40 @@ The high level interface enables safe and robust parallel programming without di

For additional documentation on using RcppParallel see the package website at http://rcppcore.github.io/RcppParallel/.

### Intel TBB

`RcppParallel` now supports the new interface of Intel TBB and allows using external library (e.g., with [oneTBB](https://github.com/oneapi-src/oneTBB), [OneAPI](https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-toolkit-release-notes.html), or the system TBB library), using `TBB_LIB` and `TBB_INC` environment variables. The updated TBB functionality are summarized [here](https://software.intel.com/content/www/us/en/develop/articles/tbb-revamp.html) and the release notes and backward compatibility are reported [here](https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-threading-building-blocks-release-notes.html).

To build the development version of `RcppParallel` with [oneTBB](https://github.com/oneapi-src/oneTBB) or [OneAPI](https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-toolkit-release-notes.html):

- Install [oneTBB](https://github.com/oneapi-src/oneTBB) or [OneAPI](https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-toolkit-release-notes.html).

For example, installing [oneTBB](https://github.com/oneapi-src/oneTBB) on Linux 64-bit (`x86_64`) to `$HOME` directory (change if needed!):
```
TBB_VERSION="2021.1.1"
wget https://github.com/oneapi-src/oneTBB/releases/download/v2021.1.1/oneapi-tbb-$TBB_VERSION-lin.tgz
tar zxvf oneapi-tbb-$TBB_VERSION-lin.tgz -C $HOME
export TBB="$HOME/oneapi-tbb-$TBB_VERSION"
```

- Set the TBB environment variables (specifically: `TBB` for the installation prefix, `TBB_INC` for the directory that includes the header files, and `TBB_LIB` for the libraries directory).

For example, installing [oneTBB](https://github.com/oneapi-src/oneTBB) on Linux 64-bit (`x86_64`) to `$HOME` directory (change if needed!):
```
source $TBB/env/vars.sh intel64
export TBB_INC="$TBB/include"
export TBB_LIB="$TBB/lib/intel64/gcc4.8"
```

- Build the development version of `RcppParallel`:
```
install.packages("remotes")
remotes::install_github("RcppCore/RcppParallel@develop", force = TRUE)
```

### License

The RcppParallel package is made available under the [GPLv2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html).
Expand Down
3 changes: 2 additions & 1 deletion inst/NEWS
@@ -1,7 +1,8 @@
RcppParallel 5.1.0 (UNRELEASED)
------------------------------------------------------------------------

* Added support for external TBB library via TBB_INC and/or TBB_LIB environment variables.
* Added support for external TBB library using TBB_INC and TBB_LIB environment variables.
* Added support for the latest versions of Intel oneAPI TBB / oneTBB.
* Updated TBB functionality for the new interface.
* Falling back to building TBB from local source code.
* Backward TBB compatibility based on `__TBB_tbb_stddef_H`.
Expand Down
1 change: 1 addition & 0 deletions src/Makevars.in
Expand Up @@ -104,6 +104,7 @@ ifdef TBB_LIB
rm -Rf ../inst/include/tbb_local/; \
mkdir -p ../inst/include; \
cp -R $(TBB_INC)/serial ../inst/include/ 2>/dev/null || :; \
cp -R $(TBB_INC)/oneapi ../inst/include/ 2>/dev/null || :; \
cp -R $(TBB_INC)/tbb ../inst/include/ 2>/dev/null || :
else
echo "Building TBB library from source code..."; \
Expand Down