New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Properly support FreeBSD/powerpc64 #22777
Conversation
pkubaj
commented
Dec 12, 2022
- FreeBSD sets machine name (uname -m) differently than Linux and instead uses uname -p for actual architecture name, but this is not present in uname() function. Check just for powerpc or ppc and compiler macros instead.
- FreeBSD uses elf_aux_info instead of getauxval.
Looks like a couple of tests need fixing and/or the detection can be made backwards compatible. |
Can you point me to what's actually wrong? I'm quite puzzled right now. |
You can find the log by clicking on the details. For the smoke test it is at https://github.com/numpy/numpy/actions/runs/3678279521/jobs/6221343413, and the error is
|
I added a commit that works around the test failures. |
I had some issues again with architecture detection so I added '.*' around 'powerpc'. I'd rather prefer just '.powerpc.', since it would be much simpler, but it somehow doesn't work with tests. Summary after compilation:
|
The fake compiler within distutils tests counts on (ppc64|ppc64le) to differentiate between big|little endian, also it is necessary for Linux. The term |
I know Linux uses ppc64 / ppc64le names. I just didn't know the test suite relied on them. If it didn't, checking just for ppc* and then correct compiler macros would be also ok. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thank you. The following suggestions aren't necessary but still great to have them.
1. FreeBSD uses elf_aux_info() instead of getauxval. 2. Switch to using compiler macros for detecting POWER platform FreeBSD sets the machine name (what uname -m prints) on all powerpc* to just powerpc. To identify actual architecture, uname -p should be used, but this is not present in uname() function. Thus, the only way to correctly detect platform is to use what uname prints and also check compiler defines.
Thank you @pkubaj. |
Hi-five on merging your first pull request to NumPy, @pkubaj! We hope you stick around! Your choices aren’t limited to writing code – you can review pull requests, help us stay on top of new and old issues, develop educational material, work on our website, add or improve graphic design, create marketing materials, translate website content, write grant proposals, and help with other fundraising initiatives. For more info, check out: https://numpy.org/contribute |