Skip to content

fix: support linux/arm64 builds - #1090

Merged
mhucka merged 3 commits into
quantumlib:mainfrom
Cynocracy:arm-detection-fixes
Aug 14, 2026
Merged

fix: support linux/arm64 builds#1090
mhucka merged 3 commits into
quantumlib:mainfrom
Cynocracy:arm-detection-fixes

Conversation

@Cynocracy

Copy link
Copy Markdown
Contributor

The previous directives supported macos arm but did not correctly trigger off of macosx, this applies the same codepaths for linux arm, supporting them natively.

@github-actions github-actions Bot added the size: S 10< lines changed <50 label Jul 6, 2026
@Cynocracy
Cynocracy marked this pull request as ready for review July 6, 2026 16:51

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request restricts the compilation of x86-specific SIMD pybind modules (SSE, AVX2, AVX512) to x86 architectures in CMakeLists.txt and updates the instruction detection preprocessor checks in decide.cpp. Feedback on the changes points out that the updated preprocessor check using defined(_WIN32) will incorrectly evaluate to true on Windows ARM64, where the x86-specific cpuid intrinsic is unsupported, and suggests restricting the Windows check to x86/x64 architectures to prevent compilation failures.

Comment thread pybind_interface/decide/decide.cpp Outdated
@Cynocracy

Copy link
Copy Markdown
Contributor Author

I /think/ the failures are unrelated to the changes I've made here, but let me know if they should be looked into 🫡

For context this change is useful for me to be able to support multi-arch docker images for qsim across arm/amd, the support for macos seems to prove out that the CPU is OK, this resulted from me looking into what would be needed to close the gap. No urgency on my part so if there are requested changes/improvements I'm all ears!

@Cynocracy

Copy link
Copy Markdown
Contributor Author

@mhucka does this change make sense to you? It would help my container using mac colleagues greatly so I'd love to see it included, happy to iterate however makes sense :)

The previous directives supported macos arm but did not correctly trigger off of macosx, this applies the same codepaths for linux arm, supporting them natively.
@Cynocracy
Cynocracy force-pushed the arm-detection-fixes branch from a52aed3 to 343feee Compare August 5, 2026 02:29
@mhucka

mhucka commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

@Cynocracy Thank you for this work, and sorry for the late reply. Yes, that failure on Windows is something new that's showing up in other CI failures. Something in the GitHub Windows environment (or maybe a third-party dependency brought in by qsim) must have changed. I need to dig in and fix the root cause.

@Cynocracy

Copy link
Copy Markdown
Contributor Author

No worries at all! Thanks for letting me know :) If I can be of assistance, happy to take a stab at debugging.

@mhucka mhucka left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A trivial change suggestion; otherwise, looking good.

Comment thread CMakeLists.txt Outdated
@mhucka

mhucka commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

No worries at all! Thanks for letting me know :) If I can be of assistance, happy to take a stab at debugging.

The CI failure on Windows should be fixed now with a PR merged today. When you make changes and update the branch on this PR, it should pass.

@github-actions github-actions Bot added size: XS <10 lines changed and removed size: S 10< lines changed <50 labels Aug 14, 2026

@mhucka mhucka left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for your work on this!

@mhucka
mhucka enabled auto-merge August 14, 2026 20:32
@mhucka
mhucka added this pull request to the merge queue Aug 14, 2026
Merged via the queue into quantumlib:main with commit b8302c5 Aug 14, 2026
33 checks passed
@Cynocracy

Copy link
Copy Markdown
Contributor Author

Thank you for the reviews and feedback! :) Excited to try this change out

@mhucka

mhucka commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

If you have access to AMD hardware and have additional improvements for qsim, we'd be happy to take them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: XS <10 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants