Skip to content

Commit

Permalink
try enable tbb for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
pca006132 committed Aug 5, 2023
1 parent ac1aab8 commit 5858ff8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/manifold.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ jobs:
timeout-minutes: 30
strategy:
matrix:
parallel_backend: [NONE]
parallel_backend: [NONE, TBB]
cuda_support: [OFF]
max-parallel: 1
runs-on: windows-2019
Expand Down
31 changes: 26 additions & 5 deletions src/utilities/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,32 @@ if(MANIFOLD_PAR STREQUAL "OMP")
target_compile_options(${PROJECT_NAME} PUBLIC -DMANIFOLD_PAR='O' -fopenmp)
target_link_options(${PROJECT_NAME} PUBLIC -fopenmp)
elseif(MANIFOLD_PAR STREQUAL "TBB")
find_package(PkgConfig REQUIRED)
pkg_check_modules(TBB REQUIRED tbb)
target_include_directories(${PROJECT_NAME} PUBLIC ${TBB_INCLUDE_DIRS})
find_package(TBB QUIET)
if(NOT TBB_FOUND)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(TBB tbb)
endif()
endif()
if(NOT TBB_FOUND)
message(STATUS "tbb not found, downloading from source")
set(TBB_TEST off)
set(TBB_STRICT off)
include(FetchContent)
FetchContent_Declare(TBB
GIT_REPOSITORY https://github.com/oneapi-src/oneTBB.git
GIT_TAG v2021.10.0
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
FetchContent_MakeAvailable(TBB)
endif()
target_compile_options(${PROJECT_NAME} PUBLIC -DMANIFOLD_PAR='T')
target_link_libraries(${PROJECT_NAME} PUBLIC ${TBB_LINK_LIBRARIES})
if(DEFINED TBB::tbb)
target_link_libraries(${PROJECT_NAME} PUBLIC TBB::tbb)
else()
target_link_libraries(${PROJECT_NAME} PUBLIC ${TBB_LINK_LIBRARIES})
endif()
elseif(MANIFOLD_PAR STREQUAL "NONE")
set(MANIFOLD_PAR "CPP")
else()
Expand Down Expand Up @@ -63,4 +84,4 @@ if(MANIFOLD_DEBUG)
PUBLIC -DMANIFOLD_DEBUG)
endif()

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)

0 comments on commit 5858ff8

Please sign in to comment.