Skip to contentSkip to conversation

python-numpy: introduce ARCH_SUPPORTS hidden variable

PATCH Superseded Gwenhael Goavec-Merou 2 participants 6 messages Oct 6, 2015

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/3 python-numpy: introduce ARCH_SUPPORTS hidden variable

From: Gwenhael Goavec-Merou <[email protected]>

Some packages selects python-numpy. This package has a some CPU specific code. To simplify and avoid duplicate dependencies this patch introduce an hidden ARCH_SUPPORTS variable.

---
Changes v4 -> v5:
* Re-add hidden variable.

---
 package/python-numpy/Config.in | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
package/python-numpy/Config.in +6 -2
index f8170f8..f25102a 100644
@@ -1,9 +1,13 @@
-config BR2_PACKAGE_PYTHON_NUMPY
-	bool "python-numpy"
+config BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
+	bool
 	# Numpy has some CPU specific code
 	depends on BR2_aarch64 || BR2_arm || BR2_armeb || BR2_i386 \
 		|| BR2_mips || BR2_mipsel || BR2_powerpc || BR2_powerpc64 \
 		|| BR2_sh || BR2_x86_64
+
+config BR2_PACKAGE_PYTHON_NUMPY
+	bool "python-numpy"
+	depends on BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
 	help
 	  NumPy is the fundamental package for scientific computing
 	  with Python.
Signature · 1 line
2.4.9
#1 lore raw

PATCH v5 2/3 opencv3: use BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS instead of replicate python-numpy depends

From: Gwenhael Goavec-Merou <[email protected]>

Opencv3 select python-numpy. To reduce CPU arch dependencies, an hidden variable has been added to python-numpy package. This patch propagate this modification.

---
 package/opencv3/Config.in | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
package/opencv3/Config.in +1 -3
index 9492603..2f51580 100644
@@ -165,9 +165,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_aarch64 || BR2_arm || BR2_armeb || BR2_i386 \
-		|| BR2_mips || BR2_mipsel || BR2_powerpc || BR2_powerpc64 \
-		|| BR2_sh || BR2_x86_64 # python-numpy
+	depends on BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
 	select BR2_PACKAGE_PYTHON_NUMPY
 	help
 	  Include opencv_python module into the OpenCV build.
Signature · 1 line
2.4.9
#2 lore raw

PATCH v5 2/3 opencv3: use BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS instead of replicate python-numpy depends

Quoted 7 lines · Gwenhael Goavec-Merou

From: Gwenhael Goavec-Merou <[email protected]>

Opencv3 select python-numpy. To reduce CPU arch dependencies, an hidden variable has been added to python-numpy package. This patch propagate this modification.

Regards,
Arnout

Quoted 20 lines
---
 package/opencv3/Config.in | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
package/opencv3/Config.in +1 -3
index 9492603..2f51580 100644
@@ -165,9 +165,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_aarch64 || BR2_arm || BR2_armeb || BR2_i386 \
-		|| BR2_mips || BR2_mipsel || BR2_powerpc || BR2_powerpc64 \
-		|| BR2_sh || BR2_x86_64 # python-numpy
+	depends on BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
 	select BR2_PACKAGE_PYTHON_NUMPY
 	help
 	  Include opencv_python module into the OpenCV build.
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#3 lore raw

PATCH v5 3/3 gnuradio: gnuradio-python gnuradio-utils: add missing dependency to python-numpy

In reply to Gwenhael Goavec-Merou

From: Gwenhael Goavec-Merou <[email protected]>

Some gnuradio python blocks needs python-numpy present.

Without python-numpy, gnuradio-python based apps fails, on runtime, with traceback like:

Traceback (most recent call last):
File "./top_block.py", line 18, in <module>
from gnuradio import analog
File "/usr/lib/python2.7/site-packages/gnuradio/analog/__init__.py", line 35, in <module>
from am_demod import *
File "/usr/lib/python2.7/site-packages/gnuradio/analog/am_demod.py", line 22, in <module>
from gnuradio import gr
File "/usr/lib/python2.7/site-packages/gnuradio/gr/__init__.py", line 44, in <module>
from top_block import *
File "/usr/lib/python2.7/site-packages/gnuradio/gr/top_block.py", line 30, in <module>
from hier_block2 import hier_block2
File "/usr/lib/python2.7/site-packages/gnuradio/gr/hier_block2.py", line 26, in <module>
import pmt
File "/usr/lib/python2.7/site-packages/pmt/__init__.py", line 58, in <module>
from pmt_to_python import pmt_to_python as to_python
File "/usr/lib/python2.7/site-packages/pmt/pmt_to_python.py", line 22, in <module>
import numpy
ImportError: No module named numpy

---
changes v4 -> v5:
* Re-add BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
Changes v3 -> v4:
* add #runtime comment to BR2_PACKAGE_PYTHON_NUMPY select;
* suppress python-numpy in GNURADIO_DEPENDENCIES variable (not needed for buildtime)
Changes v2 -> v3:
* Since commit 826a2bc18bc0be0b08f2926c9fa1819fe909557c no special attentions is needed to select python-numpy. So BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS is no more needed
Changes v1 -> v2:
* Add dependy to BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS;
* gnuradio-python select numpy;
* gnuradio-utils select again gnuradio-python;
* fix commit message

---
 package/gnuradio/Config.in | 3 +++
 1 file changed, 3 insertions(+)
package/gnuradio/Config.in +3 -0
index e264a21..f188d87 100644
@@ -45,13 +45,16 @@ config BR2_PACKAGE_GNURADIO_FEC
 
 config BR2_PACKAGE_GNURADIO_PYTHON
 	bool "python support"
+	depends on BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
 	select BR2_PACKAGE_BOOST_PYTHON
 	select BR2_PACKAGE_PYTHON
+	select BR2_PACKAGE_PYTHON_NUMPY #runtime
 	help
 	  Enable python component
 
 config BR2_PACKAGE_GNURADIO_UTILS
 	bool "gr-utils support"
+	depends on BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
 	select BR2_PACKAGE_GNURADIO_PYTHON
 	help
 	  Misc python utilities
Signature · 1 line
2.4.9
#4 lore raw

PATCH v5 3/3 gnuradio: gnuradio-python gnuradio-utils: add missing dependency to python-numpy

Quoted 25 lines · Gwenhael Goavec-Merou

From: Gwenhael Goavec-Merou <[email protected]>

Some gnuradio python blocks needs python-numpy present.

Without python-numpy, gnuradio-python based apps fails, on runtime, with traceback like:

Traceback (most recent call last):
File "./top_block.py", line 18, in <module>
from gnuradio import analog
File "/usr/lib/python2.7/site-packages/gnuradio/analog/__init__.py", line 35, in <module>
from am_demod import *
File "/usr/lib/python2.7/site-packages/gnuradio/analog/am_demod.py", line 22, in <module>
from gnuradio import gr
File "/usr/lib/python2.7/site-packages/gnuradio/gr/__init__.py", line 44, in <module>
from top_block import *
File "/usr/lib/python2.7/site-packages/gnuradio/gr/top_block.py", line 30, in <module>
from hier_block2 import hier_block2
File "/usr/lib/python2.7/site-packages/gnuradio/gr/hier_block2.py", line 26, in <module>
import pmt
File "/usr/lib/python2.7/site-packages/pmt/__init__.py", line 58, in <module>
from pmt_to_python import pmt_to_python as to_python
File "/usr/lib/python2.7/site-packages/pmt/pmt_to_python.py", line 22, in <module>
import numpy
ImportError: No module named numpy

Quoted 1 line

But see below

Quoted 25 lines

---
changes v4 -> v5:
* Re-add BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
Changes v3 -> v4:
* add #runtime comment to BR2_PACKAGE_PYTHON_NUMPY select;
* suppress python-numpy in GNURADIO_DEPENDENCIES variable (not needed for buildtime)
Changes v2 -> v3:
* Since commit 826a2bc18bc0be0b08f2926c9fa1819fe909557c no special attentions is needed to select python-numpy. So BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS is no more needed
Changes v1 -> v2:
* Add dependy to BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS;
* gnuradio-python select numpy;
* gnuradio-utils select again gnuradio-python;
* fix commit message

---
 package/gnuradio/Config.in | 3 +++
 1 file changed, 3 insertions(+)
package/gnuradio/Config.in +0 -0
index e264a21..f188d87 100644

package/gnuradio/Config.in config BR2_PACKAGE_GNURADIO_FEC · line 51

Quoted 7 lines
package/gnuradio/Config.in +2 -0
@@ -45,13 +45,16 @@ config BR2_PACKAGE_GNURADIO_FEC
 
 config BR2_PACKAGE_GNURADIO_PYTHON
 	bool "python support"
+	depends on BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
 	select BR2_PACKAGE_BOOST_PYTHON
 	select BR2_PACKAGE_PYTHON
+	select BR2_PACKAGE_PYTHON_NUMPY #runtime

We usually put a space between # runtime

Regards,
Arnout

Quoted 10 lines
package/gnuradio/Config.in +1 -0
 	help
 	  Enable python component
 
 config BR2_PACKAGE_GNURADIO_UTILS
 	bool "gr-utils support"
+	depends on BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
 	select BR2_PACKAGE_GNURADIO_PYTHON
 	help
 	  Misc python utilities
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#5 lore raw

PATCH v5 1/3 python-numpy: introduce ARCH_SUPPORTS hidden variable

In reply to Gwenhael Goavec-Merou
Quoted 7 lines · Gwenhael Goavec-Merou

From: Gwenhael Goavec-Merou <[email protected]>

Some packages selects python-numpy. This package has a some CPU specific code. To simplify and avoid duplicate dependencies this patch introduce an hidden ARCH_SUPPORTS variable.

Regards,
Arnout

Quoted 28 lines

---
Changes v4 -> v5:
* Re-add hidden variable.

---
 package/python-numpy/Config.in | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
package/python-numpy/Config.in +6 -2
index f8170f8..f25102a 100644
@@ -1,9 +1,13 @@
-config BR2_PACKAGE_PYTHON_NUMPY
-	bool "python-numpy"
+config BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
+	bool
 	# Numpy has some CPU specific code
 	depends on BR2_aarch64 || BR2_arm || BR2_armeb || BR2_i386 \
 		|| BR2_mips || BR2_mipsel || BR2_powerpc || BR2_powerpc64 \
 		|| BR2_sh || BR2_x86_64
+
+config BR2_PACKAGE_PYTHON_NUMPY
+	bool "python-numpy"
+	depends on BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
 	help
 	  NumPy is the fundamental package for scientific computing
 	  with Python.
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF