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

make TBB optional #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endif()
option(BUILD_TESTS "Build test" OFF)
option(BUILD_DEMO "Build demo programs" OFF)
option(BUILD_EXAMPLE "Build example programs" OFF)
option(BUILD_WITH_TBB "Build with TBB support" ON)
option(BUILD_WITH_TBB "Build with TBB support" OFF)
option(BUILD_WITH_OPENMP "Build with OpenMP support" ON)
option(BUILD_WITH_CUDA "Build with GPU support" OFF)
option(BUILD_WITH_CUDA_MULTIARCH "Build with CUDA multi-architecture support" OFF)
Expand Down
25 changes: 17 additions & 8 deletions cmake/FindGTSAM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,25 @@ find_library(GTSAM_UNSTABLE_LIB NAMES gtsam_unstable
HINTS /usr/local/lib /usr/lib
DOC "GTSAM_UNSTABLE libraries")

find_library(TBB_LIB NAMES tbb
HINTS /usr/local/lib /usr/lib
DOC "TBB libraries")

find_library(TBB_MALLOC_LIB NAMES tbbmalloc
HINTS /usr/local/lib /usr/lib
DOC "TBB malloc libraries")
if(GTSAM_LIB AND GTSAM_UNSTABLE_LIB)
set(GTSAM_LIBRARIES ${GTSAM_LIB} ${GTSAM_UNSTABLE_LIB})
endif()

if(GTSAM_LIB AND GTSAM_UNSTABLE_LIB AND TBB_LIB)
set(GTSAM_LIBRARIES ${GTSAM_LIB} ${GTSAM_UNSTABLE_LIB} ${TBB_LIB} ${TBB_MALLOC_LIB})
if(GTSAM_POINTS_USE_TBB)
find_library(TBB_LIB NAMES tbb
HINTS /usr/local/lib /usr/lib
DOC "TBB libraries")

find_library(TBB_MALLOC_LIB NAMES tbbmalloc
HINTS /usr/local/lib /usr/lib
DOC "TBB malloc libraries")

if(TBB_LIB AND TBB_MALLOC_LIB)
set(GTSAM_LIBRARIES ${GTSAM_LIBRARIES} ${TBB_LIB} ${TBB_MALLOC_LIB})
else()
message(FATAL_ERROR "TBB libraries not found")
endif()
endif()

add_library(GTSAM::GTSAM INTERFACE IMPORTED GLOBAL)
Expand Down
Loading