Skip to content

R CMD INSTALL fails on Apple Silicon due to lp_solve headers and x86- only intrinsics #35

Description

@Mohit-Lakra

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:

  1. 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).
  2. x86 intrinsics on ARM: external/PackedCSparse/FloatArray.h pulls in <immintrin.h> on ARM, which breaks compilation.
  3. 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

R CMD INSTALL .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions