Skip to content

Fix power8/power9 build issues#155

Merged
rgommers merged 2 commits into
explosion:mainfrom
rgommers:fix-powerpc-builds
May 14, 2026
Merged

Fix power8/power9 build issues#155
rgommers merged 2 commits into
explosion:mainfrom
rgommers:fix-powerpc-builds

Conversation

@rgommers
Copy link
Copy Markdown
Contributor

Two fixes:

  1. Fix ppc64le arch detection: only use power9 target on Power9+ CPUs

    Previously all ppc64le machines were mapped to the power9 target, which
    uses -mcpu=power9 flags that generate instructions unavailable on older
    CPUs like Power8, causing segfaults at runtime. Now parse /proc/cpuinfo
    to detect the actual CPU generation and use generic if POWER8 is
    found. If not, we default to power9 for Power9/10/11 machines, and
    this will also be the default in corner cases where detection fails
    (e.g., building under QEMU).

    Closes python core dump on Power8 #96

  2. Fix ppc64le builds: replace hardcoded gcc path with portable "gcc"

    The linux-power9.jsonl file contained a hardcoded absolute path to gcc
    from the HPC cluster where it was generated, breaking builds on any
    other ppc64le system. Replace with "gcc" to match all other architectures.

    Closes linux-power9.jsonl contains hardcoded absolute compiler path that breaks builds on other ppc64le #151

The fix for (2) I made by hand and verified with Claude (Opus 4.6). The fix for (1) I developed with Claude.

I then tested this under QEMU on my fork (see this CI log) to build some more confidence that the ppc64le builds will actually work after these changes. That job took an hour, which seems a bit long to add to this repo. Most of that is building numpy from source.

rgommers and others added 2 commits March 31, 2026 17:44
The linux-power9.jsonl file contained a hardcoded absolute path to gcc
from the HPC cluster where it was generated, breaking builds on any
other ppc64le system. Replace with "gcc" to match all other architectures.

Closes explosiongh-151

Changes made by hand, and verified with Claude Opus 4.6
Previously all ppc64le machines were mapped to the power9 target, which
uses -mcpu=power9 flags that generate instructions unavailable on older
CPUs like Power8, causing segfaults at runtime. Now parse /proc/cpuinfo
to detect the actual CPU generation and use `generic` if POWER8 is
found. If not, we default to `power9` for Power9/10/11 machines, and
this will also be the default in corner cases where detection fails
(e.g., building under QEMU).

Closes explosiongh-96

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rgommers
Copy link
Copy Markdown
Contributor Author

This should be a straightforward fix and CI is green, so I'll put this in.

@rgommers rgommers merged commit 9723d91 into explosion:main May 14, 2026
152 of 157 checks passed
@rgommers rgommers deleted the fix-powerpc-builds branch May 14, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linux-power9.jsonl contains hardcoded absolute compiler path that breaks builds on other ppc64le python core dump on Power8

1 participant