-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
TST: Update runtests.py to specify C99 for gcc. #12610
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
Prefix `-std=c99` to the CFLAGS environmental variable. C99 is the standard for NumPy >= 1.17.
I'm just going to put this in as it is needed for #11888. |
@charris this flag shouldn't be added here I think. If it's needed then it's needed also when compiling without |
It is needed because |
It may be that it isn't required after removing the |
I do wonder whether removing this for 1.17 is worth the extra pain it will incur for 1.16.x backports. Do we have any kind of strategy for what we should do now and what we should save for 1.18? |
this is different than adding |
Note that runtest prepends to CFLAGS, so I also wanted to keep C99 first in the list so it could be overridden by those flags. |
That seems reasonable, although it needs to be compiler dependent. |
Note that the option of a c99 ccompiler in distutils was overridden. |
So, thoughts on how to put it into the setup file? I think we would need to use distutils for that or put it into the environment, and the latter would make it last in the flags used by runtest unless we check for it and change the order. |
That is a potential problem, but it is definitely needed for pocketfft. I think we can live with it. I don't expect to backport anything both new and big and runtest is branch specific. |
What do you mean by this? I only see
If we put it in |
I mean that I raised the possibility of a c99 distutils compiler on the list (or maybe an earlier PR) and it wasn't popular. I was thinking of the c99 compiler that is standard on Unix systems.
On my system, all that file does is prepend the |
Right, but bug fixes might be written using unnecessary c99 features, which will fail CI when backported. As long as backporters are happy to pay the cost of occasionally moving some variable declarations after a failed CI, that's not a problem. |
that seems fine/reasonable to me.
Ah okay, that vaguely rings a bell. I don't really think that's warranted or necessary for adding a single flag. Besides, since it's not actually a separate compiler it is not something that's easy to auto-detect. I'll try to come up with a simple patch for this. |
For reference, here is the failing 32-bit Linux CI run: https://dev.azure.com/numpy/numpy/_build/results?buildId=1373. It wasn't immediately clear to me why that one failed with a bunch of errors like:
but all other builds succeeded.It turns out that from gcc 5.1 onwards, the default C mode is
So changing this in It's a bit odd that EDIT: misread the Ubuntu package page, the default is gcc 4.5 with gcc 5.3 being an alternative available as the |
See numpygh-12610 for details.
Hi. This might have broken a Travis CI job over at Astropy, which tests against development version of Numpy (see astropy/astropy#8318). The Travis CI log is https://travis-ci.org/astropy/astropy/jobs/475320252 . I also opened an issue about it over at conda/conda#8058 . Any advice would be greatly appreciated. Thanks! |
@pllim Yes, NumPy 1.17 built with gcc requires C99 for the loop variable declarations. Should be an easy fix on the astropy end. You will also need Python > 3.4 on Windows. Why are you building your own NumPy? There are nightly builds of NumPy wheels, admittedly not always successful :) |
@rgommers You have convinced me that it probably better to add |
CIs of other packages, which we encouraged to test against NumPy master, will all be broken now. So that's an argument for fixing it within the numpy build. I'll see what I can do this weekend. |
Thank you all for the quick response! I am looking forward to a solution.
I am not sure. I tried to
Indeed, @bsipocz had the same idea as you to use nightly wheels for Astropy's CI against development version of Numpy. Perhaps she had done it, even, and I simply did not realize. I could not find the PR over at |
We talked about in December and I haven't got to it yet since, but it's on the list of to-be-dones somewhere. Building numpy from source wasn't painful enough to require an emergency fix 😅 |
There isn't a need to change the AstroPy build. The CI script simply has to pass |
Ah, thank you, @rgommers ! I was indeed looking at the wrong place. 😅 |
Tried the suggestion at astropy/ci-helpers#368 but it does not work. Let's move the discussion there. |
That was a braindead suggestion, sorry. I'll comment here in case other people look for the solution here. In the TravisCI script, use:
on the line above where you install numpy. |
Yes, I can confirm that #12610 (comment) works. Thank you so much for your quick responses and over the weekend no less. Thank you!!! |
Follow up to numpygh-12610.
See numpygh-12610 for details.
Prefix
-std=c99
to the CFLAGS environmental variable. C99 is thestandard for NumPy >= 1.17.