fix: compilation and build for mac and amd architectures#658
Open
faraasat wants to merge 3 commits intoqubic:mainfrom
Open
fix: compilation and build for mac and amd architectures#658faraasat wants to merge 3 commits intoqubic:mainfrom
faraasat wants to merge 3 commits intoqubic:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses compilation and build failures on Mac M1+ and ARM architectures by conditionally compiling x86-specific code and compiler flags only when targeting x86_64 platforms.
Key Changes:
- Added architecture detection guards (
CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64") to conditionally include x86-specific compiler flags (-mrdrnd, -mavx, AVX-512) and test sources - Updated intrinsics header to only include x86 intrinsic headers on x86 platforms
- Added
build/directory to .gitignore
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/CMakeLists.txt | Conditionally includes x86-specific test sources (m256.cpp, network_messages.cpp) and -mrdrnd flag only for x86_64 builds |
| src/CMakeLists.txt | Splits Clang compiler options into x86-specific and generic branches, removing -mrdrnd and -target flags for non-x86 platforms |
| lib/platform_common/qintrin.h | Guards x86 intrinsic header inclusion with preprocessor checks for x86 architectures |
| cmake/CompilerSetup.cmake | Conditionally sets AVX/AVX-512 instruction flags and -mrdrnd test flag only for x86_64 architectures |
| .gitignore | Adds build directory to ignore list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.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.
This fixes the build and compilation issues in Mac M1 onwards and for Arm Architecture as described in the issue #649 .