Skip to content

Commit

Permalink
xor: add option to encode with pthreads
Browse files Browse the repository at this point in the history
  • Loading branch information
adammoody committed Nov 20, 2023
1 parent 8f368e1 commit a04288c
Show file tree
Hide file tree
Showing 4 changed files with 346 additions and 7 deletions.
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ MESSAGE(STATUS "REDSET_LINK_STATIC: ${REDSET_LINK_STATIC}")
OPTION(ENABLE_CUDA "Whether to enable CUDA support" OFF)
MESSAGE(STATUS "ENABLE_CUDA: ${ENABLE_CUDA}")

OPTION(ENABLE_PTHREADS "Whether to enable pthreads support" ON)
MESSAGE(STATUS "ENABLE_PTHREADS: ${ENABLE_PTHREADS}")

OPTION(ENABLE_TESTS "Whether to build tests" ON)
MESSAGE(STATUS "ENABLE_TESTS: ${ENABLE_TESTS}")

Expand Down Expand Up @@ -84,6 +87,16 @@ LIST(APPEND REDSET_EXTERNAL_STATIC_LIBS ZLIB::ZLIB)
LIST(APPEND REDSET_SERIAL_LIBS ZLIB::ZLIB)
LIST(APPEND REDSET_SERIAL_STATIC_LIBS ZLIB::ZLIB)

# PTHREADS
IF(ENABLE_PTHREADS)
FIND_PACKAGE(Threads REQUIRED)
IF(CMAKE_USE_PTHREADS_INIT)
SET(HAVE_PTHREADS TRUE)
LIST(APPEND REDSET_EXTERNAL_LIBS Threads::Threads)
LIST(APPEND REDSET_EXTERNAL_STATIC_LIBS Threads::Threads)
ENDIF()
ENDIF(ENABLE_PTHREADS)

## HEADERS
INCLUDE(CheckIncludeFile)
INCLUDE(GNUInstallDirs)
Expand Down
1 change: 1 addition & 0 deletions cmake/config.h.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
// System Specific
#cmakedefine HAVE_BYTESWAP_H
#cmakedefine HAVE_PTHREADS
4 changes: 4 additions & 0 deletions cmake/redsetConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ find_dependency(rankstr REQUIRED)
find_dependency(MPI REQUIRED)
find_dependency(ZLIB REQUIRED)

if (@HAVE_PTHREADS@)
find_dependency(Threads REQUIRED)
endif()

include("${CMAKE_CURRENT_LIST_DIR}/redsetTargets.cmake")
Loading

0 comments on commit a04288c

Please sign in to comment.