Skip to content

Commit 06b203d

Browse files
authored
Merge pull request #144 from hsbadr/develop
Support Intel oneAPI TBB / oneTBB
2 parents 39303ec + dcc1595 commit 06b203d

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,40 @@ The high level interface enables safe and robust parallel programming without di
1010

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

13+
### Intel TBB
14+
15+
`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).
16+
17+
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):
18+
19+
- 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).
20+
21+
For example, installing [oneTBB](https://github.com/oneapi-src/oneTBB) on Linux 64-bit (`x86_64`) to `$HOME` directory (change if needed!):
22+
```
23+
TBB_VERSION="2021.1.1"
24+
25+
wget https://github.com/oneapi-src/oneTBB/releases/download/v2021.1.1/oneapi-tbb-$TBB_VERSION-lin.tgz
26+
tar zxvf oneapi-tbb-$TBB_VERSION-lin.tgz -C $HOME
27+
28+
export TBB="$HOME/oneapi-tbb-$TBB_VERSION"
29+
```
30+
31+
- 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).
32+
33+
For example, installing [oneTBB](https://github.com/oneapi-src/oneTBB) on Linux 64-bit (`x86_64`) to `$HOME` directory (change if needed!):
34+
```
35+
source $TBB/env/vars.sh intel64
36+
37+
export TBB_INC="$TBB/include"
38+
export TBB_LIB="$TBB/lib/intel64/gcc4.8"
39+
```
40+
41+
- Build the development version of `RcppParallel`:
42+
```
43+
install.packages("remotes")
44+
remotes::install_github("RcppCore/RcppParallel@develop", force = TRUE)
45+
```
46+
1347
### License
1448

1549
The RcppParallel package is made available under the [GPLv2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html).

inst/NEWS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
RcppParallel 5.1.0 (UNRELEASED)
22
------------------------------------------------------------------------
33

4-
* Added support for external TBB library via TBB_INC and/or TBB_LIB environment variables.
4+
* Added support for external TBB library using TBB_INC and TBB_LIB environment variables.
5+
* Added support for the latest versions of Intel oneAPI TBB / oneTBB.
56
* Updated TBB functionality for the new interface.
67
* Falling back to building TBB from local source code.
78
* Backward TBB compatibility based on `__TBB_tbb_stddef_H`.

src/Makevars.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ ifdef TBB_LIB
104104
rm -Rf ../inst/include/tbb_local/; \
105105
mkdir -p ../inst/include; \
106106
cp -R $(TBB_INC)/serial ../inst/include/ 2>/dev/null || :; \
107+
cp -R $(TBB_INC)/oneapi ../inst/include/ 2>/dev/null || :; \
107108
cp -R $(TBB_INC)/tbb ../inst/include/ 2>/dev/null || :
108109
else
109110
echo "Building TBB library from source code..."; \

0 commit comments

Comments
 (0)