diff options
author | Ludovic Courtès <ludovic.courtes@inria.fr> | 2021-07-29 14:25:17 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2021-07-29 21:54:54 +0200 |
commit | 18d04fef0fea2c604b42c465782f3be647c2b947 (patch) | |
tree | 933be4774429dda5e0d7fbbe4c1cafc66b574cd3 /gnu/packages/patches | |
parent | a9bc8a25eb9a5851062167a3475622ba6b1a8b9a (diff) | |
download | guix-18d04fef0fea2c604b42c465782f3be647c2b947.tar guix-18d04fef0fea2c604b42c465782f3be647c2b947.tar.gz |
gnu: Add pthreadpool.
* gnu/packages/parallel.scm (pthreadpool): New variable.
* gnu/packages/patches/pthreadpool-system-libraries.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r-- | gnu/packages/patches/pthreadpool-system-libraries.patch | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/gnu/packages/patches/pthreadpool-system-libraries.patch b/gnu/packages/patches/pthreadpool-system-libraries.patch new file mode 100644 index 0000000000..3cfe9c1af6 --- /dev/null +++ b/gnu/packages/patches/pthreadpool-system-libraries.patch @@ -0,0 +1,79 @@ +This patch allows the build process to use the provided dependencies instead +of adding their source as CMake sub-directories (in which case "make install" +would install googletest's and googlebenchmark's libraries and headers). + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c1cba55..627550f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -36,7 +36,7 @@ MACRO(PTHREADPOOL_TARGET_ENABLE_CXX11 target) + ENDMACRO() + + # ---[ Download deps +-IF(NOT DEFINED FXDIV_SOURCE_DIR) ++IF(FALSE) + MESSAGE(STATUS "Downloading FXdiv to ${CMAKE_BINARY_DIR}/FXdiv-source (define FXDIV_SOURCE_DIR to avoid it)") + CONFIGURE_FILE(cmake/DownloadFXdiv.cmake "${CMAKE_BINARY_DIR}/FXdiv-download/CMakeLists.txt") + EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" . +@@ -46,7 +46,7 @@ IF(NOT DEFINED FXDIV_SOURCE_DIR) + SET(FXDIV_SOURCE_DIR "${CMAKE_BINARY_DIR}/FXdiv-source" CACHE STRING "FXdiv source directory") + ENDIF() + +-IF(PTHREADPOOL_BUILD_TESTS AND NOT DEFINED GOOGLETEST_SOURCE_DIR) ++IF(FALSE) + MESSAGE(STATUS "Downloading Google Test to ${CMAKE_BINARY_DIR}/googletest-source (define GOOGLETEST_SOURCE_DIR to avoid it)") + CONFIGURE_FILE(cmake/DownloadGoogleTest.cmake "${CMAKE_BINARY_DIR}/googletest-download/CMakeLists.txt") + EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" . +@@ -56,7 +56,7 @@ IF(PTHREADPOOL_BUILD_TESTS AND NOT DEFINED GOOGLETEST_SOURCE_DIR) + SET(GOOGLETEST_SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-source" CACHE STRING "Google Test source directory") + ENDIF() + +-IF(PTHREADPOOL_BUILD_BENCHMARKS AND NOT DEFINED GOOGLEBENCHMARK_SOURCE_DIR) ++IF(FALSE) + MESSAGE(STATUS "Downloading Google Benchmark to ${CMAKE_BINARY_DIR}/googlebenchmark-source (define GOOGLEBENCHMARK_SOURCE_DIR to avoid it)") + CONFIGURE_FILE(cmake/DownloadGoogleBenchmark.cmake "${CMAKE_BINARY_DIR}/googlebenchmark-download/CMakeLists.txt") + EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" . +@@ -150,27 +150,18 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") + ENDIF() + + # ---[ Configure FXdiv +-IF(NOT TARGET fxdiv) ++IF(FALSE) + SET(FXDIV_BUILD_TESTS OFF CACHE BOOL "") + SET(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "") + ADD_SUBDIRECTORY( + "${FXDIV_SOURCE_DIR}" + "${CMAKE_BINARY_DIR}/FXdiv") + ENDIF() +-TARGET_LINK_LIBRARIES(pthreadpool PRIVATE fxdiv) +- + INSTALL(TARGETS pthreadpool + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + IF(PTHREADPOOL_BUILD_TESTS) +- # ---[ Build google test +- IF(NOT TARGET gtest) +- SET(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +- ADD_SUBDIRECTORY( +- "${GOOGLETEST_SOURCE_DIR}" +- "${CMAKE_BINARY_DIR}/googletest") +- ENDIF() + + ADD_EXECUTABLE(pthreadpool-test test/pthreadpool.cc) + SET_TARGET_PROPERTIES(pthreadpool-test PROPERTIES +@@ -188,14 +179,6 @@ IF(PTHREADPOOL_BUILD_TESTS) + ENDIF() + + IF(PTHREADPOOL_BUILD_BENCHMARKS) +- # ---[ Build google benchmark +- IF(NOT TARGET benchmark) +- SET(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "") +- ADD_SUBDIRECTORY( +- "${GOOGLEBENCHMARK_SOURCE_DIR}" +- "${CMAKE_BINARY_DIR}/googlebenchmark") +- ENDIF() +- + ADD_EXECUTABLE(latency-bench bench/latency.cc) + SET_TARGET_PROPERTIES(latency-bench PROPERTIES + CXX_STANDARD 11 |