Skip to content

Commit 7c1d57b

Browse files
committed
README: Add instructions for using external TBB
1 parent a589e78 commit 7c1d57b

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,47 @@ 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) or [OneAPI](https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-toolkit-release-notes.html)), 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+
#export LD_LIBRARY_PATH="$TBB_LIB:$LD_LIBRARY_PATH"
40+
41+
# Checks:
42+
ls -lAh $TBB_INC
43+
# should list `oneapi` and `tbb` directories that include the headers
44+
ls -lAh $TBB_LIB
45+
# should list the TBB libraries, including `libtbb.so`
46+
```
47+
48+
- Build the development version of `RcppParallel`:
49+
```
50+
install.packages("remotes")
51+
remotes::install_github("hsbadr/RcppParallel@develop", force = TRUE)
52+
```
53+
1354
### License
1455

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

0 commit comments

Comments
 (0)