forked from flet-dev/python-ios-pre-3.13
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnumpy.patch
More file actions
119 lines (113 loc) · 4.95 KB
/
numpy.patch
File metadata and controls
119 lines (113 loc) · 4.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
diff -Nru numpy-1.14.1/numpy/_build_utils/apple_accelerate.py numpy/numpy/_build_utils/apple_accelerate.py
--- numpy-1.14.1/numpy/_build_utils/apple_accelerate.py 2018-02-05 09:21:37.000000000 +0800
+++ numpy/numpy/_build_utils/apple_accelerate.py 2018-03-04 13:26:52.000000000 +0800
@@ -8,8 +8,13 @@
def uses_accelerate_framework(info):
""" Returns True if Accelerate framework is used for BLAS/LAPACK """
+ # If we're not building on Darwin (macOS), don't use accelerate
if sys.platform != "darwin":
return False
+ # If we're building on macOS, but targeting a different platform,
+ # don't use accelerate.
+ if os.getenv('_PYTHON_HOST_PLATFORM', None):
+ return False
r_accelerate = re.compile("Accelerate")
extra_link_args = info.get('extra_link_args', '')
for arg in extra_link_args:
diff -Nru numpy-1.14.1/numpy/core/src/multiarray/strfuncs.c numpy/numpy/core/src/multiarray/strfuncs.c
--- numpy-1.14.1/numpy/core/src/multiarray/strfuncs.c 2018-02-20 07:16:17.000000000 +0800
+++ numpy/numpy/core/src/multiarray/strfuncs.c 2018-03-04 13:26:52.000000000 +0800
@@ -41,7 +41,7 @@
* XXX we do this in multiple places; time for a string library?
*/
static char *
-extend(char **strp, Py_ssize_t n, Py_ssize_t *maxp)
+extend_str(char **strp, Py_ssize_t n, Py_ssize_t *maxp)
{
char *str = *strp;
Py_ssize_t new_cap;
@@ -71,7 +71,7 @@
npy_intp i, N, ret = 0;
#define CHECK_MEMORY do { \
- if (extend(string, *n, max_n) == NULL) { \
+ if (extend_str(string, *n, max_n) == NULL) { \
ret = -1; \
goto end; \
} \
diff -Nru numpy-1.14.1/numpy/distutils/system_info.py numpy/numpy/distutils/system_info.py
--- numpy-1.14.1/numpy/distutils/system_info.py 2018-02-21 01:46:17.000000000 +0800
+++ numpy/numpy/distutils/system_info.py 2018-03-04 13:26:52.000000000 +0800
@@ -219,21 +219,21 @@
_lib_dirs = [
'lib',
]
-
+
_include_dirs = [d.replace('/', os.sep) for d in _include_dirs]
_lib_dirs = [d.replace('/', os.sep) for d in _lib_dirs]
def add_system_root(library_root):
"""Add a package manager root to the include directories"""
global default_lib_dirs
global default_include_dirs
-
+
library_root = os.path.normpath(library_root)
-
+
default_lib_dirs.extend(
os.path.join(library_root, d) for d in _lib_dirs)
default_include_dirs.extend(
os.path.join(library_root, d) for d in _include_dirs)
-
+
if sys.version_info >= (3, 3):
# VCpkg is the de-facto package manager on windows for C/C++
# libraries. If it is on the PATH, then we append its paths here.
@@ -247,7 +247,7 @@
else:
specifier = 'x64'
- vcpkg_installed = os.path.join(vcpkg_dir, 'installed')
+ vcpkg_installed = os.path.join(vcpkg_dir, 'installed')
for vcpkg_root in [
os.path.join(vcpkg_installed, specifier + '-windows'),
os.path.join(vcpkg_installed, specifier + '-windows-static'),
@@ -260,7 +260,7 @@
conda_dir = os.path.dirname(conda)
add_system_root(os.path.join(conda_dir, '..', 'Library'))
add_system_root(os.path.join(conda_dir, 'Library'))
-
+
else:
default_lib_dirs = libpaths(['/usr/local/lib', '/opt/lib', '/usr/lib',
'/opt/local/lib', '/sw/lib'], platform_bits)
@@ -1549,7 +1549,9 @@
if not atlas_info:
atlas_info = get_info('atlas')
- if sys.platform == 'darwin' and not (atlas_info or openblas_info or
+ if sys.platform == 'darwin' \
+ and not os.getenv('_PYTHON_HOST_PLATFORM', None) \
+ and not (atlas_info or openblas_info or
lapack_mkl_info):
# Use the system lapack from Accelerate or vecLib under OSX
args = []
@@ -1655,7 +1657,9 @@
if not atlas_info:
atlas_info = get_info('atlas_blas')
- if sys.platform == 'darwin' and not (atlas_info or openblas_info or
+ if sys.platform == 'darwin' \
+ and not os.getenv('_PYTHON_HOST_PLATFORM', None) \
+ and not (atlas_info or openblas_info or
blas_mkl_info or blis_info):
# Use the system BLAS from Accelerate or vecLib under OSX
args = []
diff -Nru numpy-1.14.1/numpy/linalg/lapack_lite/f2c.h numpy/numpy/linalg/lapack_lite/f2c.h
--- numpy-1.14.1/numpy/linalg/lapack_lite/f2c.h 2018-02-20 07:16:17.000000000 +0800
+++ numpy/numpy/linalg/lapack_lite/f2c.h 2018-03-04 16:12:26.000000000 +0800
@@ -7,6 +7,8 @@
#ifndef F2C_INCLUDE
#define F2C_INCLUDE
+#include <math.h>
+
typedef int integer;
typedef char *address;
typedef short int shortint;