Skip to content

Commit

Permalink
Add FETCH_TBB/FETCH_ONEDPL changes from BabelStream
Browse files Browse the repository at this point in the history
  • Loading branch information
tom91136 committed Nov 27, 2023
1 parent 804b235 commit 7b26b03
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,20 @@ option(USE_TBB "Enable oneTBB library for *supported* models. Enabling this on m
don't explicitly link against TBB is a no-op, see description of your selected
model on how this is used." OFF)

if (USE_TBB)
option(FETCH_TBB "Fetch (download) the oneTBB library for *supported* models. This uses CMake's
FetchContent feature. Specify version by setting FETCH_TBB_VERSION" OFF)
set(FETCH_TBB_VERSION "v2021.10.0" CACHE STRING "Specify version of oneTBB to use if FETCH_TBB is ON")

if (FETCH_TBB)
FetchContent_Declare(
TBB
GIT_REPOSITORY https://github.com/oneapi-src/oneTBB.git
GIT_TAG faaf43c4ab22cb4b4267d65d5e218fa58800eea8
GIT_TAG "${FETCH_TBB_VERSION}"
)
# Don't fail builds on waring (TBB has -Wall while not being free of warnings from unused symbols...)
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
set(TBB_STRICT OFF)
# Not using FetchContent_MakeAvailable because we need EXCLUDE_FROM_ALL
# Not using FetchContent_MakeAvailable (CMake>= 3.14) because we need EXCLUDE_FROM_ALL
FetchContent_GetProperties(TBB)
if (NOT TBB_POPULATED)
FetchContent_Populate(TBB)
Expand All @@ -91,11 +95,15 @@ option(USE_ONEDPL "Enable oneDPL library for *supported* models. Enabling this o
don't explicitly link against DPL is a no-op, see description of your selected
model on how this is used." OFF)

if (USE_ONEDPL)
option(FETCH_ONEDPL "Fetch (download) the oneDPL library for *supported* models. This uses CMake's
FetchContent feature. Specify version by setting FETCH_ONEDPL_VERSION" OFF)
set(FETCH_ONEDPL_VERSION "oneDPL-2022.2.0-rc1" CACHE STRING "Specify version of oneTBB to use if FETCH_ONEDPL is ON")

if (FETCH_ONEDPL)
FetchContent_Declare(
oneDPL
GIT_REPOSITORY https://github.com/oneapi-src/oneDPL.git
GIT_TAG oneDPL-2022.2.0-rc1
GIT_TAG "${FETCH_ONEDPL_VERSION}"
)
string(TOLOWER ${USE_ONEDPL} ONEDPL_BACKEND)
# XXX oneDPL looks for omp instead of openmp, which mismatches(!) with ONEDPL_PAR_BACKEND if using find_package
Expand Down

0 comments on commit 7b26b03

Please sign in to comment.