BUG: ppc64le: define NPY_HAVE_VSX when only higher VSX levels are enabled#31595
Open
supr wants to merge 1 commit into
Open
BUG: ppc64le: define NPY_HAVE_VSX when only higher VSX levels are enabled#31595supr wants to merge 1 commit into
supr wants to merge 1 commit into
Conversation
…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.
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.
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.