All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v8 0/5] package/python-scipy: new package
@ 2020-04-07 11:15 Jagan Teki
  2020-04-07 11:15 ` [Buildroot] [PATCH v8 1/5] package/python-numpy: Bump to version 1.18.2 Jagan Teki
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Jagan Teki @ 2020-04-07 11:15 UTC (permalink / raw)
  To: buildroot

This is v8 changes for python-scipy, here is the previous 
version series[1].

Changes for v8:
- add python-pybind11 tests from Adam
Changes for v7:
- bump 1.181.2 numpy
- drop 'BR2_PACKAGE_HOST_PYTHON_CYTHON' selection from numpy
- drop python2 dependency from gnuradio.mk
- drop python2 dependency from opencv3.mk
- rephrase commit and comments of fixup npymath.ini
- update commit message of pybind11, scipy
- fix sha256 value of pybind11 LICENCE
- drop 'BR2_PACKAGE_HOST_PYTHON_PYBIND11' selection from scipy 
Changes for v6:
- bump to numpy latest version
- drop python2 dependecy on numpy seelcted packages
- update numpy cross compilation changes
- add pybind11 package
- add latest python-scipy

[1] https://patchwork.ozlabs.org/cover/1259531/

Any inputs?
Jagan.

Adam Duskett (1):
  support/testing: add python-pybind11 test

Esben Haabendal (1):
  package/python-numpy: fixup npymath.ini for numpy extensions

Jagan Teki (3):
  package/python-numpy: Bump to version 1.18.2
  package/python-pybind11: new host package
  package/python-scipy: new package

 .gitlab-ci.yml                                |  2 +
 DEVELOPERS                                    |  4 +
 package/Config.in                             |  1 +
 package/Config.in.host                        |  1 +
 package/gnuradio/Config.in                    |  2 +-
 package/gnuradio/gnuradio.mk                  |  4 +-
 package/opencv3/Config.in                     |  2 +-
 package/opencv3/opencv3.mk                    | 14 ----
 package/python-numpy/Config.in                |  1 +
 package/python-numpy/python-numpy.hash        | 14 ++--
 package/python-numpy/python-numpy.mk          | 19 ++++-
 package/python-pybind11/Config.in.host        |  7 ++
 package/python-pybind11/python-pybind11.hash  |  5 ++
 package/python-pybind11/python-pybind11.mk    | 14 ++++
 package/python-scipy/Config.in                | 22 ++++++
 package/python-scipy/python-scipy.hash        |  9 +++
 package/python-scipy/python-scipy.mk          | 46 +++++++++++
 .../br2-external/python-pybind11/Config.in    |  1 +
 .../python-pybind11/external.desc             |  1 +
 .../br2-external/python-pybind11/external.mk  |  1 +
 .../Config.in                                 |  5 ++
 .../pybind11_addition_example.cpp             |  9 +++
 .../python-pybind11-addition-example.mk       | 39 ++++++++++
 .../sample_python_pybind11.py                 |  4 +
 .../tests/package/test_python_pybind11.py     | 76 +++++++++++++++++++
 25 files changed, 277 insertions(+), 26 deletions(-)
 create mode 100644 package/python-pybind11/Config.in.host
 create mode 100644 package/python-pybind11/python-pybind11.hash
 create mode 100644 package/python-pybind11/python-pybind11.mk
 create mode 100644 package/python-scipy/Config.in
 create mode 100644 package/python-scipy/python-scipy.hash
 create mode 100644 package/python-scipy/python-scipy.mk
 create mode 100644 support/testing/tests/package/br2-external/python-pybind11/Config.in
 create mode 100644 support/testing/tests/package/br2-external/python-pybind11/external.desc
 create mode 100644 support/testing/tests/package/br2-external/python-pybind11/external.mk
 create mode 100644 support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/Config.in
 create mode 100644 support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/pybind11_addition_example.cpp
 create mode 100644 support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/python-pybind11-addition-example.mk
 create mode 100644 support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/sample_python_pybind11.py
 create mode 100644 support/testing/tests/package/test_python_pybind11.py

-- 
2.17.1

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v8 1/5] package/python-numpy: Bump to version 1.18.2
  2020-04-07 11:15 [Buildroot] [PATCH v8 0/5] package/python-scipy: new package Jagan Teki
@ 2020-04-07 11:15 ` Jagan Teki
  2020-05-01 12:37   ` Thomas Petazzoni
  2020-04-07 11:15 ` [Buildroot] [PATCH v8 2/5] package/python-numpy: fixup npymath.ini for numpy extensions Jagan Teki
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Jagan Teki @ 2020-04-07 11:15 UTC (permalink / raw)
  To: buildroot

Bump the python-numpy version to 1.18.2, this version
of python-numpy will support python3 only, not python2.

Drop python2 dependency from opencv3, gnuadio packages
since the python support on these are selecting
python-numpy.

Cc: Samuel Martin <s.martin49@gmail.com>
Cc: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
Cc: Esben Haabendal <esben@geanix.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v8:
- none
Changes for v7:
- bump 1.181.2 numpy
- drop 'BR2_PACKAGE_HOST_PYTHON_CYTHON' selection from numpy
- drop python2 dependency from gnuradio.mk
- drop python2 dependency from opencv3.mk
- update the commit message

 package/gnuradio/Config.in             |  2 +-
 package/gnuradio/gnuradio.mk           |  4 ++--
 package/opencv3/Config.in              |  2 +-
 package/opencv3/opencv3.mk             | 14 --------------
 package/python-numpy/Config.in         |  1 +
 package/python-numpy/python-numpy.hash | 14 +++++++-------
 package/python-numpy/python-numpy.mk   |  4 +++-
 7 files changed, 15 insertions(+), 26 deletions(-)

diff --git a/package/gnuradio/Config.in b/package/gnuradio/Config.in
index 6d438bcd6f..bf69ed605b 100644
--- a/package/gnuradio/Config.in
+++ b/package/gnuradio/Config.in
@@ -63,7 +63,7 @@ config BR2_PACKAGE_GNURADIO_FEC
 
 config BR2_PACKAGE_GNURADIO_PYTHON
 	bool "python support"
-	depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3
+	depends on BR2_PACKAGE_PYTHON3
 	depends on BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
 	depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL # python-numpy
 	select BR2_PACKAGE_BOOST_PYTHON
diff --git a/package/gnuradio/gnuradio.mk b/package/gnuradio/gnuradio.mk
index 41d4619f72..ab5b79e3e5 100644
--- a/package/gnuradio/gnuradio.mk
+++ b/package/gnuradio/gnuradio.mk
@@ -13,7 +13,7 @@ GNURADIO_SUPPORTS_IN_SOURCE_BUILD = NO
 
 # host-python-mako and host-python-six are needed for volk to compile
 GNURADIO_DEPENDENCIES = \
-	$(if $(BR2_PACKAGE_PYTHON3),host-python3,host-python) \
+	host-python3 \
 	host-python-mako \
 	host-python-six \
 	host-swig \
@@ -108,7 +108,7 @@ GNURADIO_CONF_OPTS += -DENABLE_GR_FILTER=OFF
 endif
 
 ifeq ($(BR2_PACKAGE_GNURADIO_PYTHON),y)
-GNURADIO_DEPENDENCIES += $(if $(BR2_PACKAGE_PYTHON3),python3,python)
+GNURADIO_DEPENDENCIES += python3
 GNURADIO_CONF_OPTS += -DENABLE_PYTHON=ON
 else
 GNURADIO_CONF_OPTS += -DENABLE_PYTHON=OFF
diff --git a/package/opencv3/Config.in b/package/opencv3/Config.in
index d4b17b6acf..18c390c515 100644
--- a/package/opencv3/Config.in
+++ b/package/opencv3/Config.in
@@ -156,7 +156,7 @@ config BR2_PACKAGE_OPENCV3_LIB_PHOTO
 
 config BR2_PACKAGE_OPENCV3_LIB_PYTHON
 	bool "python"
-	depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3
+	depends on BR2_PACKAGE_PYTHON3
 	depends on BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
 	depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL # python-numpy
 	select BR2_PACKAGE_PYTHON_NUMPY
diff --git a/package/opencv3/opencv3.mk b/package/opencv3/opencv3.mk
index 8a8257b387..fe41f6f382 100644
--- a/package/opencv3/opencv3.mk
+++ b/package/opencv3/opencv3.mk
@@ -312,19 +312,6 @@ OPENCV3_CONF_OPTS += -DWITH_V4L=OFF -DWITH_LIBV4L=OFF
 endif
 
 ifeq ($(BR2_PACKAGE_OPENCV3_LIB_PYTHON),y)
