summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2019-08-17 19:24:47 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2019-08-17 19:24:47 +0000
commit06985325fc74c1c26e4c978a6772ebdc5afb576e (patch)
tree452ec9a2d78195342502fa08ae3e5a89b978bc02
parentbaac500f89c1edfe3fa4792022294d1f4c47af9c (diff)
downloadfreebsd-ports-06985325fc74c1c26e4c978a6772ebdc5afb576e.zip
New port: devel/pthreadpool: Pthread-based thread pool for C/C++ for arrays parallelization
-rw-r--r--devel/Makefile1
-rw-r--r--devel/pthreadpool/Makefile33
-rw-r--r--devel/pthreadpool/distinfo3
-rw-r--r--devel/pthreadpool/files/patch-CMakeLists.txt28
-rw-r--r--devel/pthreadpool/pkg-descr12
5 files changed, 77 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index 8140a9d13f76..74eb6c373126 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -3980,6 +3980,7 @@
SUBDIR += psvn
SUBDIR += pth
SUBDIR += pth-hard
+ SUBDIR += pthreadpool
SUBDIR += pthsem
SUBDIR += ptlib
SUBDIR += ptmalloc
diff --git a/devel/pthreadpool/Makefile b/devel/pthreadpool/Makefile
new file mode 100644
index 000000000000..720461b20ee2
--- /dev/null
+++ b/devel/pthreadpool/Makefile
@@ -0,0 +1,33 @@
+# $FreeBSD$
+
+PORTNAME= pthreadpool
+PORTVERSION= g20181121
+CATEGORIES= devel
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Pthread-based thread pool for C/C++ for arrays parallelization
+
+LICENSE= BSD2CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= ${LOCALBASE}/include/fxdiv.h:devel/fxdiv
+
+USES= cmake localbase
+USE_GITHUB= yes
+GH_ACCOUNT= Maratyszcza
+GH_TAGNAME= 6673a4c
+USE_LDCONFIG= yes
+
+CMAKE_OFF= PTHREADPOOL_BUILD_TESTS PTHREADPOOL_BUILD_BENCHMARKS
+CMAKE_ON= BUILD_SHARED_LIBS
+
+PLIST_FILES= include/pthreadpool.h \
+ lib/libpthreadpool.so
+
+do-test:
+ @cd ${BUILD_WRKSRC} && \
+ ${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} -DPTHREADPOOL_BUILD_TESTS:BOOL=ON ${CMAKE_SOURCE_PATH} && \
+ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${ALL_TARGET} && \
+ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} test
+
+.include <bsd.port.mk>
diff --git a/devel/pthreadpool/distinfo b/devel/pthreadpool/distinfo
new file mode 100644
index 000000000000..12ab4c3e187f
--- /dev/null
+++ b/devel/pthreadpool/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1566067037
+SHA256 (Maratyszcza-pthreadpool-g20181121-6673a4c_GH0.tar.gz) = aa8a46618356c910ec9e3dabb310253ea76b314f9875611edd7fa374c0bf6f80
+SIZE (Maratyszcza-pthreadpool-g20181121-6673a4c_GH0.tar.gz) = 12742
diff --git a/devel/pthreadpool/files/patch-CMakeLists.txt b/devel/pthreadpool/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..4b40f3fa89c8
--- /dev/null
+++ b/devel/pthreadpool/files/patch-CMakeLists.txt
@@ -0,0 +1,28 @@
+--- CMakeLists.txt.orig 2018-11-21 22:52:31 UTC
++++ CMakeLists.txt
+@@ -34,7 +34,7 @@ SET(CONFU_DEPENDENCIES_SOURCE_DIR ${CMAKE_SOURCE_DIR}/
+ SET(CONFU_DEPENDENCIES_BINARY_DIR ${CMAKE_BINARY_DIR}/deps
+ CACHE PATH "Confu-style dependencies binary directory")
+
+-IF(NOT DEFINED FXDIV_SOURCE_DIR)
++IF(FALSE AND NOT DEFINED FXDIV_SOURCE_DIR)
+ MESSAGE(STATUS "Downloading FXdiv to ${CONFU_DEPENDENCIES_SOURCE_DIR}/fxdiv (define FXDIV_SOURCE_DIR to avoid it)")
+ CONFIGURE_FILE(cmake/DownloadFXdiv.cmake "${CONFU_DEPENDENCIES_BINARY_DIR}/fxdiv-download/CMakeLists.txt")
+ EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
+@@ -109,14 +109,14 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ ENDIF()
+
+ # ---[ Configure FXdiv
+-IF(NOT TARGET fxdiv)
++IF(FALSE AND NOT TARGET fxdiv)
+ SET(FXDIV_BUILD_TESTS OFF CACHE BOOL "")
+ SET(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "")
+ ADD_SUBDIRECTORY(
+ "${FXDIV_SOURCE_DIR}"
+ "${CONFU_DEPENDENCIES_BINARY_DIR}/fxdiv")
+ ENDIF()
+-TARGET_LINK_LIBRARIES(pthreadpool PRIVATE fxdiv)
++#TARGET_LINK_LIBRARIES(pthreadpool PRIVATE fxdiv)
+
+ INSTALL(TARGETS pthreadpool
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
diff --git a/devel/pthreadpool/pkg-descr b/devel/pthreadpool/pkg-descr
new file mode 100644
index 000000000000..45a3cfb4c9c7
--- /dev/null
+++ b/devel/pthreadpool/pkg-descr
@@ -0,0 +1,12 @@
+pthreadpool is a pthread-based thread pool implementation. It is intended to
+provide functionality of #pragma omp parallel for for POSIX systems where OpenMP
+is not available.
+
+Features:
+* C interface (C++-compatible)
+* Run on user-specified or auto-detected number of threads
+* Work-stealing scheduling for efficient work balancing
+* Compatible with Linux, macOS, and Native Client environments
+* Covered with unit tests and microbenchmarks
+
+WWW: https://github.com/Maratyszcza/pthreadpool