Only force -arch x86_64 on Intel macOS - #694
Merged
joellembatchou merged 1 commit intoSep 8, 2026
Merged
Conversation
The external_libs Makefiles append `-arch x86_64` on any Darwin host. On
Apple Silicon this cross-compiles the helper libraries for the wrong
architecture, and the final link fails:
ld: warning: ignoring file external_libs/qf/qf.a, building for
macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64: "_qf", referenced from:
get_davies_pv(...) in SKAT.cpp.o
Guard the flag with `uname -m` so native arm64 builds keep the host
architecture, while Intel macOS builds are unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Sep 8, 2026
Collaborator
|
Good catch thanks! |
Contributor
Author
|
One question while this is open: once it is merged, do you have a rough timeline for the next tagged release? I ask because Homebrew builds from release tarballs rather than from a branch, so the fix only reaches users there when it is in a tag. Until then the formula has to carry the equivalent one-line patch itself, which reviewers understandably ask about: Homebrew/homebrew-core#302933 No pressure on the timing, I just want to know whether to keep the local patch or wait for the tag. |
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.
Fixes #695
Problem
The
external_libsMakefiles append-arch x86_64on any Darwin host:On Apple Silicon the helper libraries are therefore cross-compiled for x86_64 while
src/is compiled for arm64, and the final link fails:This affects
mvtnorm,pgenlib,qf,quadpackandremeta, so an arm64 macOS build of v4.1.3 cannot complete without editing the Makefiles.Fix
Guard the flag with
uname -m. Intel macOS builds are unchanged; arm64 builds now keep the host architecture. The flag is redundant on Intel too (the compiler already targets the host), but keeping it preserves the existing behaviour for anyone relying on it.Testing
macOS 26.6 on arm64 (Apple Silicon), Homebrew clang, gfortran from GCC 15, BGEN v1.1.7:
Step 1 on the bundled example data completes normally:
This came up while packaging regenie for Homebrew, where builds run natively on arm64 runners.
🤖 Generated with Claude Code