-ifeq ($(BR2_PACKAGE_PYTHON),y)
-OPENCV3_CONF_OPTS += \
-	-DBUILD_opencv_python2=ON \
-	-DBUILD_opencv_python3=OFF \
-	-DPYTHON2_EXECUTABLE=$(HOST_DIR)/bin/python2 \
-	-DPYTHON2_INCLUDE_PATH=$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR) \
-	-DPYTHON2_LIBRARIES=$(STAGING_DIR)/usr/lib/libpython$(PYTHON_VERSION_MAJOR).so \
-	-DPYTHON2_NUMPY_INCLUDE_DIRS=$(STAGING_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages/numpy/core/include \
-	-DPYTHON2_PACKAGES_PATH=/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
-	-DPYTHON2_NUMPY_VERSION=$(PYTHON_NUMPY_VERSION)
-OPENCV3_DEPENDENCIES += python
-OPENCV3_KEEP_PY_FILES += usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages/cv2/config*.py
-else
 OPENCV3_CONF_OPTS += \
 	-DBUILD_opencv_python2=OFF \
 	-DBUILD_opencv_python3=ON \
@@ -336,7 +323,6 @@ OPENCV3_CONF_OPTS += \
 	-DPYTHON3_NUMPY_VERSION=$(PYTHON_NUMPY_VERSION)
 OPENCV3_DEPENDENCIES += python3
 OPENCV3_KEEP_PY_FILES += usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/cv2/config*.py
-endif
 OPENCV3_CONF_ENV += $(PKG_PYTHON_DISTUTILS_ENV)
 OPENCV3_DEPENDENCIES += python-numpy
 else
diff --git a/package/python-numpy/Config.in b/package/python-numpy/Config.in
index 5b9ee5803b..507d52c4d8 100644
--- a/package/python-numpy/Config.in
+++ b/package/python-numpy/Config.in
@@ -15,6 +15,7 @@ config BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
 
 config BR2_PACKAGE_PYTHON_NUMPY
 	bool "python-numpy"
+	depends on BR2_PACKAGE_PYTHON3
 	depends on BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
 	# python-numpy needs fenv.h which is not provided by uclibc
 	depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL
diff --git a/package/python-numpy/python-numpy.hash b/package/python-numpy/python-numpy.hash
index eb4123e3f6..ff9d02643c 100644
--- a/package/python-numpy/python-numpy.hash
+++ b/package/python-numpy/python-numpy.hash
@@ -1,9 +1,9 @@
-# Copied from https://github.com/numpy/numpy/releases/tag/v1.16.4
-sha256	a3bccb70ad94091a5b9e2469fabd41ac877c140a6828c2022e35560a2ec0346c	numpy-1.16.4.tar.gz
+# Copied from https://github.com/numpy/numpy/releases/tag/v1.18.1
+sha256  da204ce460aa4247e595b7c7189d2fb2ed5f796bc03197055de01dac61d0125e	numpy-1.18.2.tar.gz
 # License files, locally calculated
-sha256	6b5086f61fe0c71564a79304ecbaa60f11fa3f3debf82f73d16a611cab102adc	LICENSE.txt
-sha256	426a5a484480f57a295db48c2c04f47bb3274752dd82a7fd6541dfa2cb90f641	doc/sphinxext/LICENSE.txt
+sha256  ad81d0c21843ba6ce6fe5fa3eaacb61120be70cd798c52f63df3f4c12a843f0c	LICENSE.txt
+sha256  d3045980e80a6b39f98586c24bc7f39a7625b4b9f08ce72e367d12814743d047	numpy/core/src/multiarray/dragon4.c
+sha256  426a5a484480f57a295db48c2c04f47bb3274752dd82a7fd6541dfa2cb90f641	doc/sphinxext/LICENSE.txt
 sha256	154a8706fa0fdeff1073bf6239c4ecf51f562ab107066eef839dade1a45c824c	doc/scipy-sphinx-theme/LICENSE.txt
-sha256	a14cc25e10d40a3aa705b7de2fb764a6535d8ee9b2db4e1724900585457dfd55	numpy/linalg/lapack_lite/LICENSE.txt
-sha256	badf51c7e3e7de9c7630bd069780f5c197b846ef7660b342a1e58d5553592d8e	tools/npy_tempita/license.txt
-sha256	d37526b4a34c0aa859afe6f9b7e64ca7c306b7430df8113dd5ac6fcb246bd2d4	numpy/core/src/multiarray/dragon4.c
+sha256  a14cc25e10d40a3aa705b7de2fb764a6535d8ee9b2db4e1724900585457dfd55	numpy/linalg/lapack_lite/LICENSE.txt
+sha256  badf51c7e3e7de9c7630bd069780f5c197b846ef7660b342a1e58d5553592d8e	tools/npy_tempita/license.txt
diff --git a/package/python-numpy/python-numpy.mk b/package/python-numpy/python-numpy.mk
index 3b474efa6e..3f0df7a640 100644
--- a/package/python-numpy/python-numpy.mk
+++ b/package/python-numpy/python-numpy.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-PYTHON_NUMPY_VERSION = 1.16.4
+PYTHON_NUMPY_VERSION = 1.18.2
 PYTHON_NUMPY_SOURCE = numpy-$(PYTHON_NUMPY_VERSION).tar.gz
 PYTHON_NUMPY_SITE = https://github.com/numpy/numpy/releases/download/v$(PYTHON_NUMPY_VERSION)
 PYTHON_NUMPY_LICENSE = BSD-3-Clause, BSD-2-Clause, PSF, Apache-2.0, MIT, Zlib
@@ -14,6 +14,8 @@ PYTHON_NUMPY_LICENSE_FILES = LICENSE.txt doc/sphinxext/LICENSE.txt \
 			tools/npy_tempita/license.txt \
 			numpy/core/src/multiarray/dragon4.c
 PYTHON_NUMPY_SETUP_TYPE = setuptools
+PYTHON_NUMPY_DEPENDENCIES += host-python-cython
+HOST_PYTHON_NUMPY_DEPENDENCIES += host-python-cython
 
 ifeq ($(BR2_PACKAGE_CLAPACK),y)
 PYTHON_NUMPY_DEPENDENCIES += clapack
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v8 2/5] package/python-numpy: fixup npymath.ini for numpy extensions
  2020-04-07 11:15 [Buildroot] [PATCH v8 0/5] package/python-scipy: new package Jagan Teki
  2020-04-07 11:15 ` [Buildroot] [PATCH v8 1/5] package/python-numpy: Bump to version 1.18.2 Jagan Teki
@ 2020-04-07 11:15 ` Jagan Teki
  2022-01-07 22:10   ` Arnout Vandecappelle
  2020-04-07 11:15 ` [Buildroot] [PATCH v8 3/5] package/python-pybind11: new host package Jagan Teki
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Jagan Teki @ 2020-04-07 11:15 UTC (permalink / raw)
  To: buildroot

From: Esben Haabendal <esben@geanix.com>

Inorder to build the numpy distutils extension packages like
python-scipy, python-numba, it require an explicit pkg-config
path fixup for npymath.ini.

This pkg-config path fixup would update the prefix path of
npymath.ini with actual target staging area where numpy core
was built, so-that numpy distutils extension packages would
explicitly link this config path for their package environment.

Without this extension packages cannot find -lnpymath since
it uses host libraries (like libnpymath.a).

So, attach the post install staging hook with pkg-config
path fixup for npymath.ini.

Signed-off-by: Esben Haabendal <esben@geanix.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v8:
- none
Changes for v7:
- rephrase commit and comments of fixup npymath.ini

 package/python-numpy/python-numpy.mk | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/package/python-numpy/python-numpy.mk b/package/python-numpy/python-numpy.mk
index 3f0df7a640..4d2e852b43 100644
--- a/package/python-numpy/python-numpy.mk
+++ b/package/python-numpy/python-numpy.mk
@@ -32,6 +32,21 @@ define PYTHON_NUMPY_CONFIGURE_CMDS
 	echo "include_dirs = $(STAGING_DIR)/usr/include" >> $(@D)/site.cfg
 endef
 
+# Fixup the npymath.ini prefix path with actual target staging area where
+# numpy core was built. Without this, target builds using numpy distutils
+# extensions like python-scipy, python-numba cannot find -lnpymath since
+# it uses host libraries (like libnpymath.a).
+# So, the numpy distutils extension packages would explicitly link this
+# config path for their package environment.
+PYTHON_NUMPY_STAGING_DIR = $(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/numpy
+PYTHON_NUMPY_NPY_PKG_CONFIG_PATH=$(PYTHON_NUMPY_STAGING_DIR)/core/lib/npy-pkg-config
+define PYTHON_NUMPY_FIXUP_NPY_PKG_CONFIG_FILES
+	sed -e '/^pkgdir=/d' \
+	    -e '/^prefix=/i pkgdir=$(PYTHON_NUMPY_STAGING_DIR)/core' \
+	    -i $(PYTHON_NUMPY_NPY_PKG_CONFIG_PATH)/npymath.ini
+endef
+PYTHON_NUMPY_POST_INSTALL_STAGING_HOOKS += PYTHON_NUMPY_FIXUP_NPY_PKG_CONFIG_FILES
+
 # Some package may include few headers from NumPy, so let's install it
 # in the staging area.
 PYTHON_NUMPY_INSTALL_STAGING = YES
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v8 3/5] package/python-pybind11: new host package
  2020-04-07 11:15 [Buildroot] [PATCH v8 0/5] package/python-scipy: new package Jagan Teki
  2020-04-07 11:15 ` [Buildroot] [PATCH v8 1/5] package/python-numpy: Bump to version 1.18.2 Jagan Teki
  2020-04-07 11:15 ` [Buildroot] [PATCH v8 2/5] package/python-numpy: fixup npymath.ini for numpy extensions Jagan Teki
@ 2020-04-07 11:15 ` Jagan Teki
  2020-04-07 11:15 ` [Buildroot] [PATCH v8 4/5] support/testing: add python-pybind11 test Jagan Teki
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Jagan Teki @ 2020-04-07 11:15 UTC (permalink / raw)
  To: buildroot

Add python-pybind11 package with 2.4.3 release version.

Cc: Esben Haabendal <esben@geanix.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v8:
- none
Changes for v7:
- update the commit message
- fix sha256 value of pybind11 LICENCE

 DEVELOPERS                                   |  1 +
 package/Config.in.host                       |  1 +
 package/python-pybind11/Config.in.host       |  7 +++++++
 package/python-pybind11/python-pybind11.hash |  5 +++++
 package/python-pybind11/python-pybind11.mk   | 14 ++++++++++++++
 5 files changed, 28 insertions(+)
 create mode 100644 package/python-pybind11/Config.in.host
 create mode 100644 package/python-pybind11/python-pybind11.hash
 create mode 100644 package/python-pybind11/python-pybind11.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index a2c6da208b..308a59b264 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1151,6 +1151,7 @@ F:	configs/orangepi_win_defconfig
 F:	configs/orangepi_zero_plus2_defconfig
 F:	configs/pine64_defconfig
 F:	configs/pine64_sopine_defconfig
+F:	package/python-pybind11
 
 N:	James Hilliard <james.hilliard1@gmail.com>
 F:	package/gensio/
diff --git a/package/Config.in.host b/package/Config.in.host
index dfea478868..d63bf54aa7 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -57,6 +57,7 @@ menu "Host utilities"
 	source "package/python/Config.in.host"
 	source "package/python-cython/Config.in.host"
 	source "package/python-lxml/Config.in.host"
+	source "package/python-pybind11/Config.in.host"
 	source "package/python-six/Config.in.host"
 	source "package/python-xlrd/Config.in.host"
 	source "package/python3/Config.in.host"
