diff mbox series

[v5,04/10] package/pthreadpool: new package

Message ID 20230130002854.2300661-4-james.hilliard1@gmail.com
State Superseded, archived
Headers show
Series [v5,01/10] package/cpuinfo: new package | expand

Commit Message

James Hilliard Jan. 30, 2023, 12:28 a.m. UTC
This package is required by tensorflow-lite.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 DEVELOPERS                           |  1 +
 package/Config.in                    |  1 +
 package/pthreadpool/Config.in        |  8 +++++++
 package/pthreadpool/pthreadpool.hash |  4 ++++
 package/pthreadpool/pthreadpool.mk   | 33 ++++++++++++++++++++++++++++
 5 files changed, 47 insertions(+)
 create mode 100644 package/pthreadpool/Config.in
 create mode 100644 package/pthreadpool/pthreadpool.hash
 create mode 100644 package/pthreadpool/pthreadpool.mk

Comments

Romain Naour Feb. 6, 2023, 7:04 p.m. UTC | #1
Le 30/01/2023 à 01:28, James Hilliard a écrit :
> This package is required by tensorflow-lite.
> 
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> ---
>  DEVELOPERS                           |  1 +
>  package/Config.in                    |  1 +
>  package/pthreadpool/Config.in        |  8 +++++++
>  package/pthreadpool/pthreadpool.hash |  4 ++++
>  package/pthreadpool/pthreadpool.mk   | 33 ++++++++++++++++++++++++++++
>  5 files changed, 47 insertions(+)
>  create mode 100644 package/pthreadpool/Config.in
>  create mode 100644 package/pthreadpool/pthreadpool.hash
>  create mode 100644 package/pthreadpool/pthreadpool.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 01e64e5fc5..6d25f44dcd 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -2726,6 +2726,7 @@ F:	package/ti-gfx/
>  N:	Stefan Hager <stefan.hager@ginzinger.com>
>  F:	package/cpuinfo/
>  F:	package/gemmlowp/
> +F:	package/pthreadpool/
>  F:	package/ruy/
>  
>  N:	Stefan Ott <stefan@ott.net>
> diff --git a/package/Config.in b/package/Config.in
> index 8fd8f05bd6..873aade1a6 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -2118,6 +2118,7 @@ endif
>  	source "package/protobuf/Config.in"
>  	source "package/protobuf-c/Config.in"
>  	source "package/protozero/Config.in"
> +	source "package/pthreadpool/Config.in"
>  	source "package/qhull/Config.in"
>  	source "package/qlibc/Config.in"
>  	source "package/riemann-c-client/Config.in"
> diff --git a/package/pthreadpool/Config.in b/package/pthreadpool/Config.in
> new file mode 100644
> index 0000000000..194ae33f85
> --- /dev/null
> +++ b/package/pthreadpool/Config.in
> @@ -0,0 +1,8 @@
> +config BR2_PACKAGE_PTHREADPOOL
> +	bool "pthreadpool"

The CMakelists.txt requires C++ support:

PROJECT(pthreadpool C CXX)

Toolchain with threads support seems to be required:

src/pthreads.c:#include <pthread.h>
src/threadpool-object.h:#include <pthread.h>

Best regards,
Romain


> +	select BR2_PACKAGE_FXDIV
> +	help
> +	  Pthreadpool is a portable and efficient thread pool
> +	  implementation.
> +
> +	  https://github.com/Maratyszcza/pthreadpool
> diff --git a/package/pthreadpool/pthreadpool.hash b/package/pthreadpool/pthreadpool.hash
> new file mode 100644
> index 0000000000..164ac55390
> --- /dev/null
> +++ b/package/pthreadpool/pthreadpool.hash
> @@ -0,0 +1,4 @@
> +# Locally calculated
> +sha256  ae75adb19807ea28582683b38dd4e79a6b287751452564b42e214bb21216ef14  pthreadpool-43edadc654d6283b4b6e45ba09a853181ae8e850.tar.gz
> +# License files, locally calculated
> +sha256  57814a606b4d0fb087d9a534919084b6c11b58a4174cb5a4aef200187780dc3a  LICENSE
> diff --git a/package/pthreadpool/pthreadpool.mk b/package/pthreadpool/pthreadpool.mk
> new file mode 100644
> index 0000000000..4ef7949da2
> --- /dev/null
> +++ b/package/pthreadpool/pthreadpool.mk
> @@ -0,0 +1,33 @@
> +################################################################################
> +#
> +# pthreadpool
> +#
> +################################################################################
> +
> +PTHREADPOOL_VERSION = 43edadc654d6283b4b6e45ba09a853181ae8e850
> +PTHREADPOOL_SITE = $(call github,Maratyszcza,pthreadpool,$(PTHREADPOOL_VERSION))
> +PTHREADPOOL_LICENSE = BSD-2-Clause
> +PTHREADPOOL_LICENSE_FILES = LICENSE
> +PTHREADPOOL_INSTALL_STAGING = YES
> +PTHREADPOOL_DEPENDENCIES = fxdiv
> +
> +PTHREADPOOL_CFLAGS = $(TARGET_CFLAGS)
> +PTHREADPOOL_CXXFLAGS = $(TARGET_CXXFLAGS)
> +
> +ifeq ($(BR2_PACKAGE_CPUINFO),y)
> +PTHREADPOOL_DEPENDENCIES += cpuinfo
> +PTHREADPOOL_CFLAGS += -DPTHREADPOOL_USE_CPUINFO=1
> +PTHREADPOOL_CXXFLAGS += -DPTHREADPOOL_USE_CPUINFO=1
> +else
> +PTHREADPOOL_CFLAGS += -DPTHREADPOOL_USE_CPUINFO=0
> +PTHREADPOOL_CXXFLAGS += -DPTHREADPOOL_USE_CPUINFO=0
> +endif
> +
> +PTHREADPOOL_CONF_OPTS = \
> +	-DCMAKE_C_FLAGS="$(PTHREADPOOL_CFLAGS)" \
> +	-DCMAKE_CXX_FLAGS="$(PTHREADPOOL_CXXFLAGS)" \
> +	-DFXDIV_SOURCE_DIR="$(FXDIV_DIR)" \
> +	-DPTHREADPOOL_BUILD_TESTS=OFF \
> +	-DPTHREADPOOL_BUILD_BENCHMARKS=OFF
> +
> +$(eval $(cmake-package))
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index 01e64e5fc5..6d25f44dcd 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2726,6 +2726,7 @@  F:	package/ti-gfx/
 N:	Stefan Hager <stefan.hager@ginzinger.com>
 F:	package/cpuinfo/
 F:	package/gemmlowp/
