-
-
Notifications
You must be signed in to change notification settings - Fork 11k
BUG: Fixes for building on Cygwin. #18102
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
Leaving it later can lead to some headers getting confused, because they're included with one set of feature flags, but the headers they depend on were included with a different set of feature flags.
…rebase. Cygwin needs each DLL to have a unique address for fork() emulation to work. I'm hoping that calling rebase on a complete list of modules compiled in this session, plus those installed globally, will allow the test suite to get an accurate result for more tests.
… on cygwin. Most likely I should be testing for newlib (the C runtime, roughly takes the place of glibc, I think), not cygwin (the emulation layer on Windows), but I have no idea how to do that from within python. If someone working on embedded systems runs into this issue, this hopefully gives them some idea where to start.
…win. See two commits back for an explanation of why fork() fails on cygwin. Alternately, see the much better explanation at: https://cygwin.com/cygwin-ug-net/highlights.html#ov-hi-process with hints on error messages and workarounds at: https://cygwin.com/faq.html#faq.using.fixing-fork-failures
These changes made some sense when compiling only for cygwin. They do not belong in NumPy master.
I don't know if the list should be the same as one of the Windows lists, or if this should instead be a Newlib list. I know how to make a Cygwin list, so I did that. It didn't always work, though.
The generic "this doesn't work" was confusing people. Specifying what "this" is and what happed works better.
Mark tests suddenly passing, and also document how I expect them to fail.
This was actually making the situation worse, I think because I forgot to include the NumPy dlls themselves. Removing this made for many fewer fork() failures when I tried it. `python3 -m pip show numpy --files | grep dll` will give a list of dlls, with at least a relative path. This can be done in python with subprocess (will require adding pip as a runtime dependency), but I'm not sure that's in scope here.
These should primarily be on test functions.
Unconditional access to np.complex256 triggers an error in test collection on platforms where the dtype does not exist. Find another way to test the dtype for equality.
I changed this for the one test, but forgot to do so for the other. Hopefully this actually fixes the problem.
Presumably whoever wrote this code had reasons for leaving this out, and making a separate class for `gfortran`
Including both 'gfortran' and '/usr/bin/gfortran' should be redundant, and I'm not sure even my platform ever needed this. Remove it.
Short-circuiting is lovely.
Workaround for GCC bug 65782. Fixes numpy issue 14787.
I forgot the function returned bytes, not str. I also accidentally passed an extra argument.
The problem seems to have gone away on 64-bit.
It may be worth broadening the platform list, since I believe the error this tries to fix is in the MS ABI/CRT rather than in the Cygwin runtime.
Allows more precise xfail.
I think these are the tests where the "branch cut code doesn't use sign of zero" became relevant.
This was trying to ensure the definition of symbols that depend on feature macros set in "Python.h". That issue seems to have resolved itself.
I think I saw a test failure because the generated tempfile name contained the string "mkl". I think what the code is trying to do is to change the "[mkl]" section to a "[DEFAULT]" section without changing any of the contents of that section. I think this change should do the trick.
The implementation currently segfaults. I'll report this to the developers soon; hopefully it can be re-enabled soon.
32-bit modfl appears to work fine. Problem exists in Cygwin 3.1.5 to 3.1.7 and should be fixed in 3.2.0.
This reverts commit 6ffbcb2. Replaced by 17548.
This reverts commit d9c21bb. Replaced by numpy#17548.
This reverts commit 92eaff3. Replaced by numpy#17548.
A lot of the fixes look to be disabling tests, which seems not quite right. Ideally the tests would pass without fixing. Its might be that we should just wait for Cygwin to improve or stop supporting it. |
A lot of those The edits to Should I start the PR over? Proposed commit order:
The first two might work better as separate PRs. |
You are in a better position to carry this forward than I am. How would you like to proceed? |
The added compiler flags to avoid a ufunc crash got merged in another PR, and my |
The first two changes in that list aren't really connected to the others, so I should probably separate those into different PRs focused on just those. I'm not sure if the Cygwin-specific changes would be better handled on this PR or as a new PR or what. |
@DWesl I would prefer to close this and deal with new PRs. I want to know what would be most convenient for you. |
The I should probably also figure out why they're segfaulting at some point. |
@seiko2plus or @mattip any advice here on how to debug? |
@DWesl, we use the term
|
python runtests.py -t numpy/core/tests/test_cpu_features.py
Building, see build.log...
Build OK
NumPy version 1.21.0.dev0+393.g0386777c3
NumPy relaxed strides checking option: True
NumPy CPU features: SSE SSE2 SSE3 SSSE3* SSE41* POPCNT* SSE42* AVX* F16C* FMA3* AVX2* AVX512F? AVX512CD? AVX512_KNL? AVX512_KNM? AVX512_SKX? AVX512_CLX? AVX512_CNL? AVX512_ICL?
.ss [100%]
1 passed, 2 skipped in 0.08s
python runtests.py --cpu-dispatch="none" -t numpy/core/tests/test_simd_module.py
Building, see build.log...
... build in progress
Build OK
NumPy version 1.21.0.dev0+393.g0386777c3
NumPy relaxed strides checking option: True
NumPy CPU features: SSE SSE2 SSE3
.........................s.......... [100%]
35 passed, 1 skipped in 0.43s
python runtests.py --cpu-dispatch="none" -t numpy/core/tests/test_simd.py
Building, see build.log...
Build OK
NumPy version 1.21.0.dev0+393.g0386777c3
NumPy relaxed strides checking option: True
NumPy CPU features: SSE SSE2 SSE3
.......................................................................................................................................................................................................... [ 84%]
.................................... [100%]
238 passed in 1.89s
python runtests.py --simd-test="baseline sse41" -t numpy/core/tests/test_simd.py
Building, see build.log...
... build in progress
... build in progress
Build OK
NumPy version 1.21.0.dev0+393.g0386777c3
NumPy relaxed strides checking option: True
NumPy CPU features: SSE SSE2 SSE3 SSSE3* SSE41* POPCNT* SSE42* AVX* F16C* FMA3* AVX2* AVX512F? AVX512CD? AVX512_KNL? AVX512_KNM? AVX512_SKX? AVX512_CLX? AVX512_CNL? AVX512_ICL?
........................................................................ [ 15%]
........................................................................ [ 30%]
........................................................................ [ 45%]
........................................................................ [ 60%]
........................................................................ [ 75%]
........................................................................ [ 90%]
............................................ [100%]
476 passed in 7.31s
$ python runtests.py --simd-test="baseline sse41 sse42 avx avx2 fma" -t numpy/core/tests/test_simd.py
Building, see build.log...
... build in progress
... build in progress
Build OK
NumPy version 1.21.0.dev0+393.g0386777c3
NumPy relaxed strides checking option: True
NumPy CPU features: SSE SSE2 SSE3 SSSE3* SSE41* POPCNT* SSE42* AVX* F16C* FMA3* AVX2* AVX512F? AVX512CD? AVX512_KNL? AVX512_KNM? AVX512_SKX? AVX512_CLX? AVX512_CNL? AVX512_ICL?
........................................................................ [ 15%]
........................................................................ [ 30%]
........................................................................ [ 45%]
........................................................................ [ 60%]
........................................................................ [ 75%]
........................................................................ [ 90%]
............................................ [100%]
476 passed in 7.40s
$ python runtests.py -t numpy/core/tests/test_simd.py
Building, see build.log...
Build OK
NumPy version 1.21.0.dev0+393.g0386777c3
NumPy relaxed strides checking option: True
NumPy CPU features: SSE SSE2 SSE3 SSSE3* SSE41* POPCNT* SSE42* AVX* F16C* FMA3* AVX2* AVX512F? AVX512CD? AVX512_KNL? AVX512_KNM? AVX512_SKX? AVX512_CLX? AVX512_CNL? AVX512_ICL?
........................................................................ [ 15%]
........................................................................ [ 30%]
........................................................................ [ 45%]
........................................................................ [ 60%]
........................................................................ [ 75%]
........................................................................ [ 90%]
............................................ [100%]
476 passed in 3.55s
After following the above steps, I can run the whole testsuite with no segfaults. If I run |
This was suggested by @seiko2plus for debugging a segfault in the tests on Cygwin: numpy#18102 (comment) This test passes on Cygwin, and the whole testsuite has only the failures I expect from running on Cygwin (see numpy#18102 and numpy#16246).
Out of curiosity, should |
I am sure NaN is correct. If an EDIT: I am basing this on the fact that "all NaNs are NaNs" for complex numbers (i.e. inf+nanj should be the same as nan+nanj). If you disregard that, I guess an |
Okay, I recently wrote a C program to check FAILED numpy/core/tests/test_multiarray.py::test_npymath_complex[complex256-inf-nan-npy_cabs-absolute] - AssertionError:
FAILED numpy/core/tests/test_multiarray.py::test_npymath_complex[complex256--inf-nan-npy_cabs-absolute] - AssertionError:
FAILED numpy/core/tests/test_multiarray.py::test_npymath_complex[complex256-nan-inf-npy_cabs-absolute] - AssertionError:
FAILED numpy/core/tests/test_multiarray.py::test_npymath_complex[complex256-nan--inf-npy_cabs-absolute] - AssertionError: with the error: E AssertionError:
E Not equal to tolerance rtol=1e-07, atol=0
E
E x and y nan location mismatch:
E x: array(inf)
E y: array(nan, dtype=float128) I just noticed the dtype for |
I tracked the |
@DWesl Do you want me to keep this up? |
You can close it if you want. I'm running a last round of tests before creating the pull request, to see if any of the failing tests are passing now. |
Actually, it looks like the result should be
And there is also
|
Makes sense, the usual safe bet is to say is to replace NaN with "any possible value". The oddball is just that for complex two values for which |
Annex G of the C standard is also a useful (and more easily available) source of information for these corner cases. For the C11 standard, §G.6p6 has:
while §F.10.4.3p1 has:
|
This was suggested by @seiko2plus for debugging a segfault in the tests on Cygwin: numpy#18102 (comment) This test passes on Cygwin, and the whole testsuite has only the failures I expect from running on Cygwin (see numpy#18102 and numpy#16246).
This was suggested by @seiko2plus for debugging a segfault in the tests on Cygwin: numpy#18102 (comment) This test passes on Cygwin, and the whole testsuite has only the failures I expect from running on Cygwin (see numpy#18102 and numpy#16246).
Rebase of #16246.
Changes needed to get numpy to compile on Cygwin, then a few changes to try to reduce the number of test failures due to extension module overlap, then marking differences I think are due to floating-point implementation or fork() failures.
Someone should probably check whether the list of ignored floating-point failures is reasonable.
Most of those have been around since 1.16 a while back.
Rebased to get all the commits gathered together and on top of master. Should probably all be squashed at some point,
this is for review.
@DWesl ping.