diff mbox series

package/python-threadpoolctl: new host-only package

Message ID 20220219182224.3397-1-guillaume.bressaix@gmail.com
State Changes Requested
Headers show
Series package/python-threadpoolctl: new host-only package | expand

Commit Message

Guillaume Bres Feb. 19, 2022, 6:22 p.m. UTC
Tool to limit the number of threads used in the threadpool-backed
of common native libraries used for scientific computing (e.g. BLAS and OpenMP).

Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com>

---
host-python-threadpoolctl is a requirement for python-scikitlearn,
which first requires the current python-scipy work to be merged

Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com>
---
 DEVELOPERS                                    |  1 +
 .../python-threadpoolctl.hash                 |  3 +++
 .../python-threadpoolctl.mk                   | 22 +++++++++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 package/python-threadpoolctl/python-threadpoolctl.hash
 create mode 100644 package/python-threadpoolctl/python-threadpoolctl.mk

Comments

Thomas Petazzoni July 27, 2022, 6:27 a.m. UTC | #1
Hello Guillaume,

On Sat, 19 Feb 2022 19:22:24 +0100
"Guillaume W. Bres" <guillaume.bressaix@gmail.com> wrote:

> Tool to limit the number of threads used in the threadpool-backed
> of common native libraries used for scientific computing (e.g. BLAS and OpenMP).
> 
> Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com>
> 
> ---
> host-python-threadpoolctl is a requirement for python-scikitlearn,
> which first requires the current python-scipy work to be merged
> 
> Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com>

I have the same comment as for python-joblib: could you resend this
patch as part of a patch series that includes python-scikitlearn. This
is to avoid having orphan host packages in Buildroot, which are not
used by anything, and therefore not buildable.

> +PYTHON_THREADPOOLCTL_VERSION = 3.1.0
> +PYTHON_THREADPOOLCTL_SITE = $(call github,joblib,threadpoolctl,$(PYTHON_THREADPOOLCTL_VERSION),$(PYTHON_THREADPOOLCTL_VERSION).tar.gz)

The github macro only takes 3 arguments, not 4.

> +PYTHON_THREADPOOLCTL_LICENSE = BSD-3-Clause
> +PYTHON_THREADPOOLCTL_LICENSE_FILES = LICENSE
> +
> +# threadpoolctl is originally built using 'flit' which
> +# simply symlinks $(@)/threadpoolctl.py to site-packages

We now have flit support in Buildroot. Could you have a look if this
help in making this package a bit better?

Thanks !

Thomas
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index ac702d8d0f..53ebdbe760 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1149,6 +1149,7 @@  F:	package/libxcrypt/
 F:	package/liquid-dsp/
 F:	package/pixiewps/
 F:	package/python-pybind/
+F:	package/python-threadpoolctl/
 F:	package/reaver/
 F:	support/testing/tests/package/br2-external/python-pybind
 F:	support/testing/tests/package/sample_python_pybind.py
diff --git a/package/python-threadpoolctl/python-threadpoolctl.hash b/package/python-threadpoolctl/python-threadpoolctl.hash
new file mode 100644
index 0000000000..6b6fa72443
--- /dev/null
+++ b/package/python-threadpoolctl/python-threadpoolctl.hash
@@ -0,0 +1,3 @@ 
+# Locally calculated
+sha256  449b806f9147a3cf28ed7ec6389dbff9c450331d695873ab75dea79fe661f1e7  python-threadpoolctl-3.1.0.tar.gz
+sha256  81ac619075248b06e53660b652d10e485f4675f5d0ae0f97ea22370da1f7e23b  LICENSE
diff --git a/package/python-threadpoolctl/python-threadpoolctl.mk b/package/python-threadpoolctl/python-threadpoolctl.mk
new file mode 100644
index 0000000000..fc1305ad86
--- /dev/null
+++ b/package/python-threadpoolctl/python-threadpoolctl.mk
@@ -0,0 +1,22 @@ 
+################################################################################
+#
+# python-threadpoolctl
+#
+################################################################################
+
+PYTHON_THREADPOOLCTL_VERSION = 3.1.0
+PYTHON_THREADPOOLCTL_SITE = $(call github,joblib,threadpoolctl,$(PYTHON_THREADPOOLCTL_VERSION),$(PYTHON_THREADPOOLCTL_VERSION).tar.gz)
+PYTHON_THREADPOOLCTL_LICENSE = BSD-3-Clause
+PYTHON_THREADPOOLCTL_LICENSE_FILES = LICENSE
+
+# threadpoolctl is originally built using 'flit' which
+# simply symlinks $(@)/threadpoolctl.py to site-packages
+define PYTHON_THREADPOOLCTL_BUILD_CMDS
+endef
+
+define PYTHON_THREADPOOLCTL_INSTALL_CMDS
+	ln -sf $(@)/threadpoolctl.py \
+		$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/threadpoolctl.py
+endef
+
+$(eval $(host-generic-package))