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

Conversation

hsbadr
Copy link
Contributor

@hsbadr hsbadr commented Jan 2, 2021

This builds on #141 to support for the latest versions of Intel oneTBB / OneAPI and closes #145.

The latest version of oneAPI/oneTBB redirects the TBB headers to a relative path (#include "../oneapi/tbb.h") and we copy tbb headers in inst/include/tbb without the headers in oneapi. This causes a Catastrophic Error (missing headers) because the relative path doesn't exist.

So, make sure that we copy TBB headers in $TBB_INC/oneapi.

  • Updated Makevars.in to copy oneapi TBB headers and fix building errors.
  • Added instructions for using external TBB library.
  • Updated NEWS.

Tests

To build the development version of RcppParallel with oneTBB or OneAPI:

For example, installing 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 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"
    #export LD_LIBRARY_PATH="$TBB_LIB:$LD_LIBRARY_PATH"

    # Checks:
    ls -lAh $TBB_INC
    # should list `oneapi` and `tbb` directories that include the headers
    ls -lAh $TBB_LIB
    # should list the TBB libraries, including `libtbb.so`
  • Build the development version of RcppParallel:
install.packages("remotes")
remotes::install_github("hsbadr/RcppParallel@develop", force = TRUE)

@kevinushey
Copy link
Contributor

LGTM! Thank you for the very thorough pull request, and I especially appreciate the NEWS update.

@kevinushey kevinushey merged commit 06b203d into RcppCore:master Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Building the development version fails with the latest oneTBB
2 participants