| @@ -1,21 +1,96 @@ | | | @@ -1,21 +1,96 @@ |
1 | $NetBSD: patch-numpy_distutils_system__info.py,v 1.3 2020/10/12 21:51:58 bacon Exp $ | | 1 | $NetBSD: patch-numpy_distutils_system__info.py,v 1.4 2021/03/25 22:09:07 thor Exp $ |
2 | | | 2 | |
3 | Disable openblas detection. In pkgsrc, use mk/blas.buildlink.mk. | | 3 | Disable openblas detection. In pkgsrc, use mk/blas.buildlink.mk. |
4 | | | 4 | |
5 | --- numpy/distutils/system_info.py.orig 2020-04-19 08:51:58.000000000 +0000 | | 5 | --- numpy/distutils/system_info.py.orig 2020-06-02 05:24:58.000000000 +0000 |
6 | +++ numpy/distutils/system_info.py | | 6 | +++ numpy/distutils/system_info.py |
7 | @@ -1644,14 +1644,6 @@ class lapack_opt_info(system_info): | | 7 | @@ -1730,34 +1722,15 @@ class lapack_opt_info(system_info): |
8 | return False | | 8 | return getattr(self, '_calc_info_{}'.format(name))() |
9 | | | 9 | |
10 | def _calc_info_openblas(self): | | 10 | def calc_info(self): |
11 | - info = get_info('openblas_lapack') | | 11 | - user_order = os.environ.get(self.order_env_var_name, None) |
12 | - if info: | | 12 | - if user_order is None: |
13 | - self.set_info(**info) | | 13 | - lapack_order = self.lapack_order |
14 | - return True | | 14 | - else: |
15 | - info = get_info('openblas_clapack') | | 15 | - # the user has requested the order of the |
16 | - if info: | | 16 | - # check they are all in the available list, a COMMA SEPARATED list |
17 | - self.set_info(**info) | | 17 | - user_order = user_order.lower().split(',') |
18 | - return True | | 18 | - non_existing = [] |
19 | return False | | 19 | - lapack_order = [] |
| | | 20 | - for order in user_order: |
| | | 21 | - if order in self.lapack_order: |
| | | 22 | - lapack_order.append(order) |
| | | 23 | - elif len(order) > 0: |
| | | 24 | - non_existing.append(order) |
| | | 25 | - if len(non_existing) > 0: |
| | | 26 | - raise ValueError("lapack_opt_info user defined " |
| | | 27 | - "LAPACK order has unacceptable " |
| | | 28 | - "values: {}".format(non_existing)) |
| | | 29 | - |
| | | 30 | - for lapack in lapack_order: |
| | | 31 | - if self._calc_info(lapack): |
| | | 32 | - return |
| | | 33 | - |
| | | 34 | - if 'lapack' not in lapack_order: |
| | | 35 | - # Since the user may request *not* to use any library, we still need |
| | | 36 | - # to raise warnings to signal missing packages! |
| | | 37 | - warnings.warn(LapackNotFoundError.__doc__ or '', stacklevel=2) |
| | | 38 | - warnings.warn(LapackSrcNotFoundError.__doc__ or '', stacklevel=2) |
| | | 39 | + # Fixing usage of LAPACK specified in LAPACK_LIBS. |
| | | 40 | + # Existence of LAPACK_LIBS is mandatory. Things shall break early |
| | | 41 | + # if it is not set. |
| | | 42 | + info = {} |
| | | 43 | + info['language'] = 'f77' |
| | | 44 | + info['extra_link_args'] = os.environ['LAPACK_LIBS'].split() |
| | | 45 | + |
| | | 46 | + self.set_info(**info) |
| | | 47 | + return |
20 | | | 48 | |
21 | def _calc_info_flame(self): | | 49 | |
| | | 50 | class _ilp64_opt_info_mixin: |
| | | 51 | @@ -1875,32 +1848,19 @@ class blas_opt_info(system_info): |
| | | 52 | return getattr(self, '_calc_info_{}'.format(name))() |
| | | 53 | |
| | | 54 | def calc_info(self): |
| | | 55 | - user_order = os.environ.get(self.order_env_var_name, None) |
| | | 56 | - if user_order is None: |
| | | 57 | - blas_order = self.blas_order |
| | | 58 | - else: |
| | | 59 | - # the user has requested the order of the |
| | | 60 | - # check they are all in the available list |
| | | 61 | - user_order = user_order.lower().split(',') |
| | | 62 | - non_existing = [] |
| | | 63 | - blas_order = [] |
| | | 64 | - for order in user_order: |
| | | 65 | - if order in self.blas_order: |
| | | 66 | - blas_order.append(order) |
| | | 67 | - elif len(order) > 0: |
| | | 68 | - non_existing.append(order) |
| | | 69 | - if len(non_existing) > 0: |
| | | 70 | - raise ValueError("blas_opt_info user defined BLAS order has unacceptable values: {}".format(non_existing)) |
| | | 71 | - |
| | | 72 | - for blas in blas_order: |
| | | 73 | - if self._calc_info(blas): |
| | | 74 | - return |
| | | 75 | - |
| | | 76 | - if 'blas' not in blas_order: |
| | | 77 | - # Since the user may request *not* to use any library, we still need |
| | | 78 | - # to raise warnings to signal missing packages! |
| | | 79 | - warnings.warn(BlasNotFoundError.__doc__ or '', stacklevel=2) |
| | | 80 | - warnings.warn(BlasSrcNotFoundError.__doc__ or '', stacklevel=2) |
| | | 81 | + # Fixing usage of libcblas and the BLAS specified in BLAS_LIBS. |
| | | 82 | + # Existence of BLAS_LIBS is mandatory. Things shall break early |
| | | 83 | + # if it is not set. |
| | | 84 | + info = {} |
| | | 85 | + # I do not want to assume a language. It is potentially mixed anyway. |
| | | 86 | + #info['language'] = 'c' |
| | | 87 | + # Try to work without cblas, just link BLAS_LIBS. |
| | | 88 | + #info['libraries'] = ['cblas'] |
| | | 89 | + #info['define_macros'] = [('HAVE_CBLAS', None)] |
| | | 90 | + info['extra_link_args'] = os.environ['BLAS_LIBS'].split() |
| | | 91 | + |
| | | 92 | + self.set_info(**info) |
| | | 93 | + return |
| | | 94 | |
| | | 95 | |
| | | 96 | class blas_ilp64_opt_info(blas_opt_info, _ilp64_opt_info_mixin): |