macOS arm64 build breaks when system lp_solve headers or stale qd artifacts exist
Environment
- macOS Apple Silicon (arm64), Homebrew R 4.5, prefix
/opt/homebrew
Problem
R CMD INSTALL . can fail in sequence on Apple Silicon:
- lp_solve header shadowing:
/opt/homebrew/include/lp_types.h is found before the vendored headers, so LPSREAL is missing (e.g., in lp_MDO.c).
- x86 intrinsics on ARM:
external/PackedCSparse/FloatArray.h pulls in <immintrin.h> on ARM, which breaks compilation.
- wrong-arch qd archive: an old
external/PackedCSparse/qd/libqd.a (e.g., built under x86_64/Rosetta) can be reused and cause link architecture mismatches.
Expected
R CMD INSTALL . should succeed on arm64 even if a system lp_solve is installed and/or the tree was previously built under another architecture.
Repro
macOS arm64 build breaks when system lp_solve headers or stale qd artifacts exist
Environment
/opt/homebrewProblem
R CMD INSTALL .can fail in sequence on Apple Silicon:/opt/homebrew/include/lp_types.his found before the vendored headers, soLPSREALis missing (e.g., inlp_MDO.c).external/PackedCSparse/FloatArray.hpulls in<immintrin.h>on ARM, which breaks compilation.external/PackedCSparse/qd/libqd.a(e.g., built under x86_64/Rosetta) can be reused and cause link architecture mismatches.Expected
R CMD INSTALL .should succeed on arm64 even if a systemlp_solveis installed and/or the tree was previously built under another architecture.Repro
R CMD INSTALL .