pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/math/py-numpy/patches



Module Name:    pkgsrc
Committed By:   thor
Date:           Thu Mar 25 22:09:07 UTC 2021

Modified Files:
        pkgsrc/math/py-numpy/patches: patch-numpy_distutils_system__info.py

Log Message:
math/py-numpy: Actually use BLAS_LIBS and LAPACK_LIBS.

The previous state included our BLAS choice but the build
did not honour the selected libs. This patches the config
script to not search for LAPACK and BLAS, using our settings
instead. Hopefull we can get that option upstreamed.

Approved during freeze by wiz.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
    pkgsrc/math/py-numpy/patches/patch-numpy_distutils_system__info.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/math/py-numpy/patches/patch-numpy_distutils_system__info.py
diff -u pkgsrc/math/py-numpy/patches/patch-numpy_distutils_system__info.py:1.3 pkgsrc/math/py-numpy/patches/patch-numpy_distutils_system__info.py:1.4
--- pkgsrc/math/py-numpy/patches/patch-numpy_distutils_system__info.py:1.3      Mon Oct 12 21:51:58 2020
+++ pkgsrc/math/py-numpy/patches/patch-numpy_distutils_system__info.py  Thu Mar 25 22:09:07 2021
@@ -1,21 +1,96 @@
-$NetBSD: patch-numpy_distutils_system__info.py,v 1.3 2020/10/12 21:51:58 bacon Exp $
+$NetBSD: patch-numpy_distutils_system__info.py,v 1.4 2021/03/25 22:09:07 thor Exp $
 
 Disable openblas detection.  In pkgsrc, use mk/blas.buildlink.mk.
 
---- numpy/distutils/system_info.py.orig        2020-04-19 08:51:58.000000000 +0000
+--- numpy/distutils/system_info.py.orig        2020-06-02 05:24:58.000000000 +0000
 +++ numpy/distutils/system_info.py
-@@ -1644,14 +1644,6 @@ class lapack_opt_info(system_info):
-         return False
+@@ -1730,34 +1722,15 @@ class lapack_opt_info(system_info):
+         return getattr(self, '_calc_info_{}'.format(name))()
  
-     def _calc_info_openblas(self):
--        info = get_info('openblas_lapack')
--        if info:
--            self.set_info(**info)
--            return True
--        info = get_info('openblas_clapack')
--        if info:
--            self.set_info(**info)
--            return True
-         return False
+     def calc_info(self):
+-        user_order = os.environ.get(self.order_env_var_name, None)
+-        if user_order is None:
+-            lapack_order = self.lapack_order
+-        else:
+-            # the user has requested the order of the
+-            # check they are all in the available list, a COMMA SEPARATED list
+-            user_order = user_order.lower().split(',')
+-            non_existing = []
+-            lapack_order = []
+-            for order in user_order:
+-                if order in self.lapack_order:
+-                    lapack_order.append(order)
+-                elif len(order) > 0:
+-                    non_existing.append(order)
+-            if len(non_existing) > 0:
+-                raise ValueError("lapack_opt_info user defined "
+-                                 "LAPACK order has unacceptable "
+-                                 "values: {}".format(non_existing))
+-
+-        for lapack in lapack_order:
+-            if self._calc_info(lapack):
+-                return
+-
+-        if 'lapack' not in lapack_order:
+-            # Since the user may request *not* to use any library, we still need
+-            # to raise warnings to signal missing packages!
+-            warnings.warn(LapackNotFoundError.__doc__ or '', stacklevel=2)
+-            warnings.warn(LapackSrcNotFoundError.__doc__ or '', stacklevel=2)
++        # Fixing usage of LAPACK specified in LAPACK_LIBS.
++        # Existence of LAPACK_LIBS is mandatory. Things shall break early
++        # if it is not set.
++        info = {}
++        info['language'] = 'f77'
++        info['extra_link_args'] = os.environ['LAPACK_LIBS'].split()
++ 
++        self.set_info(**info)
++        return
  
-     def _calc_info_flame(self):
+ 
+ class _ilp64_opt_info_mixin:
+@@ -1875,32 +1848,19 @@ class blas_opt_info(system_info):
+         return getattr(self, '_calc_info_{}'.format(name))()
+ 
+     def calc_info(self):
+-        user_order = os.environ.get(self.order_env_var_name, None)
+-        if user_order is None:
+-            blas_order = self.blas_order
+-        else:
+-            # the user has requested the order of the
+-            # check they are all in the available list
+-            user_order = user_order.lower().split(',')
+-            non_existing = []
+-            blas_order = []
+-            for order in user_order:
+-                if order in self.blas_order:
+-                    blas_order.append(order)
+-                elif len(order) > 0:
+-                    non_existing.append(order)
+-            if len(non_existing) > 0:
+-                raise ValueError("blas_opt_info user defined BLAS order has unacceptable values: {}".format(non_existing))
+-
+-        for blas in blas_order:
+-            if self._calc_info(blas):
+-                return
+-
+-        if 'blas' not in blas_order:
+-            # Since the user may request *not* to use any library, we still need
+-            # to raise warnings to signal missing packages!
+-            warnings.warn(BlasNotFoundError.__doc__ or '', stacklevel=2)
+-            warnings.warn(BlasSrcNotFoundError.__doc__ or '', stacklevel=2)
++        # Fixing usage of libcblas and the BLAS specified in BLAS_LIBS.
++        # Existence of BLAS_LIBS is mandatory. Things shall break early
++        # if it is not set.
++        info = {}
++        # I do not want to assume a language. It is potentially mixed anyway.
++        #info['language'] = 'c'
++        # Try to work without cblas, just link BLAS_LIBS.
++        #info['libraries'] = ['cblas']
++        #info['define_macros'] = [('HAVE_CBLAS', None)]
++        info['extra_link_args'] = os.environ['BLAS_LIBS'].split()
++ 
++        self.set_info(**info)
++        return
+ 
+ 
+ class blas_ilp64_opt_info(blas_opt_info, _ilp64_opt_info_mixin):



Home | Main Index | Thread Index | Old Index