Skip to content

Conversation

kkwli
Copy link

@kkwli kkwli commented Sep 5, 2025

On AIX, cmake's platform.machine() does not return a meaningful string that can be used to determine the architecture. This PR is to add the check of platform.processor() to xfail the test.

@@ -37,7 +38,7 @@ def test_real(self):
i
), f"selectedrealkind({i}): expected {selected_real_kind(i)!r} but got {selectedrealkind(i)!r}"

@pytest.mark.xfail(platform.machine().lower().startswith("ppc"),
@pytest.mark.xfail(IS_PPC,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmake's platform.machine()

What does CMake have to do with NumPy in this context? It is being used to compile CPython somewhere or? I thought CPython was still using an older build system.

Also, if the root of the problem is AIX OS itself, would it make sense to just check for it directly with sys.platform, which works just fine to pick up aix? https://docs.python.org/3/library/sys.html#sys.platform

Can you provide some context--you're working on an AIX machine and this test failed?

Copy link
Author

@kkwli kkwli Sep 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review. My apologies. I meant python's platform.machine(). On my AIX machine, platform.machine() returns 00FA13034C00 which is not useful. Anyway, checking sys.platform == 'aix' or platform.system() == 'AIX' is fine for this purpose.

Can you provide some context--you're working on an AIX machine and this test failed?

Yes, I am working on AIX and trying to use flang in numpy.f2py. On AIX, Fortran's selected_real_kind(32) returns -1. This test is already xfailed for ppc platform.

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.

2 participants