Repository navigation
Open
Labels
Description
Describe the issue:
numpy builds fine on NetBSD with Python 3.11.2. However, when running the self tests, I see an error.
/usr/pkg/bin/python3.11 -c "import numpy; numpy.test()"
Traceback (most recent call last):
File "/scratch/wip/py-numpy/work/.destdir/usr/pkg/lib/python3.11/site-packages/numpy/core/__init__.py", line 23, in <module>
from . import multiarray
File "/scratch/wip/py-numpy/work/.destdir/usr/pkg/lib/python3.11/site-packages/numpy/core/multiarray.py", line 10, in <module>
from . import overrides
File "/scratch/wip/py-numpy/work/.destdir/usr/pkg/lib/python3.11/site-packages/numpy/core/overrides.py", line 6, in <module>
from numpy.core._multiarray_umath import (
ImportError: /scratch/wip/py-numpy/work/.destdir/usr/pkg/lib/python3.11/site-packages/numpy/core/_multiarray_umath.so: Undefined PLT symbol "log2l" (symnum = 437)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/scratch/wip/py-numpy/work/.destdir/usr/pkg/lib/python3.11/site-packages/numpy/__init__.py", line 141, in <module>
from . import core
File "/scratch/wip/py-numpy/work/.destdir/usr/pkg/lib/python3.11/site-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.11 from "/usr/pkg/bin/python3.11"
* The NumPy version is: "1.24.2"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: /scratch/wip/py-numpy/work/.destdir/usr/pkg/lib/python3.11/site-packages/numpy/core/_multiarray_umath.so: Undefined PLT symbol "log2l" (symnum = 437)
Reproduce the code example:
Try running the self tests for numpy 1.24.2 on NetBSD.Error message:
See above.Runtime information:
Can't print that due to the import error shown above.
Python 3.11.2, numpy 1.24.2.
Context for the issue:
This is obviously a bug in NetBSD (http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=53234) but perhaps you can suggest a workaround.
This problem is new in the 1.24.x series of numpy, 1.23.5 builds and tests (mostly) fine in the same environment:
8 failed, 18561 passed, 782 skipped, 1306 deselected, 41 xfailed, 2 xpassed, 59 warnings in 199.07s (0:03:19)
Activity
0-wiz-0 commentedon Mar 13, 2023
The following hack made numpy 1.24.2 build and run the self tests on NetBSD:
Obviously this is not intended to be committed as-is but as an inspiration for a fix :)
Test result afterwards:
[-]BUG: NetBSD: fails due to missing log2l()[/-][+]BUG: NetBSD: fails due to missing log2l(), log1pl(), and expm1l()[/+]mattip commentedon Mar 13, 2023
We made those functions mandatory since they are part of C99. The issue you pointed to is from 2018. Does NetBSD have a plan to become compliant? This is another example how the long double type causes more pain than gain...
riastradh commentedon Mar 14, 2023
We have added definitions wrapping the double versions for now until someone has the time to implement proper 80-bit and 128-bit algorithms. These definitions may appear in NetBSD 10, but not in NetBSD 9, which will remain supported for probably a couple more years before NetBSD 11. So we'll still need to work around these missing symbols for a while.
I agree the noncompliance is bad, but long double has always been a bit of an inconsistent ugly duckling and not widely used.