8000 BUG: BLAS detection assumes Debian/Ubuntu specific changes with unknown symbol from cblas · Issue #25028 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
s-t-e-v-e-n-k opened this issue Oct 30, 2023 · 3 comments · Fixed by #25055

Comments

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

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

@rgommers rgommers added this to the 1.26.2 release milestone Oct 31, 2023
@rgommers
Copy link
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.

@rgommers
Copy link
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

@s-t-e-v-e-n-k
Copy link
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
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0