-
-
Notifications
You must be signed in to change notification settings - Fork 11k
MAINT: only add --std=c99 where needed #15238
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
Conversation
I'm not sure that is a robust way to do compiler detection, since I'm not sure the platform module and distutils agree. I'd suggest instead to do in the top-level
to override just the compiler flags used when building the extensions. This is what @peterbell10 did for Scipy, and I guess it should also work here. The design of distutils is again a problem here that makes solutions hacky. |
The CI run with gcc 4.8 agrees that it is not enough to add the flag for pocketfft and random, we need it for all c-extensions. |
Turns out we need to override both |
the build with gcc 4.8 passes. |
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.
Will this correctly apply the flag for the configtest stuff too? |
def _is_using_gcc(obj): | ||
is_gcc = False | ||
if obj.compiler.compiler_type == 'unix': | ||
cc = sysconfig.get_config_var("CC") |
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.
Shouldn't we be looking at obj.compiler
to learn this, rather than global state that may not be equivalent?
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.
Distutils itself does it like this (grep for is_gcc). But I'm not sure if there is some reason why, as indeed the compiler object already knows its command line.
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.
once burned twice shy: I prefer to mimic distutils as far as possible
It won't apply to configtest I think, as that's done by an earlier config command, but not sure if the flag is necessary there. Might also be possible to override the |
Thanks Matti. I don't think the config tests need the flag, but it may be worth tracking down the call in case that changes in the future. |
Revert gh-15194, redo gh-14471
We really only needAdd the flag via--std=c99
for pocketfft compilation, so do not add it unilaterally.setup.py
. As pointed out in scipy/scipy#11270, this also turns on different floating point excess precision handling on 387 FPU.