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 PR removes the following global compiler flags from the CMake configuration:
These flags were originally introduced in [#598](#598) to enable high-performance execution of the SVS dependency by leveraging the build machine's full CPU capabilities.
However, applying
-march=native
and-mtune=native
globally causes several issues:Cross-device compatibility: hese flags enforce optimizations based on the build machine's architecture, making the resulting binaries potentially incompatible with machines of different architectures.
Conflicts with file-specific flags: Some files require specific architecture features. For example, ARM files using intrinsics like
vdotq_s32
are explicitly compiled with-march=armv8.2-a+dotprod.
Despite this, the presence of-mtune=native
breaks the build. Removing it resolves the issue. This may be a bug in how GCC chains-mtune=native
in combination with specific-march=
overrides, as discussed here https://bugs.gentoo.org/884549.Inconsistent optimization strategy: In
VecSim
, architecture-specific optimizations are selected dynamically at runtime using a dispatcher based on the actual CPU running the binary. This pattern is also being extended for SVS in [intel/SVS PR #113](CPUArch dispatching and unified shared library intel/ScalableVectorSearch#113).Summary
We are removing
-march=native
and-mtune=native
from the global CMake configuration to:-march
values.This change ensures that: