Skip to content

build: fail early on unsupported (non-ARM64) targets#768

Open
ayaangazali wants to merge 1 commit into
cactus-compute:mainfrom
ayaangazali:fix/unsupported-arch-preflight
Open

build: fail early on unsupported (non-ARM64) targets#768
ayaangazali wants to merge 1 commit into
cactus-compute:mainfrom
ayaangazali:fix/unsupported-arch-preflight

Conversation

@ayaangazali

Copy link
Copy Markdown

Closes #655. Also documents the ARMv8.0 / Raspberry Pi 4 case from #561.

Problem

cactus-kernels/CMakeLists.txt passes -march=armv8.2-a+fp16+simd+dotprod+i8mm unconditionally, with no architecture guard, and every kernel #include <arm_neon.h>. On x86 toolchains this fails deep in the build with the cryptic:

cc1plus: error: bad value armv8.2-a+fp16+simd+dotprod+i8mm for -march= switch

(reported on WSL2/x86_64 in #655), and on ARMv8.0 CPUs such as the Raspberry Pi 4 the binary compiles but hits Illegal instruction at runtime (#561), because the engine is ARM64 v8.2+ by design.

Change

  • CMake guard (cactus-kernels/CMakeLists.txt): abort at configure time on non-AArch64 targets with an actionable message that names the requirement and points to the docs, instead of failing later with an opaque compiler error. No-op on supported targets.
  • Docs (docs/compatibility.md): add a Platform Support matrix (Apple Silicon / ARMv8.2+ Android-Linux supported; ARMv8.0 e.g. Pi 4 and x86 unsupported).

No behavior change on supported platforms; nothing in the build graph changes there.

Verified

  • cmake -S cactus-kernels -B build on Apple Silicon (arm64): configures clean, guard is a no-op.
  • cmake ... -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=x86_64: aborts at configure with the new message (reproduces 'Failed to build cactus library' on WSL2 (x86_64) #655 turning into a clear error).

Scope / follow-up

Kept intentionally small and behavior-preserving. Fully resolving #561 (running on ARMv8.0) needs a runtime CPU-feature check to turn the Pi-4 SIGILL into a clean error, or an ARMv8.0 kernel variant — happy to follow up separately; cactus-kernels/src/threading.h already has cpu_has_i8mm() as a starting point.

The kernels compile with -march=armv8.2-a+fp16+simd+dotprod+i8mm and include
<arm_neon.h>, so x86 builds die with a cryptic "bad value for -march" and
ARMv8.0 CPUs (e.g. Raspberry Pi 4) hit an illegal instruction at runtime. Add a
CMake configure-time guard that aborts on non-AArch64 targets with an actionable
message, and document the supported platforms in docs/compatibility.md.

Closes cactus-compute#655

Signed-off-by: ayaangazali <ayaan.gazly@gmail.com>
Copilot AI review requested due to automatic review settings July 16, 2026 01:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

'Failed to build cactus library' on WSL2 (x86_64)

3 participants