Skip to content

BUG: ppc64le: define NPY_HAVE_VSX when only higher VSX levels are enabled#31595

Open
supr wants to merge 1 commit into
numpy:mainfrom
supr:fix-ppc64le-vsx-dispatch
Open

BUG: ppc64le: define NPY_HAVE_VSX when only higher VSX levels are enabled#31595
supr wants to merge 1 commit into
numpy:mainfrom
supr:fix-ppc64le-vsx-dispatch

Conversation

@supr

@supr supr commented Jun 10, 2026

Copy link
Copy Markdown

Fixes: #31593

PR summary

This PR is for enabling HAVE_VSX flag when either HAVE_VSX2, HAVE_VSX3 or HAVE_VSX4 flags are enabled,

First time committer introduction

I am a first time contributor to this repository. I do not use NumPy directly. I use nix for package management on Fedora ppc64le, which brought in numpy dependency as part of its functional tests, which uses mercurial as a test fixture, which depends on python environment that included numpy. With this fix, i am able to bootstrap nix environment for ppc64le linux. Which is a tier-2 platform for Nix.

AI Disclosure

Claude was used to draft the language inside the PR. As i am a non native English speaker.

…bled

On ppc64le, building with -Dcpu-baseline=none fails to compile: the VSX
dispatch-target sources hit "implicit declaration of function
vec_load_len" (an s390x/VX intrinsic) plus a cascade of undeclared vec_*
errors, because <altivec.h> is never included.

NPY_HAVE_VSX is used throughout the Power SIMD headers as the generic
"any VSX" flag: it gates the <altivec.h> include in main_config.h.in and
selects the Power (vs s390x/VX) code path in simd/vec/*.h. VSX2/VSX3/VSX4
all imply VSX. But with an empty baseline these levels are enabled only as
dispatch targets, each compiled in isolation with just its own
NPY_HAVE_VSX{2,3,4} macro and not the implied NPY_HAVE_VSX, so the VX
branch is wrongly taken. Default CI does not hit this because the standard
ppc64le baseline is VSX2, which defines NPY_HAVE_VSX project-wide.

Normalize the flag: define NPY_HAVE_VSX whenever any higher VSX level is
defined, before the <altivec.h> include and the SIMD headers consume it.
The guard is self-gating and a no-op on non-Power targets and on builds
that already define NPY_HAVE_VSX.
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.

BUG: ppc64le build fails with cpu-baseline=none - VSX dispatch targets miss NPY_HAVE_VSX (vec_load_len implicit declaration)

1 participant