#975546 Please, support multiple flavor of numpy for different use cases.

Package:
python3-numpy
Source:
numpy
Description:
Fast array facility to the Python 3 language
Submitter:
Francesco Paolo Lovergine
Date:
2025-05-15 14:33:02 UTC
Severity:
wishlist
#975546#5
Date:
2020-11-23 10:56:57 UTC
From:
To:
Hi, in current development cycle different flavors of blas/lapack are
available. One of the flavor is the openblas based, and at least a pair
of different options are available for supporting multithreading (with and
without 64 indexes) in numpy for both blas and lapack.

Here:

./doc/source/user/building.rst

there are more information about openblas-pthread support. The same could be
applied for OpenMP support. It would be nice giving developers the opportunity
to use multhreading/parallel implementations of numpy without rebuilding, just
by using the right combination of numpy package and libraries. This report
could be relevant for implementation of other wishlist requests, such as
separating blas support in other packages for people who don't use it.

#975546#10
Date:
2024-11-17 19:36:49 UTC
From:
To:
As far as threading goes, as far as I know the different BLAS builds are
binary compatible. Their threading support is internal to the BLAS
library, they present a common ABI to the client program
(numpy).

That is, you can equally install libopenblas0-pthread or
libopenblas0-openmp (or libopenblas0-serial), or the BLIS variants, etc.
At runtime numpy will use whichever BLAS you installed as your
preferred alternative.

Using 64-bit BLAS (libblas64.so) is a separate issue. It would require
separate specific build configuration and packaging.

#975546#15
Date:
2025-05-15 14:32:07 UTC
From:
To:
Actually the package seems to be currently broken with openblas-serial. When I
select the open-blas serial alternative:


There are 4 choices for the alternative liblapack.so.3-x86_64-linux-gnu
(providing /usr/lib/x86_64-linux-gnu/liblapack.so.3).

  Selection    Path
Priority   Status
------------------------------------------------------------
  0            /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3   100
auto mode
  1            /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3             10
manual mode
  2            /usr/lib/x86_64-linux-gnu/openblas-openmp/liblapack.so.3    95
manual mode
  3            /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3   100
manual mode
* 4            /usr/lib/x86_64-linux-gnu/openblas-serial/liblapack.so.3    90
manual mode


Importing numpy will just fail:


Python 3.13.3 (main, Apr 10 2025, 21:38:51) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/numpy/_core/__init__.py", line 23, in
<module>
    from . import multiarray
  File "/usr/lib/python3/dist-packages/numpy/_core/multiarray.py", line 10, in
<module>
    from . import overrides
  File "/usr/lib/python3/dist-packages/numpy/_core/overrides.py", line 7, in
<module>
    from numpy._core._multiarray_umath import (
        add_docstring,  _get_implementing_args, _ArrayFunctionDispatcher)
ImportError: /lib/x86_64-linux-gnu/libblas.so.3: undefined symbol:
sgemv_thread_n

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/numpy/__init__.py", line 114, in
<module>
    from numpy.__config__ import show_config
  File "/usr/lib/python3/dist-packages/numpy/__config__.py", line 4, in
<module>
    from numpy._core._multiarray_umath import (
    ...<3 lines>...
    )
  File "/usr/lib/python3/dist-packages/numpy/_core/__init__.py", line 49, in
<module>
    raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.13 from "/usr/bin/python3"
  * The NumPy version is: "2.2.4"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: /lib/x86_64-linux-gnu/libblas.so.3: undefined symbol:
sgemv_thread_n


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    import numpy
  File "/usr/lib/python3/dist-packages/numpy/__init__.py", line 119, in
<module>
    raise ImportError(msg) from e
ImportError: Error importing numpy: you should not try to import numpy from
        its source directory; please exit the numpy source tree, and relaunch
        your python interpreter from there.