+F:	package/pthreadpool/
 F:	package/ruy/
 
 N:	Stefan Ott <stefan@ott.net>
diff --git a/package/Config.in b/package/Config.in
index 8fd8f05bd6..873aade1a6 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2118,6 +2118,7 @@  endif
 	source "package/protobuf/Config.in"
 	source "package/protobuf-c/Config.in"
 	source "package/protozero/Config.in"
+	source "package/pthreadpool/Config.in"
 	source "package/qhull/Config.in"
 	source "package/qlibc/Config.in"
 	source "package/riemann-c-client/Config.in"
diff --git a/package/pthreadpool/Config.in b/package/pthreadpool/Config.in
new file mode 100644
index 0000000000..194ae33f85
--- /dev/null
+++ b/package/pthreadpool/Config.in
@@ -0,0 +1,8 @@ 
+config BR2_PACKAGE_PTHREADPOOL
+	bool "pthreadpool"
+	select BR2_PACKAGE_FXDIV
+	help
+	  Pthreadpool is a portable and efficient thread pool
+	  implementation.
+
+	  https://github.com/Maratyszcza/pthreadpool
diff --git a/package/pthreadpool/pthreadpool.hash b/package/pthreadpool/pthreadpool.hash
new file mode 100644
index 0000000000..164ac55390
--- /dev/null
+++ b/package/pthreadpool/pthreadpool.hash
@@ -0,0 +1,4 @@ 
+# Locally calculated
+sha256  ae75adb19807ea28582683b38dd4e79a6b287751452564b42e214bb21216ef14  pthreadpool-43edadc654d6283b4b6e45ba09a853181ae8e850.tar.gz
+# License files, locally calculated
+sha256  57814a606b4d0fb087d9a534919084b6c11b58a4174cb5a4aef200187780dc3a  LICENSE
diff --git a/package/pthreadpool/pthreadpool.mk b/package/pthreadpool/pthreadpool.mk
new file mode 100644
index 0000000000..4ef7949da2
--- /dev/null
+++ b/package/pthreadpool/pthreadpool.mk
@@ -0,0 +1,33 @@ 
+################################################################################
+#
+# pthreadpool
+#
+################################################################################
+
+PTHREADPOOL_VERSION = 43edadc654d6283b4b6e45ba09a853181ae8e850
+PTHREADPOOL_SITE = $(call github,Maratyszcza,pthreadpool,$(PTHREADPOOL_VERSION))
+PTHREADPOOL_LICENSE = BSD-2-Clause
+PTHREADPOOL_LICENSE_FILES = LICENSE
+PTHREADPOOL_INSTALL_STAGING = YES
+PTHREADPOOL_DEPENDENCIES = fxdiv
+
+PTHREADPOOL_CFLAGS = $(TARGET_CFLAGS)
+PTHREADPOOL_CXXFLAGS = $(TARGET_CXXFLAGS)
+
+ifeq ($(BR2_PACKAGE_CPUINFO),y)
+PTHREADPOOL_DEPENDENCIES += cpuinfo
+PTHREADPOOL_CFLAGS += -DPTHREADPOOL_USE_CPUINFO=1
+PTHREADPOOL_CXXFLAGS += -DPTHREADPOOL_USE_CPUINFO=1
+else
+PTHREADPOOL_CFLAGS += -DPTHREADPOOL_USE_CPUINFO=0
+PTHREADPOOL_CXXFLAGS += -DPTHREADPOOL_USE_CPUINFO=0
+endif
+
+PTHREADPOOL_CONF_OPTS = \
+	-DCMAKE_C_FLAGS="$(PTHREADPOOL_CFLAGS)" \
+	-DCMAKE_CXX_FLAGS="$(PTHREADPOOL_CXXFLAGS)" \
+	-DFXDIV_SOURCE_DIR="$(FXDIV_DIR)" \
+	-DPTHREADPOOL_BUILD_TESTS=OFF \
+	-DPTHREADPOOL_BUILD_BENCHMARKS=OFF
+
+$(eval $(cmake-package))