Move buildroot to bsp directory.
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
Don't use <fenv.h> on uClibc
|
||||
|
||||
The python-numpy code already has provisions to not use <fenv.h> when
|
||||
not available. However, it uses __GLIBC__ to know whether fenv.h is
|
||||
available or not, but uClibc defines __GLIBC__, so python-numpy thinks
|
||||
fenv.h is available.
|
||||
|
||||
This patch fixes that by changing all defined(__GLIBC__) occurences by
|
||||
(defined(__GLIBC__) && !defined(__UCLIBC__)).
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
|
||||
Index: b/numpy/core/include/numpy/ufuncobject.h
|
||||
===================================================================
|
||||
--- a/numpy/core/include/numpy/ufuncobject.h
|
||||
+++ b/numpy/core/include/numpy/ufuncobject.h
|
||||
@@ -413,11 +413,11 @@
|
||||
(void) fpsetsticky(0); \
|
||||
}
|
||||
|
||||
-#elif defined(__GLIBC__) || defined(__APPLE__) || \
|
||||
+#elif (defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__APPLE__) || \
|
||||
defined(__CYGWIN__) || defined(__MINGW32__) || \
|
||||
(defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
|
||||
|
||||
-#if defined(__GLIBC__) || defined(__APPLE__) || \
|
||||
+#if (defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__APPLE__) || \
|
||||
defined(__MINGW32__) || defined(__FreeBSD__)
|
||||
#include <fenv.h>
|
||||
#elif defined(__CYGWIN__)
|
||||
Index: b/numpy/core/src/npymath/ieee754.c.src
|
||||
===================================================================
|
||||
--- a/numpy/core/src/npymath/ieee754.c.src
|
||||
+++ b/numpy/core/src/npymath/ieee754.c.src
|
||||
@@ -586,11 +586,11 @@
|
||||
}
|
||||
|
||||
|
||||
-#elif defined(__GLIBC__) || defined(__APPLE__) || \
|
||||
+#elif (defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__APPLE__) || \
|
||||
defined(__CYGWIN__) || defined(__MINGW32__) || \
|
||||
(defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
|
||||
|
||||
-# if defined(__GLIBC__) || defined(__APPLE__) || \
|
||||
+# if (defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__APPLE__) || \
|
||||
defined(__MINGW32__) || defined(__FreeBSD__)
|
||||
# include <fenv.h>
|
||||
# elif defined(__CYGWIN__)
|
||||
Index: b/numpy/numarray/_capi.c
|
||||
===================================================================
|
||||
--- a/numpy/numarray/_capi.c
|
||||
+++ b/numpy/numarray/_capi.c
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
-#if defined(__GLIBC__) || defined(__APPLE__) || defined(__MINGW32__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
|
||||
+#if (defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__APPLE__) || defined(__MINGW32__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
|
||||
#include <fenv.h>
|
||||
#elif defined(__CYGWIN__)
|
||||
#include "numpy/fenv/fenv.h"
|
||||
@@ -258,7 +258,7 @@
|
||||
}
|
||||
|
||||
/* Likewise for Integer overflows */
|
||||
-#if defined(__GLIBC__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
|
||||
+#if (defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
|
||||
static int int_overflow_error(Float64 value) { /* For x86_64 */
|
||||
feraiseexcept(FE_OVERFLOW);
|
||||
return (int) value;
|
||||
@@ -3007,7 +3007,7 @@
|
||||
return retstatus;
|
||||
}
|
||||
|
||||
-#elif defined(__GLIBC__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
|
||||
+#elif (defined(__GLIBC__) && !defined(__UCLIBC__)) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 502114))
|
||||
|
||||
static int
|
||||
NA_checkFPErrors(void)
|
||||
@@ -0,0 +1,33 @@
|
||||
From b0a1b9628d17251bb417a063ec6c6e09f32393c2 Mon Sep 17 00:00:00 2001
|
||||
From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
|
||||
Date: Tue, 6 Oct 2015 01:20:48 +0100
|
||||
Subject: [PATCH] Don't blindly enable frexpl and ldexpl for uClibc
|
||||
|
||||
When the size of double and long double are equal, numpy blindly
|
||||
assumes that frexpl and ldexpl will be available as well. But for
|
||||
uClibc, that's not true: it only defines the long double functions
|
||||
when long double "exists" on the architecture.
|
||||
|
||||
So make an exception for uClibc.
|
||||
|
||||
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
|
||||
---
|
||||
numpy/core/src/private/npy_config.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/numpy/core/src/private/npy_config.h b/numpy/core/src/private/npy_config.h
|
||||
index 453dbd0..7ecf72c 100644
|
||||
--- a/numpy/core/src/private/npy_config.h
|
||||
+++ b/numpy/core/src/private/npy_config.h
|
||||
@@ -11,7 +11,7 @@
|
||||
#endif
|
||||
|
||||
/* Safe to use ldexp and frexp for long double for MSVC builds */
|
||||
-#if (NPY_SIZEOF_LONGDOUBLE == NPY_SIZEOF_DOUBLE) || defined(_MSC_VER)
|
||||
+#if ((NPY_SIZEOF_LONGDOUBLE == NPY_SIZEOF_DOUBLE) && !defined(__UCLIBC__)) || defined(_MSC_VER)
|
||||
#ifdef HAVE_LDEXP
|
||||
#define HAVE_LDEXPL 1
|
||||
#endif
|
||||
--
|
||||
2.5.3
|
||||
|
||||
18
bsp/buildroot/package/python-numpy/Config.in
Normal file
18
bsp/buildroot/package/python-numpy/Config.in
Normal file
@@ -0,0 +1,18 @@
|
||||
config BR2_PACKAGE_PYTHON_NUMPY_ARCH_SUPPORTS
|
||||
bool
|
||||
# Numpy has some CPU specific code
|
||||
default y if 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.
|
||||
|
||||
Note that NumPy needs fenv.h fully supported by the
|
||||
C library.
|
||||
|
||||
http://www.numpy.org/
|
||||
2
bsp/buildroot/package/python-numpy/python-numpy.hash
Normal file
2
bsp/buildroot/package/python-numpy/python-numpy.hash
Normal file
@@ -0,0 +1,2 @@
|
||||
# Locally computed:
|
||||
sha256 2764d0819acc77e9ff81b060fe7f69530b0d85c26ac9d162639b787cb227d253 numpy-1.8.0.tar.gz
|
||||
33
bsp/buildroot/package/python-numpy/python-numpy.mk
Normal file
33
bsp/buildroot/package/python-numpy/python-numpy.mk
Normal file
@@ -0,0 +1,33 @@
|
||||
################################################################################
|
||||
#
|
||||
# python-numpy
|
||||
#
|
||||
################################################################################
|
||||
|
||||
PYTHON_NUMPY_VERSION = 1.8.0
|
||||
PYTHON_NUMPY_SOURCE = numpy-$(PYTHON_NUMPY_VERSION).tar.gz
|
||||
PYTHON_NUMPY_SITE = http://downloads.sourceforge.net/numpy
|
||||
PYTHON_NUMPY_LICENSE = BSD-3c
|
||||
PYTHON_NUMPY_LICENSE_FILES = LICENSE.txt
|
||||
PYTHON_NUMPY_SETUP_TYPE = distutils
|
||||
|
||||
ifeq ($(BR2_PACKAGE_CLAPACK),y)
|
||||
PYTHON_NUMPY_DEPENDENCIES += clapack
|
||||
PYTHON_NUMPY_SITE_CFG_LIBS += blas lapack
|
||||
endif
|
||||
|
||||
PYTHON_NUMPY_BUILD_OPTS = --fcompiler=None
|
||||
|
||||
define PYTHON_NUMPY_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
|
||||
echo "libraries =" $(subst $(space),$(comma),$(PYTHON_NUMPY_SITE_CFG_LIBS)) >> $(@D)/site.cfg
|
||||
endef
|
||||
|
||||
# Some package may include few headers from NumPy, so let's install it
|
||||
# in the staging area.
|
||||
PYTHON_NUMPY_INSTALL_STAGING = YES
|
||||
|
||||
$(eval $(python-package))
|
||||
Reference in New Issue
Block a user