-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[aot] Support multi-target builds for Apple M1 #6083
[aot] Support multi-target builds for Apple M1 #6083
Conversation
✅ Deploy Preview for docsite-preview ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
What about MoltenVK? Do we need to start building and linking to it statically? |
@bobcao3 MoltenVK in VulkanSDK is already multitargeting. |
What about the version from homebrew, which is the one we are using? |
97e7e5c
to
936a2f6
Compare
for more information, see https://pre-commit.ci
Ah, yes. Homebrew serves on a per-arch basis, and our test runs install MoltenVK from homebrew. It could be an issue if someone installed homebrew molten-vk and a x86_64 Anaconda 3 (like me). We can resolve this issue in a future PR I think. And we can then get rid of the annoying |
Currently we ship a molten dylib, so it will not work |
Shouldn't be a problem atm? As mentioned before the Python wheels are built per-arch so it won't break the existing release pipeline (as the tests do). The multi-target lib can only be built if the user explicitly specify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This PR enables Taichi to be built into multi-target libraries. Recent releases of macOS supports dynamically linking against x86_64 or arm64 of the same
.dylib
on demand, depending on the arch of the parent process. Previously this was not possible because the CMake script forced a-march=nehalem
that is not a kind of arm64; andCMAKE_OSX_ARCHITECTURES
is forcedarm64
.The multi-target feature is only enabled with
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
. Python builds will select one of the archs, based on the arch of the skbuild Python process.