diff --git a/package/python-pybind11/Config.in.host b/package/python-pybind11/Config.in.host
new file mode 100644
index 0000000000..e4164efd9d
--- /dev/null
+++ b/package/python-pybind11/Config.in.host
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_HOST_PYTHON_PYBIND11
+	bool "host python-pybind11"
+	help
+	  Python module for Seamless operability between
+	  C++11 and Python.
+
+	  https://github.com/pybind/pybind11
diff --git a/package/python-pybind11/python-pybind11.hash b/package/python-pybind11/python-pybind11.hash
new file mode 100644
index 0000000000..880b678b94
--- /dev/null
+++ b/package/python-pybind11/python-pybind11.hash
@@ -0,0 +1,5 @@
+# md5, sha256 from https://pypi.python.org/pypi/pybind11/json
+md5  23fdca8191b16ce3e7f38fb9e4252b2d  pybind11-2.4.3.tar.gz
+sha256  72e6def53fb491f7f4e92692029d2e7bb5a0783314f20d80222735ff10a75758  pybind11-2.4.3.tar.gz
+# sha256 for LICENSE is locally computed
+sha256  9a37ea54aa3cf12c7f3292799f20822ffd4b9b7142b36a7a9997b28c39264dc9  LICENSE
diff --git a/package/python-pybind11/python-pybind11.mk b/package/python-pybind11/python-pybind11.mk
new file mode 100644
index 0000000000..833ec92c86
--- /dev/null
+++ b/package/python-pybind11/python-pybind11.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-pybind11
+#
+################################################################################
+
+PYTHON_PYBIND11_VERSION = 2.4.3
+PYTHON_PYBIND11_SOURCE = pybind11-$(PYTHON_PYBIND11_VERSION).tar.gz
+PYTHON_PYBIND11_SITE = https://pypi.python.org/packages/aa/91/deb6743e79e22ab01502296570b39b8404f10cc507a6692d612a7fee8d51
+PYTHON_PYBIND11_SETUP_TYPE = setuptools
+PYTHON_PYBIND11_LICENSE = BSD
+PYTHON_PYBIND11_LICENSE_FILES = LICENSE
+
+$(eval $(host-python-package))
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v8 4/5] support/testing: add python-pybind11 test
  2020-04-07 11:15 [Buildroot] [PATCH v8 0/5] package/python-scipy: new package Jagan Teki
                   ` (2 preceding siblings ...)
  2020-04-07 11:15 ` [Buildroot] [PATCH v8 3/5] package/python-pybind11: new host package Jagan Teki
@ 2020-04-07 11:15 ` Jagan Teki
  2022-01-07 21:38   ` Arnout Vandecappelle
  2020-04-07 11:15 ` [Buildroot] [PATCH v8 5/5] package/python-scipy: new package Jagan Teki
  2020-04-07 11:49 ` [Buildroot] [PATCH v8 0/5] " Thomas Petazzoni
  5 siblings, 1 reply; 15+ messages in thread
From: Jagan Teki @ 2020-04-07 11:15 UTC (permalink / raw)
  To: buildroot

From: Adam Duskett <Aduskett@gmail.com>

This test is a simple integration test of the python-pybind11 package.

It consists of the following:
- The python-pybind11-addition-example package compiles a simple cpp file
  which adds two given numbers together and returns the results and installs
  the compiled file to /root/
  This example is from the following URL:
    https://pybind11.readthedocs.io/en/stable/basics.html

- The python-pybind11-addition-example package installs the
  sample_python_pybind11.py file which imports the above-compiled file and adds
  1 and 2 together to /root/

