Skip to content

BLD: allow specifying the long double format to avoid the runtime check #24414

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

Merged
merged 1 commit into from
Aug 15, 2023

Conversation

FFY00
Copy link
Contributor

@FFY00 FFY00 commented Aug 14, 2023

This builds towards the goal of being able to cross-build NumPy without requiring code
execution on the target environment, or an emulator thereof.

With this patch, setting the longdouble_format key on properties section of the
Meson cross file, will skip the runtime check.

Example:

[properties]
longdouble_format = 'IEEE_DOUBLE_LE'

It may be possible to rewrite the check to entirely skip the need of running code on the
target at build time, but I haven't looked into that at this point. That would be a possible
future improvement.

@github-actions github-actions bot added the 36 - Build Build related PR label Aug 14, 2023
Signed-off-by: Filipe Laíns <lains@riseup.net>
@FFY00 FFY00 force-pushed the no-runtime-check-for-longdouble_format branch 2 times, most recently from 5ae1828 to 582a402 Compare August 14, 2023 14:57
@rgommers rgommers self-requested a review August 14, 2023 16:33
Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

Thanks @FFY00, this is a useful improvement. CI is happy, so I'll merge this. Once we have Meson-specific build docs, I'll add a note on this in them.

@rgommers rgommers merged commit 8c1a4c2 into numpy:main Aug 15, 2023
@rgommers rgommers added this to the 2.0.0 release milestone Aug 15, 2023
@rgommers
Copy link
Member

To confirm the values for hardcoding when cross-compiling from x86 to 64-bit ARM: IEEE_DOUBLE_LE is the expected format for macOS arm64, for Linux aarch64 I believe it should be IEEE_QUAD_LE.

@h-vetinari
Copy link
Contributor

@rgommers @charris
This patch was necessary to build 1.26 in conda-forge for osx-arm. Perhaps it's worth backporting?

@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Sep 6, 2023
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Sep 7, 2023
@rgommers
Copy link
Member

rgommers commented Sep 7, 2023

Yes definitely, that's a good thing to do. I forgot to mark it for backporting, sorry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants