build: fail early on unsupported (non-ARM64) targets#768
Open
ayaangazali wants to merge 1 commit into
Open
Conversation
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>
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.
Closes #655. Also documents the ARMv8.0 / Raspberry Pi 4 case from #561.
Problem
cactus-kernels/CMakeLists.txtpasses-march=armv8.2-a+fp16+simd+dotprod+i8mmunconditionally, with no architecture guard, and every kernel#include <arm_neon.h>. On x86 toolchains this fails deep in the build with the cryptic:(reported on WSL2/x86_64 in #655), and on ARMv8.0 CPUs such as the Raspberry Pi 4 the binary compiles but hits
Illegal instructionat runtime (#561), because the engine is ARM64 v8.2+ by design.Change
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/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 buildon 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.halready hascpu_has_i8mm()as a starting point.