Skip to content

Add ARM64 (Apple Silicon) build support with auto-detection#303

Open
seabornlee wants to merge 1 commit intoopennars:masterfrom
seabornlee:arm64-build-fix
Open

Add ARM64 (Apple Silicon) build support with auto-detection#303
seabornlee wants to merge 1 commit intoopennars:masterfrom
seabornlee:arm64-build-fix

Conversation

@seabornlee
Copy link
Copy Markdown

Summary

This PR adds automatic architecture detection to build.sh to support Apple Silicon (ARM64) Macs alongside existing x86_64 builds.

Changes

  • Detect system architecture using uname -m
  • Skip SSE2 flags on ARM64
  • Include RuleTable.c in Stage 2 compilation for both architectures
  • Add fallback compilation without SSE flags

Problem

Current build.sh uses SSE2 instructions not available on Apple Silicon (ARM64), causing compilation failures on M1/M2/M3 Macs.

Testing

  • Built successfully on ARM64 (Apple Silicon)
  • NARS inference verified working

- Detect architecture using uname -m
- Skip SSE2 flags on ARM64
- Include RuleTable.c in Stage 2 for both architectures
- Fallback compilation without SSE flags if initial compilation fails

Fixes: ARM64 build failure due to SSE2 instructions not available on Apple Silicon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant