|
1 |
| -diff -Naur numpy-1.9.1.orig/numpy/core/include/numpy/npy_endian.h numpy-1.9.1.ios/numpy/core/include/numpy/npy_endian.h |
2 |
| ---- numpy-1.9.1.orig/numpy/core/include/numpy/npy_endian.h 2014-10-26 15:36:14.000000000 +0100 |
3 |
| -+++ numpy-1.9.1.ios/numpy/core/include/numpy/npy_endian.h 2014-11-24 01:59:52.000000000 +0100 |
4 |
| -@@ -6,7 +6,10 @@ |
5 |
| - * endian.h |
| 1 | +diff -Nru numpy-1.14.1/numpy/_build_utils/apple_accelerate.py numpy/numpy/_build_utils/apple_accelerate.py |
| 2 | +--- numpy-1.14.1/numpy/_build_utils/apple_accelerate.py 2018-02-05 09:21:37.000000000 +0800 |
| 3 | ++++ numpy/numpy/_build_utils/apple_accelerate.py 2018-03-04 13:26:52.000000000 +0800 |
| 4 | +@@ -8,8 +8,13 @@ |
| 5 | + |
| 6 | + def uses_accelerate_framework(info): |
| 7 | + """ Returns True if Accelerate framework is used for BLAS/LAPACK """ |
| 8 | ++ # If we're not building on Darwin (macOS), don't use accelerate |
| 9 | + if sys.platform != "darwin": |
| 10 | + return False |
| 11 | ++ # If we're building on macOS, but targeting a different platform, |
| 12 | ++ # don't use accelerate. |
| 13 | ++ if os.getenv('_PYTHON_HOST_PLATFORM', None): |
| 14 | ++ return False |
| 15 | + r_accelerate = re.compile("Accelerate") |
| 16 | + extra_link_args = info.get('extra_link_args', '') |
| 17 | + for arg in extra_link_args: |
| 18 | +diff -Nru numpy-1.14.1/numpy/core/src/multiarray/strfuncs.c numpy/numpy/core/src/multiarray/strfuncs.c |
| 19 | +--- numpy-1.14.1/numpy/core/src/multiarray/strfuncs.c 2018-02-20 07:16:17.000000000 +0800 |
| 20 | ++++ numpy/numpy/core/src/multiarray/strfuncs.c 2018-03-04 13:26:52.000000000 +0800 |
| 21 | +@@ -41,7 +41,7 @@ |
| 22 | + * XXX we do this in multiple places; time for a string library? |
6 | 23 | */
|
| 24 | + static char * |
| 25 | +-extend(char **strp, Py_ssize_t n, Py_ssize_t *maxp) |
| 26 | ++extend_str(char **strp, Py_ssize_t n, Py_ssize_t *maxp) |
| 27 | + { |
| 28 | + char *str = *strp; |
| 29 | + Py_ssize_t new_cap; |
| 30 | +@@ -71,7 +71,7 @@ |
| 31 | + npy_intp i, N, ret = 0; |
7 | 32 |
|
8 |
| --#ifdef NPY_HAVE_ENDIAN_H |
| 33 | + #define CHECK_MEMORY do { \ |
| 34 | +- if (extend(string, *n, max_n) == NULL) { \ |
| 35 | ++ if (extend_str(string, *n, max_n) == NULL) { \ |
| 36 | + ret = -1; \ |
| 37 | + goto end; \ |
| 38 | + } \ |
| 39 | +diff -Nru numpy-1.14.1/numpy/distutils/system_info.py numpy/numpy/distutils/system_info.py |
| 40 | +--- numpy-1.14.1/numpy/distutils/system_info.py 2018-02-21 01:46:17.000000000 +0800 |
| 41 | ++++ numpy/numpy/distutils/system_info.py 2018-03-04 13:26:52.000000000 +0800 |
| 42 | +@@ -219,21 +219,21 @@ |
| 43 | + _lib_dirs = [ |
| 44 | + 'lib', |
| 45 | + ] |
| 46 | +- |
9 | 47 | +
|
10 |
| -+//#ifdef NPY_HAVE_ENDIAN_H |
11 |
| -+//XXX iOS fix, it detects endian.h, but weird detection happen during the compilation |
12 |
| -+#if 0 |
13 |
| - /* Use endian.h if available */ |
14 |
| - #include <endian.h> |
15 |
| - |
16 |
| -diff -Naur numpy-1.9.1.orig/numpy/core/setup.py numpy-1.9.1.ios/numpy/core/setup.py |
17 |
| ---- numpy-1.9.1.orig/numpy/core/setup.py 2014-10-26 17:22:33.000000000 +0100 |
18 |
| -+++ numpy-1.9.1.ios/numpy/core/setup.py 2014-11-24 01:58:43.000000000 +0100 |
19 |
| -@@ -951,6 +951,9 @@ |
20 |
| - blas_info = get_info('blas_opt', 0) |
21 |
| - #blas_info = {} |
22 |
| - def get_dotblas_sources(ext, build_dir): |
23 |
| -+ # XXX no blas for iOS, maybe it's not needed anymore as our recipe do |
24 |
| -+ # BLAS=None |
25 |
| -+ return None |
26 |
| - if blas_info: |
27 |
| - if ('NO_ATLAS_INFO', 1) in blas_info.get('define_macros', []): |
28 |
| - return None # dotblas needs ATLAS, Fortran compiled blas will not be sufficient. |
29 |
| -diff -Naur numpy-1.9.1.orig/numpy/linalg/setup.py numpy-1.9.1.ios/numpy/linalg/setup.py |
30 |
| ---- numpy-1.9.1.orig/numpy/linalg/setup.py 2014-10-26 15:36:15.000000000 +0100 |
31 |
| -+++ numpy-1.9.1.ios/numpy/linalg/setup.py 2014-11-24 01:57:48.000000000 +0100 |
32 |
| -@@ -34,8 +34,14 @@ |
33 |
| - return ext.depends[:1] |
34 |
| - return ext.depends[:2] |
35 |
| - |
36 |
| -+ def get_lapack_lite_sources_ios(ext, build_dir): |
37 |
| -+ return ext.depends[:-1] |
| 48 | + _include_dirs = [d.replace('/', os.sep) for d in _include_dirs] |
| 49 | + _lib_dirs = [d.replace('/', os.sep) for d in _lib_dirs] |
| 50 | + def add_system_root(library_root): |
| 51 | + """Add a package manager root to the include directories""" |
| 52 | + global default_lib_dirs |
| 53 | + global default_include_dirs |
| 54 | +- |
38 | 55 | +
|
39 |
| -+ def get_umath_linalg_ios(ext, build_dir): |
40 |
| -+ return ext.depends[:1] |
| 56 | + library_root = os.path.normpath(library_root) |
| 57 | +- |
41 | 58 | +
|
42 |
| - config.add_extension('lapack_lite', |
43 |
| -- sources = [get_lapack_lite_sources], |
44 |
| -+ sources = [get_lapack_lite_sources_ios], |
45 |
| - depends = ['lapack_litemodule.c'] + lapack_lite_src, |
46 |
| - extra_info = lapack_info |
47 |
| - ) |
48 |
| -@@ -43,7 +49,7 @@ |
49 |
| - # umath_linalg module |
| 59 | + default_lib_dirs.extend( |
| 60 | + os.path.join(library_root, d) for d in _lib_dirs) |
| 61 | + default_include_dirs.extend( |
| 62 | + os.path.join(library_root, d) for d in _include_dirs) |
| 63 | +- |
| 64 | ++ |
| 65 | + if sys.version_info >= (3, 3): |
| 66 | + # VCpkg is the de-facto package manager on windows for C/C++ |
| 67 | + # libraries. If it is on the PATH, then we append its paths here. |
| 68 | +@@ -247,7 +247,7 @@ |
| 69 | + else: |
| 70 | + specifier = 'x64' |
50 | 71 |
|
51 |
| - config.add_extension('_umath_linalg', |
52 |
| -- sources = [get_lapack_lite_sources], |
53 |
| -+ sources = [get_umath_linalg_ios], |
54 |
| - depends = ['umath_linalg.c.src'] + lapack_lite_src, |
55 |
| - extra_info = lapack_info, |
56 |
| - libraries = ['npymath'], |
| 72 | +- vcpkg_installed = os.path.join(vcpkg_dir, 'installed') |
| 73 | ++ vcpkg_installed = os.path.join(vcpkg_dir, 'installed') |
| 74 | + for vcpkg_root in [ |
| 75 | + os.path.join(vcpkg_installed, specifier + '-windows'), |
| 76 | + os.path.join(vcpkg_installed, specifier + '-windows-static'), |
| 77 | +@@ -260,7 +260,7 @@ |
| 78 | + conda_dir = os.path.dirname(conda) |
| 79 | + add_system_root(os.path.join(conda_dir, '..', 'Library')) |
| 80 | + add_system_root(os.path.join(conda_dir, 'Library')) |
| 81 | +- |
| 82 | ++ |
| 83 | + else: |
| 84 | + default_lib_dirs = libpaths(['/usr/local/lib', '/opt/lib', '/usr/lib', |
| 85 | + '/opt/local/lib', '/sw/lib'], platform_bits) |
| 86 | +@@ -1549,7 +1549,9 @@ |
| 87 | + if not atlas_info: |
| 88 | + atlas_info = get_info('atlas') |
| 89 | + |
| 90 | +- if sys.platform == 'darwin' and not (atlas_info or openblas_info or |
| 91 | ++ if sys.platform == 'darwin' \ |
| 92 | ++ and not os.getenv('_PYTHON_HOST_PLATFORM', None) \ |
| 93 | ++ and not (atlas_info or openblas_info or |
| 94 | + lapack_mkl_info): |
| 95 | + # Use the system lapack from Accelerate or vecLib under OSX |
| 96 | + args = [] |
| 97 | +@@ -1655,7 +1657,9 @@ |
| 98 | + if not atlas_info: |
| 99 | + atlas_info = get_info('atlas_blas') |
| 100 | + |
| 101 | +- if sys.platform == 'darwin' and not (atlas_info or openblas_info or |
| 102 | ++ if sys.platform == 'darwin' \ |
| 103 | ++ and not os.getenv('_PYTHON_HOST_PLATFORM', None) \ |
| 104 | ++ and not (atlas_info or openblas_info or |
| 105 | + blas_mkl_info or blis_info): |
| 106 | + # Use the system BLAS from Accelerate or vecLib under OSX |
| 107 | + args = [] |
| 108 | +diff -Nru numpy-1.14.1/numpy/linalg/lapack_lite/f2c.h numpy/numpy/linalg/lapack_lite/f2c.h |
| 109 | +--- numpy-1.14.1/numpy/linalg/lapack_lite/f2c.h 2018-02-20 07:16:17.000000000 +0800 |
| 110 | ++++ numpy/numpy/linalg/lapack_lite/f2c.h 2018-03-04 16:12:26.000000000 +0800 |
| 111 | +@@ -7,6 +7,8 @@ |
| 112 | + #ifndef F2C_INCLUDE |
| 113 | + #define F2C_INCLUDE |
| 114 | + |
| 115 | ++#include <math.h> |
| 116 | ++ |
| 117 | + typedef int integer; |
| 118 | + typedef char *address; |
| 119 | + typedef short int shortint; |
0 commit comments