Opened 10 months ago
Last modified 7 weeks ago
#73097 assigned defect
py313-numpy @2.3.3: ERROR: Problem encountered: Function `sin` not found
| Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | michaelld (Michael Dickens) |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | 2.11.5 |
| Keywords: | Cc: | reneeotten (Renee Otten) | |
| Port: | py313-numpy |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
py*-numpy fails to build on Snow Leopard:
../numpy/_core/meson.build:214:4: ERROR: Problem encountered: Function `sin` not found A full log can be found at /opt/local/var/macports/build/py313-numpy-3d860dbd/work/numpy-2.3.3/build/meson-logs/meson-log.txt ERROR Backend subprocess exited when trying to invoke build_wheel Command failed: cd "/opt/local/var/macports/build/py313-numpy-3d860dbd/work/numpy-2.3.3" && /opt/local/Library/Frameworks/Python.framework/Versions/3.13/bin/python3.13 -m build --no-isolation --wheel --outdir /opt/local/var/macports/build/py313-numpy-3d860dbd/work -Cbuild-dir=build -Csetup-args=-Dallow-noblas=false -Csetup-args=-Dblas=openblas -Csetup-args=-Dlapack=openblas -Csetup-args=-Dpkg_config_path=/opt/local/lib/pkgconfig Exit code: 1
Previously reported in #70142 (on Sonoma) but closed as worksforme.
Attachments (1)
Change History (14)
comment:1 Changed 10 months ago by ryandesign (Ryan Carsten Schmidt)
| Description: | modified (diff) |
|---|
Changed 10 months ago by jmroot (Joshua Root)
| Attachment: | meson-log.txt added |
|---|
comment:2 Changed 10 months ago by jmroot (Joshua Root)
comment:3 follow-up: 6 Changed 10 months ago by reneeotten (Renee Otten)
I guess a newer compiler should be used...
on 10.15 and above CC=/usr/bin/clang is used
on 10.14-10.13 it picks CC='/opt/local/bin/clang-mp-17'
on 10.12-10.7 it picks CC='/opt/local/bin/clang-mp-16'
and only on 10.6 CC='/opt/local/bin/clang-mp-11' is used.
I do not know why that is the case, nor have such an old system to test on. I probably can just simply blacklist everything lower than macports-clang-16, that should presumably "fix" the issue. I can try to do that if you want, but will not be spending any time on trying to figure anything else out for a by now pretty much unsupported OS. So if that's not the solution you envision then let's leave the ticket open for interested parties.
comment:4 Changed 10 months ago by reneeotten (Renee Otten)
comment:5 Changed 10 months ago by reneeotten (Renee Otten)
the patch patch-meson-remove-Wl,-no_weak_imports.diff in py-meson supposedly should take care of that. Again, I don't have such an old OS to test on, but that would probably the first place to look and make sure that patch is still doing the right thing.
comment:6 Changed 10 months ago by ryandesign (Ryan Carsten Schmidt)
Replying to reneeotten:
I guess a newer compiler should be used...
on 10.15 and above
CC=/usr/bin/clangis usedon 10.14-10.13 it picks
CC='/opt/local/bin/clang-mp-17'on 10.12-10.7 it picks
CC='/opt/local/bin/clang-mp-16'and only on 10.6
CC='/opt/local/bin/clang-mp-11'is used.I do not know why that is the case, nor have such an old system to test on.
Compiler selection logic is here: https://github.com/macports/macports-base/blob/4a2ffe1089b48fb652e4ece9180cc80631c208d3/src/port1.0/portconfigure.tcl#L1238
I probably can just simply blacklist everything lower than
macports-clang-16, that should presumably "fix" the issue.
Since clang 11 is the newest one MacPorts offers to Mac OS X 10.6 systems, blacklisting everything lower than clang 16 will leave no compilers in the list.
comment:7 Changed 9 months ago by 760ceb3b9c0ba4872cadf3ce35a7a494
it looks like clang-16 works on 10.6? https://ports.macports.org/port/clang-16/details/
comment:8 Changed 9 months ago by reneeotten (Renee Otten)
I don't have such an old system and thus cannot try, but feel free to test yourself with:
sudo port -dv install py313-numpy configure.compiler=macports-clang-16
comment:9 Changed 9 months ago by 760ceb3b9c0ba4872cadf3ce35a7a494
unfortunately the exact same thing happens :( (function sin not found)
this issue with the same sin error mentions it might be caused by libm not being linked properly https://github.com/numpy/numpy/issues/28642
comment:10 Changed 9 months ago by reneeotten (Renee Otten)
As I said I don't have access to such an old OS and will not be working on this. Feel free to attempt to fix the issue and if you manage to do so, please submit a PR. There are some possible things to look at (e.g., the patch for meson) that I mentioned in the comments above.
comment:11 Changed 6 months ago by reneeotten (Renee Otten)
ah, NumPy uses its vendored version of meson which -of course- doesn't contain the fix for -no_weak_imports ; that was fixed in this commit and according the build now succeeds on 10.6_x86_64.
It still fails on 10.6_i386 but with a different error:
../numpy/_core/src/common/npy_fpmath.h:19:6: error: No long double representation defined
comment:12 Changed 6 months ago by jmroot (Joshua Root)
https://github.com/numpy/numpy/blob/v2.4.2/numpy/_core/src/common/npy_fpmath.h#L10
Looks like maybe they forgot to define one of those macros here? https://github.com/numpy/numpy/blob/v2.4.2/numpy/_core/include/numpy/numpyconfig.h#L43

Looks like the problem is