macos x64: crossplatform native build#6448
Open
MaxRayskiy wants to merge 3 commits into
Open
Conversation
Alternative to the Rosetta approach: build the Intel target with a NATIVE arm64 toolchain that cross-targets x86_64 (-arch x86_64), linking the x86_64 Homebrew at /usr/local. Compiles run on native arm64 clang (fast); only the output is x86_64. - ConfigureHomebrew.cmake: honor an explicit `-D HOMEBREW_PREFIX=<prefix>` override (falls back to `brew --prefix`), so a native arm64 cmake can be pointed at the /usr/local x86_64 bottles. - build_source.sh: honor a caller-set NPROC to cap build parallelism. - macos/crossplatform-builds/README.md: documents the recipe, the critical gotchas (must force CMAKE_MAKE_PROGRAM to the arm64 ninja, else CMake's find_program grabs the x86_64 ninja from /usr/local and silently compiles under Rosetta; CMAKE_PREFIX_PATH=/usr/local for find_package; x86_64 python shim), and a native-vs-Rosetta comparison. Validated on an Apple M4: native arm64 clang (Code Type: ARM64) cross-built MeshLib core to x86_64; all binaries x86_64, linked against /usr/local x86_64 dylibs; 294/294 unit tests pass under Rosetta. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Idempotent provisioning for the NATIVE (non-Rosetta) x86_64 cross build:
1. native arm64 cmake + ninja at /opt/homebrew (the build driver; installs
only if missing, no force-upgrade)
2. Rosetta 2 (only to RUN the x86_64 output + CMake configure probes; the
compilation itself is native)
3. x86_64 Homebrew at /usr/local (source of x86_64 bottles); --prewarm to
install the formulae now, else CI installs them.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.