Hi Peter,
I managed to get scipy to cross compile, since I was in a hurry, and
have no deeper understanding of python / distutils / setuptools, it
turned out to be an ugly hack (but obviously I was not the first one to
do ugly things there ;) )
Maybe you have had some progress as well, and we can figure out a nicer
solution.
See the attached files, involving openblas, a bbappend for python-numpy
and python-scipy.
Regards,
Matthias
--
Dr.-Ing. Matthias Schöpfer
Softwareentwicklung
____________________________________
IdentPro GmbH
Camp-Spich-Str. 4
53842 Troisdorf
Tel: +49 (0)2241 / 866 392 46
Fax: +49 (0)2241 / 866 392 99
eMail: matthias.schoep...@identpro.de
http://www.identpro.de
identplus® – Das 3D Staplerleitsystem mit enormen Sparpotenzial: z. B.
über 67.000 EUR pro Jahr bei 500 Transporten täglich! Berechnen Sie das
Einsparpotenzial für Ihr Lager mit dem identplus® Potenzialrechner.
identplus® live erleben: Vereinbaren Sie jetzt einen Termin!
---------------------------------
IdentPro GmbH
Member of Dr. Wack Holding GmbH & Co.KG
Sitz und Registergericht: St. Augustin, HRB 9770 Siegburg
Geschäftsführer: Michael Wack
Umsatzsteuer-ID-Nr.: DE 254 824 945
WEEE-Reg.-Nr. DE 79026890
DESCRIPTION = "OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13
BSD version."
SUMMARY = "OpenBLAS : An optimized BLAS library"
AUTHOR = "Alexander Leiva <norxan...@gmail.com>"
HOMEPAGE = "http://www.openblas.net/";
PRIORITY= "optional"
SECTION = "libs"
LICENSE = "BSD"
PR = "r0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=5adf4792c949a00013ce25d476a2abc0"
SRC_URI = "https://github.com/xianyi/OpenBLAS/archive/v${PV}.tar.gz";
SRC_URI[md5sum] = "48637eb29f5b492b91459175dcc574b1"
SRC_URI[sha256sum] =
"5ef38b15d9c652985774869efd548b8e3e972e1e99475c673b25537ed7bcf394"
S = "${WORKDIR}/OpenBLAS-${PV}"
inherit cmake
DEPENDS = " libgfortran "
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += " \
file://0001-ragged-set-of-patches-to-allow-cross-compile.patch \
"
From e144c3b86abb49bbc943a17e5271bf880dfca5df Mon Sep 17 00:00:00 2001
From: Matthias Schoepfer <matthias.schoep...@identpro.de>
Date: Thu, 22 Mar 2018 15:57:13 +0100
Subject: [PATCH] ragged set of patches to allow cross compile
---
numpy/distutils/command/build_ext.py | 4 ++--
numpy/distutils/exec_command.py | 1 +
numpy/distutils/fcompiler/gnu.py | 2 +-
numpy/version.py | 2 +-
4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/numpy/distutils/command/build_ext.py b/numpy/distutils/command/build_ext.py
index 0fa52a2..e2154e7 100644
--- a/numpy/distutils/command/build_ext.py
+++ b/numpy/distutils/command/build_ext.py
@@ -411,10 +411,10 @@ class build_ext (old_build_ext):
depends=ext.depends)
objects = c_objects + f_objects
-
+ from distutils.sysconfig import get_config_vars
if ext.extra_objects:
objects.extend(ext.extra_objects)
- extra_args = ext.extra_link_args or []
+ extra_args = get_config_vars('LDSHARED')[0].split(' ')[1:] + (ext.extra_link_args or [])
libraries = self.get_libraries(ext)[:]
library_dirs = ext.library_dirs[:]
diff --git a/numpy/distutils/exec_command.py b/numpy/distutils/exec_command.py
index 8faf4b2..d928ada 100644
--- a/numpy/distutils/exec_command.py
+++ b/numpy/distutils/exec_command.py
@@ -113,6 +113,7 @@ def find_executable(exe, path=None, _cache={}):
fn = os.path.join(path, exe)
for s in suffixes:
f_ext = fn+s
+ f_ext = f_ext.split(' ')[0]
if not os.path.islink(f_ext):
f_ext = realpath(f_ext)
if os.path.isfile(f_ext) and os.access(f_ext, os.X_OK):
diff --git a/numpy/distutils/fcompiler/gnu.py b/numpy/distutils/fcompiler/gnu.py
index 4649fd7..61cafd6 100644
--- a/numpy/distutils/fcompiler/gnu.py
+++ b/numpy/distutils/fcompiler/gnu.py
@@ -261,7 +261,7 @@ class Gnu95FCompiler(GnuFCompiler):
self.executables[key].append('-mno-cygwin')
return v
- possible_executables = ['gfortran', 'f95']
+ possible_executables = [os.environ.get('FC', 'gfortran'), 'f95']
executables = {
'version_cmd' : ["<F90>", "-dumpversion"],
'compiler_f77' : [None, "-Wall", "-g", "-ffixed-form",
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
index c1cb5fb..75bbfe2 100644
--- a/numpy/distutils/system_info.py
+++ b/numpy/distutils/system_info.py
@@ -620,7 +620,7 @@ class system_info(object):
path = self.get_paths(self.section, key)
if path == ['']:
path = []
- return path
+ return []
def get_include_dirs(self, key='include_dirs'):
return self.get_paths(self.section, key)
SUMMARY = "Scientific Library for Python"
SECTION = "devel/python"
HOMEPAGE = "https://pypi.python.org/pypi/scipy";
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=d0db8f4148a3d5534cfb93be78f9287c"
SRC_URI="https://github.com/scipy/scipy/releases/download/v1.0.0/scipy-1.0.0.tar.gz";
#PYPI_PACKAGE="scipy"
SRC_URI[md5sum] = "53fa34bd3733a9a4216842b6000f7316"
SRC_URI[sha256sum] =
"87ea1f11a0e9ec08c264dc64551d501fa307289460705f6fccd84cbfc7926d10"
inherit setuptools distutils
RDEPENDS_${PN} += "python-core openblas libgfortran"
DEPENDS += "python-numpy python-numpy-native python-core python-distutils
openblas libgfortran "
S="${WORKDIR}/scipy-1.0.0"
do_compile_prepend() {
export
PYTHONPATH="${STAGING_LIBDIR}/python2.7/site-packages"
# export LAPACK="${STAGING_LIBDIR}"
export OPENBLAS="${STAGING_LIBDIR}"
# export OPT="${CFLAGS}"
}
do_install() {
export
PYTHONPATH="${STAGING_LIBDIR_NATIVE}/python2.7/site-packages"
# export LAPACK="${STAGING_LIBDIR}"
export OPENBLAS="${STAGING_LIBDIR}"
distutils_do_install;
}
--
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto