Skip to content

BUG: BLAS detection assumes Debian/Ubuntu specific changes with unknown symbol from cblas #25028

Closed

Description

@s-t-e-v-e-n-k

Describe the issue:

Building NumPy 1.26.1 on openSUSE results in a module that builds fine, but when importing it results in an unknown symbol:

[  234s] ImportError: 
[  234s] 
[  234s] IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
[  234s] 
[  234s] Importing the numpy C-extensions failed. This error can happen for
[  234s] many reasons, often due to issues with your setup or how NumPy was
[  234s] installed.
[  234s] 
[  234s] We have compiled some common reasons and troubleshooting tips at:
[  234s] 
[  234s]     https://numpy.org/devdocs/user/troubleshooting-importerror.html
[  234s] 
[  234s] Please note and check the following:
[  234s] 
[  234s]   * The Python version is: Python3.9 from "/usr/bin/python3.9"
[  234s]   * The NumPy version is: "1.26.1"
[  234s] 
[  234s] and make sure that they are the versions you expect.
[  234s] Please carefully study the documentation linked above for further help.
[  234s] 
[  234s] Original error was: /home/abuild/rpmbuild/BUILDROOT/python-numpy-1.26.1-0.x86_64/usr/lib64/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-x86_64-linux-gnu.so: undefined symbol: cblas_sgemm

I think this is because of a Debian-specific change, in /usr/share/doc/libblas-dev/README.if-you-look-for-libcblas.so.3:

Debian science team maintainers have merged the CBLAS ABI into
the libblas.so shared object. Everything you need from libcblas.so
can be found in libblas.so . Please link your program against it
instead.

Due to that change, linking against -lblas is absolutely fine, and works -- it's currently passing in your CI. However, other distributions are likely not doing the same. I can probably work around this by using blas-order=cblas, but I also thought I'd make you aware of that distribution-specific change as well.

Reproduce the code example:

<None required>

Error message:

No response

Runtime information:

NumPy 1.26.1
openSUSE Tumbleweed 20231026

Context for the issue:

No response

Activity

  1. added this to the 1.26.2 release milestone on Oct 31, 2023
  2. rgommers commented on Oct 31, 2023

    @rgommers
    Member

    Thank you for the report @s-t-e-v-e-n-k. You are completely correct, I was unaware that Debian did this and hence relied on a CI job to test Netlib BLAS that didn't cover the split libblas/libcblas situation. We'll get this fixed soon and backported for 1.26.2.

  3. rgommers commented on Oct 31, 2023

    @rgommers
    Member

    @s-t-e-v-e-n-k I'm building a CI job based on the opensuse/tumbleweed Docker container, and it looks like for BLAS there isn't a pkg-config file installed - is that right?

    I used this to install the system dependencies:

    zypper install -y git gcc-c++ python3-pip python3-devel lapack pkgconf-pkg-config
    
  4. s-t-e-v-e-n-k commented on Oct 31, 2023

    @s-t-e-v-e-n-k
    Author

    Sadly, yes. It's being worked on. You'll need lapack-devel as well, but the lack of .pc files is known.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions