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

Pyxel can't be compiled on Intel Mac #431

Closed
kitao opened this issue Nov 28, 2022 · 7 comments
Closed

Pyxel can't be compiled on Intel Mac #431

kitao opened this issue Nov 28, 2022 · 7 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@kitao
Copy link
Owner

kitao commented Nov 28, 2022

On Intel Mac with the recent Xcode environment, Pyxel can't be compiled. The situation is similar for Github Actions' hosted runner.
The error happens while compiling SDL2 via rust-sdl2 and the error message is ld: library not found for -lstdc++.

In the case of declaring CXXFLAGS="-stdlib=libc++", compilation itself is finished without errors, but runtime error symbol not found in flat namespace'___isPlatformVersionAtLeast' happens when the Python module wrapped by PyO3 and Maturin is imported.

Regardless of declaring the env variable, Pyxel can be compiled and works on Apple Silicon Mac.

Does anyone know how to resolve this issue?
(Especially @messense , do you have any idea?)

@kitao kitao added the bug Something isn't working label Nov 28, 2022
@messense
Copy link

Can you try maturin==0.13.7? I suspect it has something to do with MACOSX_DEPLOYMENT_TARGET set to 10.7 by default on x86_64 macOS in maturin 0.14.

symbol not found in flat namespace'___isPlatformVersionAtLeast'

It's the same issue as alexcrichton/curl-rust#279, can be resolved by linking to clang_rt.

@messense
Copy link

Regardless of declaring the env variable, Pyxel can be compiled and works on Apple Silicon Mac.

clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]

arm64 macOS uses MACOSX_DEPLOYMENT_TARGET=11.0 you can try set MACOSX_DEPLOYMENT_TARGET=10.9 on x86_64 macOS.

@kitao kitao added the help wanted Extra attention is needed label Nov 28, 2022
@kitao
Copy link
Owner Author

kitao commented Nov 28, 2022

@messense Maturin 0.13.7 worked!

@kitao
Copy link
Owner Author

kitao commented Nov 28, 2022

The environments I tried were macos-12 for aarch64-apple-darwin and macos-12 for x86_64-apple-darwin on GitHub Actions. The built binaries worked on my M1 Mac on Ventura and Intel Mac on Ventura respectively.

@kitao
Copy link
Owner Author

kitao commented Jan 9, 2023

@messense Should I keep to use Maturin 0.13.7 or update the latest one?

@messense
Copy link

messense commented Jan 9, 2023

I think you can stick with 0.13.7 for now, upgrade to new version until PyO3/maturin#1252 is implemented.

If you want to use the latest version, add the MACOSX_DEPLOYMENT_TARGET=10.9 (or other macOS version, maybe 10.12 is a good choice given rust-lang/rust#104385) environment variable should work.

@messense
Copy link

messense commented Jan 9, 2023

BTW, this behavior change in 0.14 is now documented in https://www.maturin.rs/migration.html#macos-deployment-target-version-defaults-what-rustc-supports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants