Skip to content
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

BLD: use -ftrapping-math with Clang on macOS in Meson build #24060

Merged
merged 1 commit into from
Jun 27, 2023

Conversation

rgommers
Copy link
Member

The distutils build also uses this flag, and it avoids some problems with floor_divide and similar functions (xref gh-19479).

For older macOS arm64 Clang versions, the flag does get accepted, but then gets overridden because it's not actually supported - which yields these warnings:

warning: overriding currently unsupported use of floating point exceptions on this target [-Wunsupported-floating-point-opt]

Since they're a little annoying to suppress (at least without completely disabling those warnings, which doesn't seem desirable) and will go away when updating to the latest XCode version, we'll ignore these warnings.

The distutils build also uses this flag, and it avoids some problems
with `floor_divide` and similar functions (xref numpygh-19479).

For older macOS arm64 Clang versions, the flag does get accepted, but then
gets overridden because it's not actually supported - which yields these
warnings:
```
warning: overriding currently unsupported use of floating point exceptions on this target [-Wunsupported-floating-point-opt]
```
Since they're a little annoying to suppress and will go away when updating to
the latest XCode version, we'll ignore these warnings.
@rgommers rgommers added 36 - Build Build related PR Meson Items related to the introduction of Meson as the new build system for NumPy labels Jun 27, 2023
@mattip
Copy link
Member

mattip commented Jun 27, 2023

Do builds on cirrus, github, conda-forge all use XCode 14.3+?

@rgommers
Copy link
Member Author

Do builds on cirrus, github, conda-forge all use XCode 14.3+?

No, but they don't need to, this still works - it's just a build warning. We can suppress them with -Wno-unsupported-floating-point-opt I think, but that will then also potentially suppress other warnings.

Copy link
Member

@seberg seberg left a comment

Choose a reason for hiding this comment

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

Looks like this adopts the status-quo to meson. It would be nice to hide the warnings, but I don't think we should worry about it.

It's great that the new XCode should finally fix the missing option, hopefully we can remove quite a few hacks eventually...

@seberg seberg merged commit 85385d6 into numpy:main Jun 27, 2023
73 checks passed
@rgommers rgommers deleted the clang-floatingpoint-flags branch June 27, 2023 14:09
@rgommers rgommers added this to the 2.0.0 release milestone Jun 27, 2023
@rgommers rgommers added the 09 - Backport-Candidate PRs tagged should be backported label Jun 27, 2023
@charris charris modified the milestones: 2.0.0 release, 1.25.2 release Jul 5, 2023
@charris charris changed the title BLD: use -ftrapping-math with Clang on macOS in Meson build BLD: use -ftrapping-math with Clang on macOS in Meson build Jul 14, 2023
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jul 14, 2023
@charris charris removed this from the 1.25.2 release milestone Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
36 - Build Build related PR Meson Items related to the introduction of Meson as the new build system for NumPy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants