Skip to content

build: Make USE_PORTABLE_SIMD build baseline binaries - #492

Open
Xeonacid wants to merge 1 commit into
spotify:masterfrom
Xeonacid:portable-simd-no-arch-flags
Open

build: Make USE_PORTABLE_SIMD build baseline binaries#492
Xeonacid wants to merge 1 commit into
spotify:masterfrom
Xeonacid:portable-simd-no-arch-flags

Conversation

@Xeonacid

@Xeonacid Xeonacid commented Jul 2, 2026

Copy link
Copy Markdown

Problem

USE_PORTABLE_SIMD is currently not truly portable. On x86 it replaces -march=native with -mavx, while both build systems still define HAVE_AVX and compile FFTW's AVX codelets. Wheels or distro packages built that way can run AVX instructions on older CPUs and fail with Illegal instruction. ARM builds have the same generic distribution concern when HAVE_NEON is enabled.

Solution

Keep the optimized local-build behavior by default. When USE_PORTABLE_SIMD is set, stop passing -mavx, -march=native, and the AVX/NEON feature macros. Also filter AVX, SSE, and NEON FFTW SIMD sources from the CMake and legacy setup.py build paths.

Result

USE_PORTABLE_SIMD now produces a baseline binary suitable for distro packaging and CI distribution. Future work can add runtime SIMD feature detection and select AVX or NEON implementations only when the running CPU supports them.

Problem

USE_PORTABLE_SIMD is currently not truly portable. On x86 it replaces -march=native with -mavx, while both build systems still define HAVE_AVX and compile FFTW's AVX codelets. Wheels or distro packages built that way can run AVX instructions on older CPUs and fail with Illegal instruction. ARM builds have the same generic distribution concern when HAVE_NEON is enabled.

Solution

Keep the optimized local-build behavior by default. When USE_PORTABLE_SIMD is set, stop passing -mavx, -march=native, and the AVX/NEON feature macros. Also filter AVX, SSE, and NEON FFTW SIMD sources from the CMake and legacy setup.py build paths.

Result

USE_PORTABLE_SIMD now produces a baseline binary suitable for distro packaging and CI distribution. Future work can add runtime SIMD feature detection and select AVX or NEON implementations only when the running CPU supports them.
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.

1 participant