-
Notifications
You must be signed in to change notification settings - Fork 311
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
Unable to build wheel after #394 on macos arm64 #398
Comments
I'm trying to look into this now. What is the output of |
❯ pip freeze
build==1.2.2.post1
cmake==3.31.1
cmake-build-extension==0.6.1
gitdb==4.0.11
GitPython==3.1.43
ninja==1.11.1.2
packaging==24.2
pyproject_hooks==1.2.0
setuptools==75.6.0
setuptools-scm==8.1.0
smmap==5.0.1
wheel==0.45.1 |
Also, I have abseil installed via homebrew. $ brew info abseil
==> abseil: stable 20240722.0 (bottled), HEAD
C++ Common Libraries
https://abseil.io
Installed
/opt/homebrew/Cellar/abseil/20240722.0 (772 files, 11.8MB) *
Poured from bottle using the formulae.brew.sh API on 2024-12-02 at 19:49:03
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/a/abseil.rb
License: Apache-2.0
==> Dependencies
Build: cmake ✔, googletest ✔
==> Options
--HEAD
Install HEAD version
==> Analytics
install: 74,913 (30 days), 224,079 (90 days), 609,348 (365 days)
install-on-request: 505 (30 days), 1,914 (90 days), 10,121 (365 days)
build-error: 132 (30 days) |
I'm afraid none of my notes really apply to mac. All I did was change the minimum version of cmake (which you exceed, so we're good there) and change this one line. If you change that back (but leave the other change), does it start working? If that really fixes it, it sounds like a cmake problem to me that we'll have to work around.
According to my notes, here's a summary of how I had to test this: Base Environment:
I had a lot of problem building Also using the
Works on v0.11.1, but gave |
Machine
Version
Environment
ResultIt worked.
So the major difference here is I'm not on an ARM, but an x86. |
It works for me if I remove the ❯ git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d6fb81e..49ac75c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -67,7 +67,7 @@ if (WITH_PYTHON)
find_package(SWIG 4.0)
# Use Python3_ROOT_DIR to help find python3, if the correct location is not
# being found by default.
- find_package(Python3 COMPONENTS Interpreter Development.Module)
+ find_package(Python3 COMPONENTS Interpreter Development)
endif()
if (MSVC)
diff --git a/setup.py b/setup.py
index 242882a..b352381 100644
--- a/setup.py
+++ b/setup.py
@@ -22,7 +22,8 @@ setuptools.setup(
'-DCALL_FROM_SETUP_PY:BOOL=ON',
'-DBUILD_SHARED_LIBS:BOOL=OFF',
'-DCMAKE_POSITION_INDEPENDENT_CODE=ON',
- '-DWITH_PYTHON=ON'
+ '-DWITH_PYTHON=ON',
+ '-DBUILD_TESTS=OFF',
]
)
], And, after calling ❯ pip install dist/s2geometry-0.0.0-cp313-cp313-macosx_15_0_arm64.whl
Processing ./dist/s2geometry-0.0.0-cp313-cp313-macosx_15_0_arm64.whl
Installing collected packages: s2geometry
Successfully installed s2geometry-0.0.0
[notice] A new release of pip is available: 24.2 -> 24.3.1
[notice] To update, run: pip install --upgrade pip
❯ python -c "from s2geometry import S2LatLng;print(S2LatLng.FromDegrees(90.0, 90.0).ToPoint())"
<s2geometry.S2Point; proxy of <Swig Object of type 'S2Point *' at 0x102b367c0> > |
What's the full error? What symbols aren't found?
Is this because your |
I see I did not run I am able to reproduce the error on x86 and arm64 for macos now: Build Output
Here is the link line that is Failing on Mac:
Here is it succeeding (without
The only difference is Here is Linux for reference:
So if we do something like this, it should work on both platforms:
I don't know if this behavior is routed in cmake or swig, but this should make it work for both platforms. Would this be acceptable? I'm checking windows now... |
I'll open a separate issue for this |
Seems like it should be cmake. Swig doesn't manage the paths. Could you file a bug with cmake and/or ask for help from them?
Yes, that's fine. Put a comment explaining why it's a special case and pointing to this issue. |
Can confirm, Windows setup
|
- Closes google#398 Signed-off-by: Andy Neff <andy@visionsystemsinc.com>
Can confirm, that when I set both to C++17, it behaves. It's possible I wasn't setting C++XX at all in absl, thinking it was 17 by default, and that was messing things up. I'll chalk it up to user error and focus on the input(3) error |
Mac seems to use dynamic linking more for making modules than Linux and Windows do. Thus the common python symbols were missing and it requires libpython3.13.dylib for these symbols. If this is a different in the mac "Framework" then cmake should probably include that for the Development.Module component. But this is a workaround in the meantime while we wait for any upstream fixes. Closes #398 Signed-off-by: Andy Neff <andy@visionsystemsinc.com>
@andyneff Do you think you can reproduce this with some minimal example like https://github.com/Mizux/cmake-swig and file an upstream bug report? |
Upstream bug report is filed here: https://gitlab.kitware.com/cmake/cmake/-/issues/26503 |
Replace `$Python3_LIBRARIES` with `Python3::Module` in`swig_link_libraries`. This is a better resolution to #398 Tested on Linux (in python and manylinux docker images), Windows 11 w/ VS 2022, and macOS. The [officially suggested fix](https://gitlab.kitware.com/cmake/cmake/-/issues/26503#note_1600940) works, and feels much better than my initial workaround. Signed-off-by: Andy Neff <andy@visionsystemsinc.com>
Machine
$ uname -vm Darwin Kernel Version 24.1.0: Thu Oct 10 21:02:45 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T8112 arm6
Version
Diff
Python
Error
I started going back commits using
git checkout HEAD~1 python -m build .
The version that produced a wheel successfully was #388. So something broke with #394 unless the approach is now different.
The text was updated successfully, but these errors were encountered: