Skip to content
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

OpenBSD/amd64 7.4 undefined symbol 'strtold_l' during the import #25047

Closed
DavidAlphaFox opened this issue Oct 31, 2023 · 3 comments
Closed

OpenBSD/amd64 7.4 undefined symbol 'strtold_l' during the import #25047

DavidAlphaFox opened this issue Oct 31, 2023 · 3 comments
Labels
32 - Installation Problems installing or compiling NumPy

Comments

@DavidAlphaFox
Copy link

Steps to reproduce:

in the python's repl
import numpy

Error message:

Python 3.10.13 (main, Oct  5 2023, 16:21:31) [Clang 13.0.0 ] on openbsd7
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
python:/home/david/.local/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310.so: undefined symbol 'strtold_l'
Traceback (most recent call last):
  File "/home/david/.local/lib/python3.10/site-packages/numpy/core/__init__.py", line 24, in <module>
    from . import multiarray
  File "/home/david/.local/lib/python3.10/site-packages/numpy/core/multiarray.py", line 10, in <module>
    from . import overrides
  File "/home/david/.local/lib/python3.10/site-packages/numpy/core/overrides.py", line 8, in <module>
    from numpy.core._multiarray_umath import (
ImportError: Cannot load specified object

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/david/.local/lib/python3.10/site-packages/numpy/__init__.py", line 130, in <module>
    from numpy.__config__ import show as show_config
  File "/home/david/.local/lib/python3.10/site-packages/numpy/__config__.py", line 4, in <module>
    from numpy.core._multiarray_umath import (
  File "/home/david/.local/lib/python3.10/site-packages/numpy/core/__init__.py", line 50, 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.10 from "/usr/local/bin/python"
  * The NumPy version is: "1.26.1"

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

Original error was: Cannot load specified object


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

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/david/.local/lib/python3.10/site-packages/numpy/__init__.py", line 135, 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.
>>>

Additional information:

link with -L/usr/local/lib -lcblas

ldd /home/david/.local/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310.so
/home/david/.local/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310.so:
	Start            End              Type  Open Ref GrpRef Name
	000006b515ba2000 000006b5161b3000 dlib  1    0   0      /home/david/.local/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310.so
	000006b517262000 000006b517281000 rlib  0    1   0      /usr/local/lib/libcblas.so.1.1
	000006b4612bb000 000006b4613a7000 rlib  0    1   0      /usr/lib/libc++.so.9.0
	000006b4faf27000 000006b4faf58000 rlib  0    4   0      /usr/lib/libm.so.10.1
	000006b47a80b000 000006b47a862000 rlib  0    1   0      /usr/local/lib/libblas.so.2.1
	000006b46e94d000 000006b46ebda000 rlib  0    2   0      /usr/local/lib/libgfortran.so.8.0
	000006b4577be000 000006b457805000 rlib  0    1   0      /usr/lib/libc++abi.so.6.0
	000006b4e56d2000 000006b4e5716000 rlib  0    2   0      /usr/local/lib/libquadmath.so.3.0
	000006b4e1366000 000006b4e1385000 rlib  0    1   0      /usr/lib/libz.so.7.0
@DavidAlphaFox DavidAlphaFox added the 32 - Installation Problems installing or compiling NumPy label Oct 31, 2023
@rgommers rgommers added this to the 1.26.2 release milestone Nov 1, 2023
@rgommers
Copy link
Member

rgommers commented Nov 1, 2023

Sorry about that @DavidAlphaFox. This issue was fixed in gh-24979 recently, but that fix was not included in the 1.26.1 release. If you could apply that fix and confirm it works for you, that would be great. We'll include it in 1.26.2 then.

@DavidAlphaFox
Copy link
Author

@rgommers I can success build the numpy with main branch and import numpy without errors.
And on OpenBSD it requires extra LDFLAGS="-L/usr/local/include -lcblas" to link the libclabs.so under the /usr/local/lib.

@rgommers
Copy link
Member

rgommers commented Nov 2, 2023

Thanks for confirming @DavidAlphaFox. The fix is being backported in gh-25049, so it'll land in 1.26.2. I'll close this issue, because we have gh-25041 for the -lcblas part already.

@rgommers rgommers closed this as completed Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
32 - Installation Problems installing or compiling NumPy
Projects
None yet
Development

No branches or pull requests

2 participants