- Execute the sample_python_pybind11.py in an emulator with the expected output
  of 3 and an exit code of 0.

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
[jagan: rebase, fix trailing whitespace, new line warninings]
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v8
- new patch

 .gitlab-ci.yml                                |  2 +
 DEVELOPERS                                    |  2 +
 .../br2-external/python-pybind11/Config.in    |  1 +
 .../python-pybind11/external.desc             |  1 +
 .../br2-external/python-pybind11/external.mk  |  1 +
 .../Config.in                                 |  5 ++
 .../pybind11_addition_example.cpp             |  9 +++
 .../python-pybind11-addition-example.mk       | 39 ++++++++++
 .../sample_python_pybind11.py                 |  4 +
 .../tests/package/test_python_pybind11.py     | 76 +++++++++++++++++++
 10 files changed, 140 insertions(+)
 create mode 100644 support/testing/tests/package/br2-external/python-pybind11/Config.in
 create mode 100644 support/testing/tests/package/br2-external/python-pybind11/external.desc
 create mode 100644 support/testing/tests/package/br2-external/python-pybind11/external.mk
 create mode 100644 support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/Config.in
 create mode 100644 support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/pybind11_addition_example.cpp
 create mode 100644 support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/python-pybind11-addition-example.mk
 create mode 100644 support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/sample_python_pybind11.py
 create mode 100644 support/testing/tests/package/test_python_pybind11.py

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d9519c3812..ce524337cb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -471,6 +471,8 @@ tests.package.test_python_passlib.TestPythonPy2Passlib: { extends: .runtime_test
 tests.package.test_python_passlib.TestPythonPy3Passlib: { extends: .runtime_test }
 tests.package.test_python_pexpect.TestPythonPy2Pexpect: { extends: .runtime_test }
 tests.package.test_python_pexpect.TestPythonPy3Pexpect: { extends: .runtime_test }
+tests.package.test_python_pybind11.TestPythonPy2Pybind11: { extends: .runtime_test }
+tests.package.test_python_pybind11.TestPythonPy3Pybind11: { extends: .runtime_test }
 tests.package.test_python_pynacl.TestPythonPy2Pynacl: { extends: .runtime_test }
 tests.package.test_python_pynacl.TestPythonPy3Pynacl: { extends: .runtime_test }
 tests.package.test_python_pyyaml.TestPythonPy2Pyyaml: { extends: .runtime_test }
diff --git a/DEVELOPERS b/DEVELOPERS
index 308a59b264..f06d54a662 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -85,6 +85,8 @@ F:	package/sngrep/
 F:	package/spidermonkey/
 F:	package/systemd/
 F:	support/testing/tests/package/test_python_gobject.py
+F:	support/testing/tests/package/br2-external/python-pybind11/
+F:	support/testing/tests/package/test_python_pybind11.py
 
 N:	Adam Heinrich <adam@adamh.cz>
 F:	package/jack1/
diff --git a/support/testing/tests/package/br2-external/python-pybind11/Config.in b/support/testing/tests/package/br2-external/python-pybind11/Config.in
new file mode 100644
index 0000000000..27b502313b
--- /dev/null
+++ b/support/testing/tests/package/br2-external/python-pybind11/Config.in
@@ -0,0 +1 @@
+source "$BR2_EXTERNAL_PYTHON_PYBIND11_PATH/package/python-pybind11-addition-example/Config.in"
diff --git a/support/testing/tests/package/br2-external/python-pybind11/external.desc b/support/testing/tests/package/br2-external/python-pybind11/external.desc
new file mode 100644
index 0000000000..04a636053a
--- /dev/null
+++ b/support/testing/tests/package/br2-external/python-pybind11/external.desc
@@ -0,0 +1 @@
+name: PYTHON_PYBIND11
diff --git a/support/testing/tests/package/br2-external/python-pybind11/external.mk b/support/testing/tests/package/br2-external/python-pybind11/external.mk
new file mode 100644
index 0000000000..db34e5f54d
--- /dev/null
+++ b/support/testing/tests/package/br2-external/python-pybind11/external.mk
@@ -0,0 +1 @@
+include $(sort $(wildcard $(BR2_EXTERNAL_PYTHON_PYBIND11_PATH)/package/*/*.mk))
diff --git a/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/Config.in b/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/Config.in
new file mode 100644
index 0000000000..7860559a13
--- /dev/null
+++ b/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/Config.in
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_PYTHON_PYBIND11_ADDITION_EXAMPLE
+	bool "python-pybind11 addition example"
+	depends on BR2_PACKAGE_PYTHON_PYBIND11
+	help
+	  Simple class for testing python-pybind11
diff --git a/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/pybind11_addition_example.cpp b/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/pybind11_addition_example.cpp
new file mode 100644
index 0000000000..61b3fce051
--- /dev/null
+++ b/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/pybind11_addition_example.cpp
@@ -0,0 +1,9 @@
+#include <pybind11/pybind11.h>
+
+int add(int i, int j) {
+    return i + j;
+}
+
+PYBIND11_MODULE(pybind11_addition_example, m) {
+    m.def("add", &add, "A function which adds two numbers");
+}
diff --git a/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/python-pybind11-addition-example.mk b/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/python-pybind11-addition-example.mk
new file mode 100644
index 0000000000..f620424fca
--- /dev/null
+++ b/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/python-pybind11-addition-example.mk
@@ -0,0 +1,39 @@
+################################################################################
+#
+# python-pybind11_addition_example
+#
+################################################################################
+
+PYTHON_PYBIND11_ADDITION_EXAMPLE_DEPENDENCIES = python-pybind11
+
+ifeq ($(BR2_PACKAGE_PYTHON),y)
+PYTHON_PYBIND11_ADDITION_EXAMPLE_INCLUDES=`$(STAGING_DIR)/usr/bin/python2-config --includes`
+PYTHON_PYBIND11_ADDITION_EXAMPLE_SUFFIX=`$(STAGING_DIR)/usr/bin/python2-config --extension-suffix`
+else
+PYTHON_PYBIND11_ADDITION_EXAMPLE_INCLUDES=`$(STAGING_DIR)/usr/bin/python3-config --includes`
+PYTHON_PYBIND11_ADDITION_EXAMPLE_SUFFIX=`$(STAGING_DIR)/usr/bin/python3-config --extension-suffix`
+endif
+PYTHON_PYBIND11_ADDITION_EXAMPLE_OUTPUT=pybind11_addition_example$(PYTHON_PYBIND11_ADDITION_EXAMPLE_SUFFIX)
+
+define PYTHON_PYBIND11_ADDITION_EXAMPLE_BUILD_CMDS
+	$(INSTALL) -D $(PYTHON_PYBIND11_ADDITION_EXAMPLE_PKGDIR)/pybind11_addition_example.cpp \
+		$(@D)/pybind11_addition_example.cpp
+
+	$(INSTALL) -D $(PYTHON_PYBIND11_ADDITION_EXAMPLE_PKGDIR)/sample_python_pybind11.py \
+		$(@D)/sample_python_pybind11.py
+
+	cd $(@D); \
+		$(TARGET_CXX) -std=c++11 -fPIC -shared \
+		$(PYTHON_PYBIND11_ADDITION_EXAMPLE_INCLUDES) pybind11_addition_example.cpp \
+		-o $(PYTHON_PYBIND11_ADDITION_EXAMPLE_OUTPUT)
+endef
+
+define PYTHON_PYBIND11_ADDITION_EXAMPLE_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 755 $(@D)/$(PYTHON_PYBIND11_ADDITION_EXAMPLE_OUTPUT) \
+		$(TARGET_DIR)/root/$(PYTHON_PYBIND11_ADDITION_EXAMPLE_OUTPUT)
+
+	$(INSTALL) -D -m 755 $(@D)/sample_python_pybind11.py \
+		$(TARGET_DIR)/root/sample_python_pybind11.py
+endef
+
+$(eval $(generic-package))
diff --git a/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/sample_python_pybind11.py b/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/sample_python_pybind11.py
new file mode 100644
index 0000000000..29196481e1
--- /dev/null
+++ b/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/sample_python_pybind11.py
@@ -0,0 +1,4 @@
+#!/usr/bin/env python
+import pybind11_addition_example
+
+print(pybind11_addition_example.add(1, 2))
diff --git a/support/testing/tests/package/test_python_pybind11.py b/support/testing/tests/package/test_python_pybind11.py
new file mode 100644
index 0000000000..12bd77807e
--- /dev/null
+++ b/support/testing/tests/package/test_python_pybind11.py
@@ -0,0 +1,76 @@
+import os
+import infra.basetest
+
+class TestPythonPy2Pybind11(infra.basetest.BRTest):
+    br2_external = [infra.filepath("tests/package/br2-external/python-pybind11")]
+    config = \
+        """
+        BR2_aarch64=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
+        BR2_LINUX_KERNEL=y
+        BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+        BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.19.86"
+        BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+        BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/aarch64-virt/linux.config"
+        BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        BR2_TARGET_ROOTFS_CPIO_GZIP=y
+        BR2_PACKAGE_PYTHON=y
+        BR2_PACKAGE_PYTHON_PYBIND11=y
+        BR2_PACKAGE_PYTHON_PYBIND11_ADDITION_EXAMPLE=y
+        """
+
+    def login(self):
+        img = os.path.join(self.builddir, "images", "rootfs.cpio.gz")
+        kern = os.path.join(self.builddir, "images", "Image")
+        self.emulator.boot(arch="aarch64",
+                           kernel=kern,
+                           kernel_cmdline=["console=ttyAMA0"],
+                           options=["-M", "virt", "-cpu", "cortex-a57", "-m", "512M", "-initrd", img])
+        self.emulator.login()
+
+    def test_run(self):
+        self.login()
+        cmd = "python sample_python_pybind11.py"
+        output, exit_code = self.emulator.run(cmd, 120)
+        print(output)
+        self.assertEqual(exit_code, 0)
+        self.assertEqual(output, ["3"])
+
+class TestPythonPy3Pybind11(infra.basetest.BRTest):
+    br2_external = [infra.filepath("tests/package/br2-external/python-pybind11")]
+    config = \
+        """
+        BR2_aarch64=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
+        BR2_LINUX_KERNEL=y
+        BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+        BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.19.86"
+        BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+        BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/aarch64-virt/linux.config"
+        BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        BR2_TARGET_ROOTFS_CPIO_GZIP=y
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_PYBIND11=y
+        BR2_PACKAGE_PYTHON_PYBIND11_ADDITION_EXAMPLE=y
+        """
+
+    def login(self):
+        img = os.path.join(self.builddir, "images", "rootfs.cpio.gz")
+        kern = os.path.join(self.builddir, "images", "Image")
+        self.emulator.boot(arch="aarch64",
+                           kernel=kern,
+                           kernel_cmdline=["console=ttyAMA0"],
+                           options=["-M", "virt", "-cpu", "cortex-a57", "-m", "512M", "-initrd", img])
+        self.emulator.login()
+
+    def test_run(self):
+        self.login()
+        cmd = "python3 sample_python_pybind11.py"
+        output, exit_code = self.emulator.run(cmd, 120)
+        print(output)
+        self.assertEqual(exit_code, 0)
+        self.assertEqual(output, ["3"])
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v8 5/5] package/python-scipy: new package
  2020-04-07 11:15 [Buildroot] [PATCH v8 0/5] package/python-scipy: new package Jagan Teki
                   ` (3 preceding siblings ...)
  2020-04-07 11:15 ` [Buildroot] [PATCH v8 4/5] support/testing: add python-pybind11 test Jagan Teki
@ 2020-04-07 11:15 ` Jagan Teki
  2022-01-07 23:12   ` Arnout Vandecappelle
  2020-04-07 11:49 ` [Buildroot] [PATCH v8 0/5] " Thomas Petazzoni
  5 siblings, 1 reply; 15+ messages in thread
From: Jagan Teki @ 2020-04-07 11:15 UTC (permalink / raw)
  To: buildroot

Add python-scipy with 1.4.1 release version.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v8:
- none
Changes for v7:
- update the commit message
- fix sha256 value of pybind11 LICENCE

 DEVELOPERS                             |  1 +
 package/Config.in                      |  1 +
 package/python-scipy/Config.in         | 22 ++++++++++++
 package/python-scipy/python-scipy.hash |  9 +++++
 package/python-scipy/python-scipy.mk   | 46 ++++++++++++++++++++++++++
 5 files changed, 79 insertions(+)
 create mode 100644 package/python-scipy/Config.in
 create mode 100644 package/python-scipy/python-scipy.hash
 create mode 100644 package/python-scipy/python-scipy.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index f06d54a662..3203b0bc47 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1154,6 +1154,7 @@ F:	configs/orangepi_zero_plus2_defconfig
 F:	configs/pine64_defconfig
 F:	configs/pine64_sopine_defconfig
 F:	package/python-pybind11
+F:	package/python-scipy
 
 N:	James Hilliard <james.hilliard1@gmail.com>
 F:	package/gensio/
diff --git a/package/Config.in b/package/Config.in
index afe32f52b4..f5af9b07ea 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1120,6 +1120,7 @@ menu "External python modules"
 	source "package/python-scandir/Config.in"
 	source "package/python-scapy/Config.in"
 	source "package/python-schedule/Config.in"
+	source "package/python-scipy/Config.in"
 	source "package/python-sdnotify/Config.in"
 	source "package/python-secretstorage/Config.in"
 	source "package/python-see/Config.in"
diff --git a/package/python-scipy/Config.in b/package/python-scipy/Config.in
new file mode 100644
index 0000000000..4d8227c31a
--- /dev/null
+++ b/package/python-scipy/Config.in
@@ -0,0 +1,22 @@
+config BR2_PACKAGE_PYTHON_SCIPY
+	bool "python-scipy"
+	depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL # python-numpy
+	depends on BR2_TOOLCHAIN_HAS_FORTRAN
+	depends on BR2_TOOLCHAIN_BUILDROOT_CXX
+	depends on BR2_PACKAGE_PYTHON3
+	select BR2_PACKAGE_PYTHON_NUMPY
+	select BR2_PACKAGE_LAPACK
+	select BR2_PACKAGE_OPENBLAS
+	help
+	  The SciPy library is one of the core packages that make up the SciPy
+	  stack. It provides many user-friendly and efficient numerical
+	  routines such as routines for numerical integration, interpolation,
+	  optimization, linear algebra and statistics.
+
+	  https://www.scipy.org/scipylib/
+
+comment "python-scipy needs toolchain w/ fortran and c++ and glibc or musl"
+	depends on BR2_PACKAGE_PYTHON3
+	depends on !BR2_TOOLCHAIN_HAS_FORTRAN || \
+		!BR2_TOOLCHAIN_BUILDROOT_CXX || \
+		(!BR2_TOOLCHAIN_USES_GLIBC && !BR2_TOOLCHAIN_USES_MUSL)
diff --git a/package/python-scipy/python-scipy.hash b/package/python-scipy/python-scipy.hash
new file mode 100644
index 0000000000..c9d295ef6b
--- /dev/null
+++ b/package/python-scipy/python-scipy.hash
@@ -0,0 +1,9 @@
+# Locally generated
+sha256 dee1bbf3a6c8f73b6b218cb28eed8dd13347ea2f87d572ce19b289d6fd3fbc59  scipy-1.4.1.tar.gz
+sha256 5cbdbe33385779958be8b9310497e32d2eec144d82ef425780d3e19f8af6de76  LICENSE.txt
+sha256 37e64a498894ac7c3b070023e3689e954a8ecf8a23b90968d09a455f1b4f7b35  scipy/linalg/src/lapack_deprecations/LICENSE
+sha256 606209a000716c5f66e33e180ce08434b96ed17db4975ab9723c6b5fbcc89609  scipy/ndimage/LICENSE.txt
+sha256 3df9207af2fdb861af0ae3b22026f163b9bcfab4e525dc4943afe2ffa3f77624  scipy/optimize/tnc/LICENSE
+sha256 f0cedf52503b2d42b83411a0a16e6fefac346dfad8fddc66f50050150123470c  scipy/sparse/linalg/dsolve/SuperLU/License.txt
+sha256 0926566f9f406178d1214f8cc796e166b1213dd7c05e0c5b461a8b8ac9e50bbe  scipy/sparse/linalg/eigen/arpack/ARPACK/COPYING
+sha256 34db0c0c4f931861d720555c9cd7a2e228d1290ba29af0f2ee80c41bb2038afb  scipy/spatial/qhull_src/COPYING.txt
diff --git a/package/python-scipy/python-scipy.mk b/package/python-scipy/python-scipy.mk
new file mode 100644
index 0000000000..1d66b146ec
--- /dev/null
+++ b/package/python-scipy/python-scipy.mk
@@ -0,0 +1,46 @@
+################################################################################
+#
+# python-scipy
+#
+################################################################################
+
+PYTHON_SCIPY_VERSION = 1.4.1
+PYTHON_SCIPY_SOURCE = scipy-$(PYTHON_SCIPY_VERSION).tar.gz
+PYTHON_SCIPY_SITE = https://pypi.python.org/packages/04/ab/e2eb3e3f90b9363040a3d885ccc5c79fe20c5b8a3caa8fe3bf47ff653260
+PYTHON_SCIPY_LICENSE = BSD-3-Clause, BSD-2-Clause, BSD, BSD-Style, \
+	Apache-2.0, MIT
+PYTHON_SCIPY_LICENSE_FILES = \
+	LICENSE.txt \
+	scipy/linalg/src/lapack_deprecations/LICENSE \
+	scipy/ndimage/LICENSE.txt \
+	scipy/optimize/tnc/LICENSE \
+	scipy/sparse/linalg/dsolve/SuperLU/License.txt \
+	scipy/sparse/linalg/eigen/arpack/ARPACK/COPYING \
+	scipy/spatial/qhull_src/COPYING.txt
+PYTHON_SCIPY_SETUP_TYPE = setuptools
+PYTHON_SCIPY_DEPENDENCIES += \
+	host-python-numpy \
+	host-python-pybind11 \
+	lapack \
+	openblas \
+	python-numpy
+
+PYTHON_SCIPY_BUILD_OPTS = config_fc --fcompiler=gnu95
+PYTHON_SCIPY_ENV += F90=$(TARGET_CROSS)gfortran F77=$(TARGET_CROSS)gfortran
+
+# Provide system configuration options to numpy distutils extenions, telling
+# to find all include files and libraries in staging directory.
+define PYTHON_SCIPY_CONFIGURE_CMDS
+	-rm -f $(@D)/site.cfg
+	echo "[DEFAULT]" >> $(@D)/site.cfg
+	echo "library_dirs = $(STAGING_DIR)/usr/lib" >> $(@D)/site.cfg
+	echo "include_dirs = $(STAGING_DIR)/usr/include" >> $(@D)/site.cfg
+endef
+
+# Use the target numpy pkg-config configuration files modified for target
+# cross-compilation.  Without this, numpy distutils will cause the linker to
+# link with host libnpymath.a.
+PYTHON_SCIPY_ENV += NPY_PKG_CONFIG_PATH=$(PYTHON_NUMPY_NPY_PKG_CONFIG_PATH)
+PYTHON_SCIPY_INSTALL_STAGING = YES
+
+$(eval $(python-package))
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v8 0/5] package/python-scipy: new package
  2020-04-07 11:15 [Buildroot] [PATCH v8 0/5] package/python-scipy: new package Jagan Teki
                   ` (4 preceding siblings ...)
  2020-04-07 11:15 ` [Buildroot] [PATCH v8 5/5] package/python-scipy: new package Jagan Teki
@ 2020-04-07 11:49 ` Thomas Petazzoni
  2020-04-07 13:43   ` Jagan Teki
  5 siblings, 1 reply; 15+ messages in thread
From: Thomas Petazzoni @ 2020-04-07 11:49 UTC (permalink / raw)
  To: buildroot

Hello Jagan,

On Tue,  7 Apr 2020 16:45:10 +0530
Jagan Teki <jagan@amarulasolutions.com> wrote:

> This is v8 changes for python-scipy, here is the previous 
> version series[1].

Thanks for this new iteration. Could you have a look at the backlog of
patches at http://patchwork.ozlabs.org/project/buildroot/list/ and
update any patch that is no longer relevant due to this new iteration
to the state "Superseded" ? You can do that yourself for the patches
that you have sent (provided that you have a patchwork account matching
the e-mail used to send the patches). For the other patches, you can
simply let us know, and we'll update the patch status.

This helps us keep a patchwork backlog that makes sense.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v8 0/5] package/python-scipy: new package
  2020-04-07 11:49 ` [Buildroot] [PATCH v8 0/5] " Thomas Petazzoni
@ 2020-04-07 13:43   ` Jagan Teki
  2020-04-07 15:01     ` Yann E. MORIN
  0 siblings, 1 reply; 15+ messages in thread
From: Jagan Teki @ 2020-04-07 13:43 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Tue, Apr 7, 2020 at 5:19 PM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello Jagan,
>
> On Tue,  7 Apr 2020 16:45:10 +0530
> Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> > This is v8 changes for python-scipy, here is the previous
> > version series[1].
>
> Thanks for this new iteration. Could you have a look at the backlog of
> patches at http://patchwork.ozlabs.org/project/buildroot/list/ and
> update any patch that is no longer relevant due to this new iteration
> to the state "Superseded" ? You can do that yourself for the patches
> that you have sent (provided that you have a patchwork account matching
> the e-mail used to send the patches). For the other patches, you can
> simply let us know, and we'll update the patch status.
>
> This helps us keep a patchwork backlog that makes sense.

Yes, I've updated all my previous version changes. regarding pybind11,
adam has this series [2]. I already incorporated test patch in my
series as per his request.

[2] http://patchwork.ozlabs.org/project/buildroot/list/?series=145831

Jagan.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v8 0/5] package/python-scipy: new package
  2020-04-07 13:43   ` Jagan Teki
@ 2020-04-07 15:01     ` Yann E. MORIN
  2020-04-07 16:18       ` Jagan Teki
  0 siblings, 1 reply; 15+ messages in thread
From: Yann E. MORIN @ 2020-04-07 15:01 UTC (permalink / raw)
  To: buildroot

Jagan, All,

On 2020-04-07 19:13 +0530, Jagan Teki spake thusly:
> On Tue, Apr 7, 2020 at 5:19 PM Thomas Petazzoni
> <thomas.petazzoni@bootlin.com> wrote:
> > On Tue,  7 Apr 2020 16:45:10 +0530
> > Jagan Teki <jagan@amarulasolutions.com> wrote:
> > > This is v8 changes for python-scipy, here is the previous
> > > version series[1].
> > Thanks for this new iteration. Could you have a look at the backlog of
> > patches at http://patchwork.ozlabs.org/project/buildroot/list/ and
> > update any patch that is no longer relevant due to this new iteration
> > to the state "Superseded" ? You can do that yourself for the patches
> > that you have sent (provided that you have a patchwork account matching
> > the e-mail used to send the patches). For the other patches, you can
> > simply let us know, and we'll update the patch status.
> >
> > This helps us keep a patchwork backlog that makes sense.
> 
> Yes, I've updated all my previous version changes. regarding pybind11,
> adam has this series [2]. I already incorporated test patch in my
> series as per his request.
> [2] http://patchwork.ozlabs.org/project/buildroot/list/?series=145831

So I've marked the seriers from Adam as superseded.

However, there was a review of his pybind11 patch: since it installs
only a header, it should be _INSTALL_TARGET = NO

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v8 0/5] package/python-scipy: new package
  2020-04-07 15:01     ` Yann E. MORIN
@ 2020-04-07 16:18       ` Jagan Teki
  2020-07-03  8:09         ` Jagan Teki
  0 siblings, 1 reply; 15+ messages in thread
From: Jagan Teki @ 2020-04-07 16:18 UTC (permalink / raw)
  To: buildroot

Hi Yann,

On Tue, Apr 7, 2020 at 8:31 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> Jagan, All,
>
> On 2020-04-07 19:13 +0530, Jagan Teki spake thusly:
> > On Tue, Apr 7, 2020 at 5:19 PM Thomas Petazzoni
> > <thomas.petazzoni@bootlin.com> wrote:
> > > On Tue,  7 Apr 2020 16:45:10 +0530
> > > Jagan Teki <jagan@amarulasolutions.com> wrote:
> > > > This is v8 changes for python-scipy, here is the previous
> > > > version series[1].
> > > Thanks for this new iteration. Could you have a look at the backlog of
> > > patches at http://patchwork.ozlabs.org/project/buildroot/list/ and
> > > update any patch that is no longer relevant due to this new iteration
> > > to the state "Superseded" ? You can do that yourself for the patches
> > > that you have sent (provided that you have a patchwork account matching
> > > the e-mail used to send the patches). For the other patches, you can
> > > simply let us know, and we'll update the patch status.
> > >
> > > This helps us keep a patchwork backlog that makes sense.
> >
> > Yes, I've updated all my previous version changes. regarding pybind11,
> > adam has this series [2]. I already incorporated test patch in my
> > series as per his request.
> > [2] http://patchwork.ozlabs.org/project/buildroot/list/?series=145831
>
> So I've marked the seriers from Adam as superseded.
>
> However, there was a review of his pybind11 patch: since it installs
> only a header, it should be _INSTALL_TARGET = NO

The main difference between Adam vs my patch is I'm trying to build
pybind11 as a host package as it has dependency with scipy. If Adam is
required to use even for target, maybe he can add a patch on top of
this to support the target package. Let me know if it makes sense or
any other thoughts?

Jagan.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v8 1/5] package/python-numpy: Bump to version 1.18.2
  2020-04-07 11:15 ` [Buildroot] [PATCH v8 1/5] package/python-numpy: Bump to version 1.18.2 Jagan Teki
@ 2020-05-01 12:37   ` Thomas Petazzoni
  0 siblings, 0 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2020-05-01 12:37 UTC (permalink / raw)
  To: buildroot

Hello,

I've applied, after doing some fixes. See below.

On Tue,  7 Apr 2020 16:45:11 +0530
Jagan Teki <jagan@amarulasolutions.com> wrote:

> Bump the python-numpy version to 1.18.2, this version
> of python-numpy will support python3 only, not python2.

Why "will" ? It does only support Python 3, today.

Also, you forgot to explain why host-python-cython was needed.

I've reworded the commit log to fix those details.

> diff --git a/package/gnuradio/gnuradio.mk b/package/gnuradio/gnuradio.mk
> index 41d4619f72..ab5b79e3e5 100644
> --- a/package/gnuradio/gnuradio.mk
> +++ b/package/gnuradio/gnuradio.mk
> @@ -13,7 +13,7 @@ GNURADIO_SUPPORTS_IN_SOURCE_BUILD = NO
>  
>  # host-python-mako and host-python-six are needed for volk to compile
>  GNURADIO_DEPENDENCIES = \
> -	$(if $(BR2_PACKAGE_PYTHON3),host-python3,host-python) \
> +	host-python3 \

This wasn't good. Indeed, gnuradio, when its python support is not
enabled, can still build with host-python.

It would in fact not even use host-python3 here if BR2_PACKAGE_PYTHON=y.

So I simply dropped this line.


> diff --git a/package/python-numpy/Config.in b/package/python-numpy/Config.in
> index 5b9ee5803b..507d52c4d8 100644
> --- a/package/python-numpy/Config.in
> +++ b/package/python-numpy/Config.in
> @@ -15,6 +15,7 @@ config BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
>  
>  config BR2_PACKAGE_PYTHON_NUMPY
>  	bool "python-numpy"
> +	depends on BR2_PACKAGE_PYTHON3

You forgot to propagate this dependency to the Config.in comment in the
same file, so I fixed that.

> +PYTHON_NUMPY_DEPENDENCIES += host-python-cython
> +HOST_PYTHON_NUMPY_DEPENDENCIES += host-python-cython

= signs were enough here.

Applied with those various issues fixed. Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Buildroot] [PATCH v8 0/5] package/python-scipy: new package
  2020-04-07 16:18       ` Jagan Teki
@ 2020-07-03  8:09         ` Jagan Teki
  0 siblings, 0 replies; 15+ messages in thread
From: Jagan Teki @ 2020-07-03  8:09 UTC (permalink / raw)
  To: buildroot

Hi Yann,

On Tue, Apr 7, 2020 at 9:48 PM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> Hi Yann,
>
> On Tue, Apr 7, 2020 at 8:31 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> >
> > Jagan, All,
> >
> > On 2020-04-07 19:13 +0530, Jagan Teki spake thusly:
> > > On Tue, Apr 7, 2020 at 5:19 PM Thomas Petazzoni
> > > <thomas.petazzoni@bootlin.com> wrote:
> > > > On Tue,  7 Apr 2020 16:45:10 +0530
> > > > Jagan Teki <jagan@amarulasolutions.com> wrote:
> > > > > This is v8 changes for python-scipy, here is the previous
> > > > > version series[1].
> > > > Thanks for this new iteration. Could you have a look at the backlog of
> > > > patches at http://patchwork.ozlabs.org/project/buildroot/list/ and
> > > > update any patch that is no longer relevant due to this new iteration
> > > > to the state "Superseded" ? You can do that yourself for the patches
> > > > that you have sent (provided that you have a patchwork account matching
> > > > the e-mail used to send the patches). For the other patches, you can
> > > > simply let us know, and we'll update the patch status.
> > > >
> > > > This helps us keep a patchwork backlog that makes sense.
> > >
> > > Yes, I've updated all my previous version changes. regarding pybind11,
> > > adam has this series [2]. I already incorporated test patch in my
> > > series as per his request.
> > > [2] http://patchwork.ozlabs.org/project/buildroot/list/?series=145831
> >
> > So I've marked the seriers from Adam as superseded.
> >
> > However, there was a review of his pybind11 patch: since it installs
> > only a header, it should be _INSTALL_TARGET = NO
>
> The main difference between Adam vs my patch is I'm trying to build
> pybind11 as a host package as it has dependency with scipy. If Adam is
> required to use even for target, maybe he can add a patch on top of
> this to support the target package. Let me know if it makes sense or
> any other thoughts?

Any update on this?

Jagan.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Buildroot] [PATCH v8 4/5] support/testing: add python-pybind11 test
  2020-04-07 11:15 ` [Buildroot] [PATCH v8 4/5] support/testing: add python-pybind11 test Jagan Teki
@ 2022-01-07 21:38   ` Arnout Vandecappelle
  0 siblings, 0 replies; 15+ messages in thread
From: Arnout Vandecappelle @ 2022-01-07 21:38 UTC (permalink / raw)
  To: Jagan Teki, buildroot, Guillaume William Bres
  Cc: Esben Haabendal, Suniel Mahesh, linux-amarula, Yann E . MORIN,
	Adam Duskett, Angelo Compagnucci



On 07/04/2020 13:15, Jagan Teki wrote:
> From: Adam Duskett <Aduskett@gmail.com>
> 
> This test is a simple integration test of the python-pybind11 package.
> 
> It consists of the following:
> - The python-pybind11-addition-example package compiles a simple cpp file
>    which adds two given numbers together and returns the results and installs
>    the compiled file to /root/
>    This example is from the following URL:
>      https://pybind11.readthedocs.io/en/stable/basics.html
> 
> - The python-pybind11-addition-example package installs the
>    sample_python_pybind11.py file which imports the above-compiled file and adds
>    1 and 2 together to /root/
> 
> - Execute the sample_python_pybind11.py in an emulator with the expected output
>    of 3 and an exit code of 0.
> 
> Signed-off-by: Adam Duskett <Aduskett@gmail.com>
> [jagan: rebase, fix trailing whitespace, new line warninings]
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

  I applied a heavily modified version of this to master.

  Unfortunately, Guillaume had posted a new version of this patch but had taken 
authorship of it, and I hadn't noticed that Adam was in fact the author. So it 
has gone in with just Guillaume as author and without credit to Adam or Jagan. 
Sorry for that.


  Regards,
  Arnout

> ---
> Changes for v8
> - new patch
> 
>   .gitlab-ci.yml                                |  2 +
>   DEVELOPERS                                    |  2 +
>   .../br2-external/python-pybind11/Config.in    |  1 +
>   .../python-pybind11/external.desc             |  1 +
>   .../br2-external/python-pybind11/external.mk  |  1 +
>   .../Config.in                                 |  5 ++
>   .../pybind11_addition_example.cpp             |  9 +++
>   .../python-pybind11-addition-example.mk       | 39 ++++++++++
>   .../sample_python_pybind11.py                 |  4 +
>   .../tests/package/test_python_pybind11.py     | 76 +++++++++++++++++++
>   10 files changed, 140 insertions(+)
>   create mode 100644 support/testing/tests/package/br2-external/python-pybind11/Config.in
>   create mode 100644 support/testing/tests/package/br2-external/python-pybind11/external.desc
>   create mode 100644 support/testing/tests/package/br2-external/python-pybind11/external.mk
>   create mode 100644 support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/Config.in
>   create mode 100644 support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/pybind11_addition_example.cpp
>   create mode 100644 support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/python-pybind11-addition-example.mk
>   create mode 100644 support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/sample_python_pybind11.py
>   create mode 100644 support/testing/tests/package/test_python_pybind11.py
> 
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index d9519c3812..ce524337cb 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -471,6 +471,8 @@ tests.package.test_python_passlib.TestPythonPy2Passlib: { extends: .runtime_test
>   tests.package.test_python_passlib.TestPythonPy3Passlib: { extends: .runtime_test }
>   tests.package.test_python_pexpect.TestPythonPy2Pexpect: { extends: .runtime_test }
>   tests.package.test_python_pexpect.TestPythonPy3Pexpect: { extends: .runtime_test }
> +tests.package.test_python_pybind11.TestPythonPy2Pybind11: { extends: .runtime_test }
> +tests.package.test_python_pybind11.TestPythonPy3Pybind11: { extends: .runtime_test }
>   tests.package.test_python_pynacl.TestPythonPy2Pynacl: { extends: .runtime_test }
>   tests.package.test_python_pynacl.TestPythonPy3Pynacl: { extends: .runtime_test }
>   tests.package.test_python_pyyaml.TestPythonPy2Pyyaml: { extends: .runtime_test }
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 308a59b264..f06d54a662 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -85,6 +85,8 @@ F:	package/sngrep/
>   F:	package/spidermonkey/
>   F:	package/systemd/
>   F:	support/testing/tests/package/test_python_gobject.py
> +F:	support/testing/tests/package/br2-external/python-pybind11/
> +F:	support/testing/tests/package/test_python_pybind11.py
>   
>   N:	Adam Heinrich <adam@adamh.cz>
>   F:	package/jack1/
> diff --git a/support/testing/tests/package/br2-external/python-pybind11/Config.in b/support/testing/tests/package/br2-external/python-pybind11/Config.in
> new file mode 100644
> index 0000000000..27b502313b
> --- /dev/null
> +++ b/support/testing/tests/package/br2-external/python-pybind11/Config.in
> @@ -0,0 +1 @@
> +source "$BR2_EXTERNAL_PYTHON_PYBIND11_PATH/package/python-pybind11-addition-example/Config.in"
> diff --git a/support/testing/tests/package/br2-external/python-pybind11/external.desc b/support/testing/tests/package/br2-external/python-pybind11/external.desc
> new file mode 100644
> index 0000000000..04a636053a
> --- /dev/null
> +++ b/support/testing/tests/package/br2-external/python-pybind11/external.desc
> @@ -0,0 +1 @@
> +name: PYTHON_PYBIND11
> diff --git a/support/testing/tests/package/br2-external/python-pybind11/external.mk b/support/testing/tests/package/br2-external/python-pybind11/external.mk
> new file mode 100644
> index 0000000000..db34e5f54d
> --- /dev/null
> +++ b/support/testing/tests/package/br2-external/python-pybind11/external.mk
> @@ -0,0 +1 @@
> +include $(sort $(wildcard $(BR2_EXTERNAL_PYTHON_PYBIND11_PATH)/package/*/*.mk))
> diff --git a/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/Config.in b/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/Config.in
> new file mode 100644
> index 0000000000..7860559a13
> --- /dev/null
> +++ b/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/Config.in
> @@ -0,0 +1,5 @@
> +config BR2_PACKAGE_PYTHON_PYBIND11_ADDITION_EXAMPLE
> +	bool "python-pybind11 addition example"
> +	depends on BR2_PACKAGE_PYTHON_PYBIND11
> +	help
> +	  Simple class for testing python-pybind11
> diff --git a/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/pybind11_addition_example.cpp b/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/pybind11_addition_example.cpp
> new file mode 100644
> index 0000000000..61b3fce051
> --- /dev/null
> +++ b/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/pybind11_addition_example.cpp
> @@ -0,0 +1,9 @@
> +#include <pybind11/pybind11.h>
> +
> +int add(int i, int j) {
> +    return i + j;
> +}
> +
> +PYBIND11_MODULE(pybind11_addition_example, m) {
> +    m.def("add", &add, "A function which adds two numbers");
> +}
> diff --git a/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/python-pybind11-addition-example.mk b/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/python-pybind11-addition-example.mk
> new file mode 100644
> index 0000000000..f620424fca
> --- /dev/null
> +++ b/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/python-pybind11-addition-example.mk
> @@ -0,0 +1,39 @@
> +################################################################################
> +#
> +# python-pybind11_addition_example
> +#
> +################################################################################
> +
> +PYTHON_PYBIND11_ADDITION_EXAMPLE_DEPENDENCIES = python-pybind11
> +
> +ifeq ($(BR2_PACKAGE_PYTHON),y)
> +PYTHON_PYBIND11_ADDITION_EXAMPLE_INCLUDES=`$(STAGING_DIR)/usr/bin/python2-config --includes`
> +PYTHON_PYBIND11_ADDITION_EXAMPLE_SUFFIX=`$(STAGING_DIR)/usr/bin/python2-config --extension-suffix`
> +else
> +PYTHON_PYBIND11_ADDITION_EXAMPLE_INCLUDES=`$(STAGING_DIR)/usr/bin/python3-config --includes`
> +PYTHON_PYBIND11_ADDITION_EXAMPLE_SUFFIX=`$(STAGING_DIR)/usr/bin/python3-config --extension-suffix`
> +endif
> +PYTHON_PYBIND11_ADDITION_EXAMPLE_OUTPUT=pybind11_addition_example$(PYTHON_PYBIND11_ADDITION_EXAMPLE_SUFFIX)
> +
> +define PYTHON_PYBIND11_ADDITION_EXAMPLE_BUILD_CMDS
> +	$(INSTALL) -D $(PYTHON_PYBIND11_ADDITION_EXAMPLE_PKGDIR)/pybind11_addition_example.cpp \
> +		$(@D)/pybind11_addition_example.cpp
> +
> +	$(INSTALL) -D $(PYTHON_PYBIND11_ADDITION_EXAMPLE_PKGDIR)/sample_python_pybind11.py \
> +		$(@D)/sample_python_pybind11.py
> +
> +	cd $(@D); \
> +		$(TARGET_CXX) -std=c++11 -fPIC -shared \
> +		$(PYTHON_PYBIND11_ADDITION_EXAMPLE_INCLUDES) pybind11_addition_example.cpp \
> +		-o $(PYTHON_PYBIND11_ADDITION_EXAMPLE_OUTPUT)
> +endef
> +
> +define PYTHON_PYBIND11_ADDITION_EXAMPLE_INSTALL_TARGET_CMDS
> +	$(INSTALL) -D -m 755 $(@D)/$(PYTHON_PYBIND11_ADDITION_EXAMPLE_OUTPUT) \
> +		$(TARGET_DIR)/root/$(PYTHON_PYBIND11_ADDITION_EXAMPLE_OUTPUT)
> +
> +	$(INSTALL) -D -m 755 $(@D)/sample_python_pybind11.py \
> +		$(TARGET_DIR)/root/sample_python_pybind11.py
> +endef
> +
> +$(eval $(generic-package))
> diff --git a/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/sample_python_pybind11.py b/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/sample_python_pybind11.py
> new file mode 100644
> index 0000000000..29196481e1
> --- /dev/null
> +++ b/support/testing/tests/package/br2-external/python-pybind11/package/python-pybind11-addition-example/sample_python_pybind11.py
> @@ -0,0 +1,4 @@
> +#!/usr/bin/env python
> +import pybind11_addition_example
> +
> +print(pybind11_addition_example.add(1, 2))
> diff --git a/support/testing/tests/package/test_python_pybind11.py b/support/testing/tests/package/test_python_pybind11.py
> new file mode 100644
> index 0000000000..12bd77807e
> --- /dev/null
> +++ b/support/testing/tests/package/test_python_pybind11.py
> @@ -0,0 +1,76 @@
> +import os
> +import infra.basetest
> +
> +class TestPythonPy2Pybind11(infra.basetest.BRTest):
> +    br2_external = [infra.filepath("tests/package/br2-external/python-pybind11")]
> +    config = \
> +        """
> +        BR2_aarch64=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
> +        BR2_LINUX_KERNEL=y
> +        BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> +        BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.19.86"
> +        BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
> +        BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/aarch64-virt/linux.config"
> +        BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
> +        BR2_TARGET_ROOTFS_CPIO=y
> +        BR2_TARGET_ROOTFS_CPIO_GZIP=y
> +        BR2_PACKAGE_PYTHON=y
> +        BR2_PACKAGE_PYTHON_PYBIND11=y
> +        BR2_PACKAGE_PYTHON_PYBIND11_ADDITION_EXAMPLE=y
> +        """
> +
> +    def login(self):
> +        img = os.path.join(self.builddir, "images", "rootfs.cpio.gz")
> +        kern = os.path.join(self.builddir, "images", "Image")
> +        self.emulator.boot(arch="aarch64",
> +                           kernel=kern,
> +                           kernel_cmdline=["console=ttyAMA0"],
> +                           options=["-M", "virt", "-cpu", "cortex-a57", "-m", "512M", "-initrd", img])
> +        self.emulator.login()
> +
> +    def test_run(self):
> +        self.login()
> +        cmd = "python sample_python_pybind11.py"
> +        output, exit_code = self.emulator.run(cmd, 120)
> +        print(output)
> +        self.assertEqual(exit_code, 0)
> +        self.assertEqual(output, ["3"])
> +
> +class TestPythonPy3Pybind11(infra.basetest.BRTest):
> +    br2_external = [infra.filepath("tests/package/br2-external/python-pybind11")]
> +    config = \
> +        """
> +        BR2_aarch64=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
> +        BR2_LINUX_KERNEL=y
> +        BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> +        BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.19.86"
> +        BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
> +        BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/aarch64-virt/linux.config"
> +        BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
> +        BR2_TARGET_ROOTFS_CPIO=y
> +        BR2_TARGET_ROOTFS_CPIO_GZIP=y
> +        BR2_PACKAGE_PYTHON3=y
> +        BR2_PACKAGE_PYTHON_PYBIND11=y
> +        BR2_PACKAGE_PYTHON_PYBIND11_ADDITION_EXAMPLE=y
> +        """
> +
> +    def login(self):
> +        img = os.path.join(self.builddir, "images", "rootfs.cpio.gz")
> +        kern = os.path.join(self.builddir, "images", "Image")
> +        self.emulator.boot(arch="aarch64",
> +                           kernel=kern,
> +                           kernel_cmdline=["console=ttyAMA0"],
> +                           options=["-M", "virt", "-cpu", "cortex-a57", "-m", "512M", "-initrd", img])
> +        self.emulator.login()
> +
> +    def test_run(self):
> +        self.login()
> +        cmd = "python3 sample_python_pybind11.py"
> +        output, exit_code = self.emulator.run(cmd, 120)
> +        print(output)
> +        self.assertEqual(exit_code, 0)
> +        self.assertEqual(output, ["3"])
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Buildroot] [PATCH v8 2/5] package/python-numpy: fixup npymath.ini for numpy extensions
  2020-04-07 11:15 ` [Buildroot] [PATCH v8 2/5] package/python-numpy: fixup npymath.ini for numpy extensions Jagan Teki
@ 2022-01-07 22:10   ` Arnout Vandecappelle
  0 siblings, 0 replies; 15+ messages in thread
From: Arnout Vandecappelle @ 2022-01-07 22:10 UTC (permalink / raw)
  To: Jagan Teki, buildroot
  Cc: Esben Haabendal, Guillaume William Bres, Suniel Mahesh,
	linux-amarula, Yann E . MORIN, Angelo Compagnucci



On 07/04/2020 13:15, Jagan Teki wrote:
> From: Esben Haabendal <esben@geanix.com>
> 
> Inorder to build the numpy distutils extension packages like
> python-scipy, python-numba, it require an explicit pkg-config
> path fixup for npymath.ini.
> 
> This pkg-config path fixup would update the prefix path of
> npymath.ini with actual target staging area where numpy core
> was built, so-that numpy distutils extension packages would
> explicitly link this config path for their package environment.
> 
> Without this extension packages cannot find -lnpymath since
> it uses host libraries (like libnpymath.a).
> 
> So, attach the post install staging hook with pkg-config
> path fixup for npymath.ini.
> 
> Signed-off-by: Esben Haabendal <esben@geanix.com>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

  Applied to master, thanks.

  Regards,
  Arnout

> ---
> Changes for v8:
> - none
> Changes for v7:
> - rephrase commit and comments of fixup npymath.ini
> 
>   package/python-numpy/python-numpy.mk | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
> 
> diff --git a/package/python-numpy/python-numpy.mk b/package/python-numpy/python-numpy.mk
> index 3f0df7a640..4d2e852b43 100644
> --- a/package/python-numpy/python-numpy.mk
> +++ b/package/python-numpy/python-numpy.mk
> @@ -32,6 +32,21 @@ define PYTHON_NUMPY_CONFIGURE_CMDS
>   	echo "include_dirs = $(STAGING_DIR)/usr/include" >> $(@D)/site.cfg
>   endef
>   
> +# Fixup the npymath.ini prefix path with actual target staging area where
> +# numpy core was built. Without this, target builds using numpy distutils
> +# extensions like python-scipy, python-numba cannot find -lnpymath since
> +# it uses host libraries (like libnpymath.a).
> +# So, the numpy distutils extension packages would explicitly link this
> +# config path for their package environment.
> +PYTHON_NUMPY_STAGING_DIR = $(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/numpy
> +PYTHON_NUMPY_NPY_PKG_CONFIG_PATH=$(PYTHON_NUMPY_STAGING_DIR)/core/lib/npy-pkg-config
> +define PYTHON_NUMPY_FIXUP_NPY_PKG_CONFIG_FILES
> +	sed -e '/^pkgdir=/d' \
> +	    -e '/^prefix=/i pkgdir=$(PYTHON_NUMPY_STAGING_DIR)/core' \
> +	    -i $(PYTHON_NUMPY_NPY_PKG_CONFIG_PATH)/npymath.ini
> +endef
> +PYTHON_NUMPY_POST_INSTALL_STAGING_HOOKS += PYTHON_NUMPY_FIXUP_NPY_PKG_CONFIG_FILES
> +
>   # Some package may include few headers from NumPy, so let's install it
>   # in the staging area.
>   PYTHON_NUMPY_INSTALL_STAGING = YES
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Buildroot] [PATCH v8 5/5] package/python-scipy: new package
  2020-04-07 11:15 ` [Buildroot] [PATCH v8 5/5] package/python-scipy: new package Jagan Teki
@ 2022-01-07 23:12   ` Arnout Vandecappelle
  0 siblings, 0 replies; 15+ messages in thread
From: Arnout Vandecappelle @ 2022-01-07 23:12 UTC (permalink / raw)
  To: Jagan Teki, buildroot
  Cc: Esben Haabendal, Angelo Compagnucci, linux-amarula,
	Yann E . MORIN, Suniel Mahesh



On 07/04/2020 13:15, Jagan Teki wrote:
> Add python-scipy with 1.4.1 release version.
> 
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>

  After merging the python-pybind changes, I tried to merge scipy as well. I 
made a bunch of fixes, updated the version, but unfortunately it still doesn't 
build due to cross-compilation issues. So I've sent a WIP version of the series 
and marked this one as superseded. I'll mark the WIP version as Changes 
Requested as well, since it doesn't work.

  Regards,
  Arnout

> ---
> Changes for v8:
> - none
> Changes for v7:
> - update the commit message
> - fix sha256 value of pybind11 LICENCE
> 
>   DEVELOPERS                             |  1 +
>   package/Config.in                      |  1 +
>   package/python-scipy/Config.in         | 22 ++++++++++++
>   package/python-scipy/python-scipy.hash |  9 +++++
>   package/python-scipy/python-scipy.mk   | 46 ++++++++++++++++++++++++++
>   5 files changed, 79 insertions(+)
>   create mode 100644 package/python-scipy/Config.in
>   create mode 100644 package/python-scipy/python-scipy.hash
>   create mode 100644 package/python-scipy/python-scipy.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index f06d54a662..3203b0bc47 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -1154,6 +1154,7 @@ F:	configs/orangepi_zero_plus2_defconfig
>   F:	configs/pine64_defconfig
>   F:	configs/pine64_sopine_defconfig
>   F:	package/python-pybind11
> +F:	package/python-scipy
>   
>   N:	James Hilliard <james.hilliard1@gmail.com>
>   F:	package/gensio/
> diff --git a/package/Config.in b/package/Config.in
> index afe32f52b4..f5af9b07ea 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1120,6 +1120,7 @@ menu "External python modules"
>   	source "package/python-scandir/Config.in"
>   	source "package/python-scapy/Config.in"
>   	source "package/python-schedule/Config.in"
> +	source "package/python-scipy/Config.in"
>   	source "package/python-sdnotify/Config.in"
>   	source "package/python-secretstorage/Config.in"
>   	source "package/python-see/Config.in"
> diff --git a/package/python-scipy/Config.in b/package/python-scipy/Config.in
> new file mode 100644
> index 0000000000..4d8227c31a
> --- /dev/null
> +++ b/package/python-scipy/Config.in
> @@ -0,0 +1,22 @@
> +config BR2_PACKAGE_PYTHON_SCIPY
> +	bool "python-scipy"
> +	depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL # python-numpy
> +	depends on BR2_TOOLCHAIN_HAS_FORTRAN
> +	depends on BR2_TOOLCHAIN_BUILDROOT_CXX
> +	depends on BR2_PACKAGE_PYTHON3
> +	select BR2_PACKAGE_PYTHON_NUMPY
> +	select BR2_PACKAGE_LAPACK
> +	select BR2_PACKAGE_OPENBLAS
> +	help
> +	  The SciPy library is one of the core packages that make up the SciPy
> +	  stack. It provides many user-friendly and efficient numerical
> +	  routines such as routines for numerical integration, interpolation,
> +	  optimization, linear algebra and statistics.
> +
> +	  https://www.scipy.org/scipylib/
> +
> +comment "python-scipy needs toolchain w/ fortran and c++ and glibc or musl"
> +	depends on BR2_PACKAGE_PYTHON3
> +	depends on !BR2_TOOLCHAIN_HAS_FORTRAN || \
> +		!BR2_TOOLCHAIN_BUILDROOT_CXX || \
> +		(!BR2_TOOLCHAIN_USES_GLIBC && !BR2_TOOLCHAIN_USES_MUSL)
> diff --git a/package/python-scipy/python-scipy.hash b/package/python-scipy/python-scipy.hash
> new file mode 100644
> index 0000000000..c9d295ef6b
> --- /dev/null
> +++ b/package/python-scipy/python-scipy.hash
> @@ -0,0 +1,9 @@
> +# Locally generated
> +sha256 dee1bbf3a6c8f73b6b218cb28eed8dd13347ea2f87d572ce19b289d6fd3fbc59  scipy-1.4.1.tar.gz
> +sha256 5cbdbe33385779958be8b9310497e32d2eec144d82ef425780d3e19f8af6de76  LICENSE.txt
> +sha256 37e64a498894ac7c3b070023e3689e954a8ecf8a23b90968d09a455f1b4f7b35  scipy/linalg/src/lapack_deprecations/LICENSE
> +sha256 606209a000716c5f66e33e180ce08434b96ed17db4975ab9723c6b5fbcc89609  scipy/ndimage/LICENSE.txt
> +sha256 3df9207af2fdb861af0ae3b22026f163b9bcfab4e525dc4943afe2ffa3f77624  scipy/optimize/tnc/LICENSE
> +sha256 f0cedf52503b2d42b83411a0a16e6fefac346dfad8fddc66f50050150123470c  scipy/sparse/linalg/dsolve/SuperLU/License.txt
> +sha256 0926566f9f406178d1214f8cc796e166b1213dd7c05e0c5b461a8b8ac9e50bbe  scipy/sparse/linalg/eigen/arpack/ARPACK/COPYING
> +sha256 34db0c0c4f931861d720555c9cd7a2e228d1290ba29af0f2ee80c41bb2038afb  scipy/spatial/qhull_src/COPYING.txt
> diff --git a/package/python-scipy/python-scipy.mk b/package/python-scipy/python-scipy.mk
> new file mode 100644
> index 0000000000..1d66b146ec
> --- /dev/null
> +++ b/package/python-scipy/python-scipy.mk
> @@ -0,0 +1,46 @@
> +################################################################################
> +#
> +# python-scipy
> +#
> +################################################################################
> +
> +PYTHON_SCIPY_VERSION = 1.4.1
> +PYTHON_SCIPY_SOURCE = scipy-$(PYTHON_SCIPY_VERSION).tar.gz
> +PYTHON_SCIPY_SITE = https://pypi.python.org/packages/04/ab/e2eb3e3f90b9363040a3d885ccc5c79fe20c5b8a3caa8fe3bf47ff653260
> +PYTHON_SCIPY_LICENSE = BSD-3-Clause, BSD-2-Clause, BSD, BSD-Style, \
> +	Apache-2.0, MIT
> +PYTHON_SCIPY_LICENSE_FILES = \
> +	LICENSE.txt \
> +	scipy/linalg/src/lapack_deprecations/LICENSE \
> +	scipy/ndimage/LICENSE.txt \
> +	scipy/optimize/tnc/LICENSE \
> +	scipy/sparse/linalg/dsolve/SuperLU/License.txt \
> +	scipy/sparse/linalg/eigen/arpack/ARPACK/COPYING \
> +	scipy/spatial/qhull_src/COPYING.txt
> +PYTHON_SCIPY_SETUP_TYPE = setuptools
> +PYTHON_SCIPY_DEPENDENCIES += \
> +	host-python-numpy \
> +	host-python-pybind11 \
> +	lapack \
> +	openblas \
> +	python-numpy
> +
> +PYTHON_SCIPY_BUILD_OPTS = config_fc --fcompiler=gnu95
> +PYTHON_SCIPY_ENV += F90=$(TARGET_CROSS)gfortran F77=$(TARGET_CROSS)gfortran
> +
> +# Provide system configuration options to numpy distutils extenions, telling
> +# to find all include files and libraries in staging directory.
> +define PYTHON_SCIPY_CONFIGURE_CMDS
> +	-rm -f $(@D)/site.cfg
> +	echo "[DEFAULT]" >> $(@D)/site.cfg
> +	echo "library_dirs = $(STAGING_DIR)/usr/lib" >> $(@D)/site.cfg
> +	echo "include_dirs = $(STAGING_DIR)/usr/include" >> $(@D)/site.cfg
> +endef
> +
> +# Use the target numpy pkg-config configuration files modified for target
> +# cross-compilation.  Without this, numpy distutils will cause the linker to
> +# link with host libnpymath.a.
> +PYTHON_SCIPY_ENV += NPY_PKG_CONFIG_PATH=$(PYTHON_NUMPY_NPY_PKG_CONFIG_PATH)
> +PYTHON_SCIPY_INSTALL_STAGING = YES
> +
> +$(eval $(python-package))
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-01-07 23:12 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-07 11:15 [Buildroot] [PATCH v8 0/5] package/python-scipy: new package Jagan Teki
2020-04-07 11:15 ` [Buildroot] [PATCH v8 1/5] package/python-numpy: Bump to version 1.18.2 Jagan Teki
2020-05-01 12:37   ` Thomas Petazzoni
2020-04-07 11:15 ` [Buildroot] [PATCH v8 2/5] package/python-numpy: fixup npymath.ini for numpy extensions Jagan Teki
2022-01-07 22:10   ` Arnout Vandecappelle
2020-04-07 11:15 ` [Buildroot] [PATCH v8 3/5] package/python-pybind11: new host package Jagan Teki
2020-04-07 11:15 ` [Buildroot] [PATCH v8 4/5] support/testing: add python-pybind11 test Jagan Teki
2022-01-07 21:38   ` Arnout Vandecappelle
2020-04-07 11:15 ` [Buildroot] [PATCH v8 5/5] package/python-scipy: new package Jagan Teki
2022-01-07 23:12   ` Arnout Vandecappelle
2020-04-07 11:49 ` [Buildroot] [PATCH v8 0/5] " Thomas Petazzoni
2020-04-07 13:43   ` Jagan Teki
2020-04-07 15:01     ` Yann E. MORIN
2020-04-07 16:18       ` Jagan Teki
2020-07-03  8:09         ` Jagan Teki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.