-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
BLD: Avoid "visibility attribute not supported" warning #16288
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: Avoid "visibility attribute not supported" warning #16288
Conversation
08713c6
to
7f7d19d
Compare
Now getting errors like
I was getting this locally as well but it wasn't clear at first that this was related. Seems maybe it is. |
Oh, I made a stupid bug in this commit. Rebasing again... |
numpy/distutils/command/autodist.py
Outdated
@@ -69,7 +69,10 @@ def check_gcc_function_attribute(cmd, attribute, name): | |||
#pragma GCC diagnostic error "-Wattributes" | |||
#pragma clang diagnostic error "-Wattributes" | |||
|
|||
int %s %s(void*); | |||
int %s %s(void*) |
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.
FWIW I am not able to reproduce this on 7.3.0 or gcc-9 versions. but if this function is not behaving as its supposed to for certain compiler versions, its certainly worth fixing.
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.
that's odd, This build error was perfectly reproducible on bionic with gcc-7.5 and gcc-9.2.
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.
@r-devulap , not sure whats going on. my gcc version for gcc-9 is gcc 9.3.0
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.
I was going to say, it could be Windows-specific. But maybe not.
The change looks simple, but there are universal test failures along the lines of. @r-devulap since those failures are AVX related, a ping just in case you know right away what the cause is.
```
numpy/core/src/umath/simd.inc.src: In function ‘fma_scalef_ps’:
4221 numpy/core/src/umath/simd.inc.src:1519:1: warning: AVX vector return without AVX enabled changes the ABI [-Wpsabi]
4222 {
4223 ^
4224 numpy/core/src/umath/simd.inc.src:1518:1: note: The ABI for passing parameters with 32-byte alignment has changed in GCC 4.6
4225 fma_scalef_ps(__m256 poly, __m256 quadrant)
4226 ^~~~~~~~~~~~~
4227 In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h:41:0,
4228 from numpy/core/src/umath/simd.inc.src:25,
4229 from numpy/core/src/umath/loops.c.src:50:
4230 /usr/lib/gcc/x86_64-linux-gnu/7/include/avxintrin.h:1195:1: error: inlining failed in call to always_inline ‘_mm256_movemask_ps’: target specific option mismatch
4231 _mm256_movemask_ps (__m256 __A)
4232 ^~~~~~~~~~~~~~~~~~
4233 In file included from numpy/core/src/umath/loops.c.src:50:0:
4234 numpy/core/src/umath/simd.inc.src:1533:10: note: called from here
4235 if (_mm256_movemask_ps(denormal_mask) != 0x0000) {
4236 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4237 In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h:41:0,
4238 from numpy/core/src/umath/simd.inc.src:25,
4239 from numpy/core/src/umath/loops.c.src:50:
4240 /usr/lib/gcc/x86_64-linux-gnu/7/include/avxintrin.h:404:1: error: inlining failed in call to always_inline ‘_mm256_cmp_ps’: target specific option mismatch
4241
```
|
You cannot omit parameters names in function definitions in C. This will fix your problem:
|
Thanks, shoudl have seen, I guess @embray actually may just have forgotten to push the rebase... |
That's possible. When I said I was rebasing it was to fix the missing parameter name. Previously I had done it properly and it worked, so I think I accidently pushed an older version. I'll fix it in a sec. One thing I was kinda wondering is if there was a specific reason this test function even needed to take a dummy parameter in the first place. I couldn't find any reference in the commit history as to why that was needed for this test function. I did also find it odd that my GCC would ignore the unknown attribute on a bare declaration, but not in a function definition. I don't know if that's intentional or a GCC bug, but I couldn't find any reference to that either. I guess it doesn't bother processing the attributes unless there's an actual code module to compile. |
And yes, because of the missing parameter it means all attribute tests fail, and I think that was causing the AVX-related bugs. They go away when I fix it (instead I get #16290, but that's unrelated). |
Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 5.12.0 to 5.14.0. - [Release notes](https://github.com/HypothesisWorks/hypothesis/releases) - [Commits](HypothesisWorks/hypothesis@hypothesis-python-5.12.0...hypothesis-python-5.14.0) Signed-off-by: dependabot-preview[bot] <[email protected]>
on systems that do not support symbol visibility attributes
7f7d19d
to
4ca7de9
Compare
Weird that it shows that dependabot commit, nvm will just squash merge though. I am going to put this in, looks like it just cannot hurt to me. Thanks @embray! |
@seberg Thanks! |
I found that when building the latest master branch on Cygwin, while testing numpy#16246, that thousands of warnings were generated at build time like: numpy/core/src/npysort/binsearch.c.src: In function ‘binsearch_left_bool’: numpy/core/src/npysort/binsearch.c.src:82:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes] Granted this is just a warning, so I don't think it's a serious issue. It seems the test that was supposed to check for __attribute__ support was not working as expected. The #pragmas only take effect if I provide a function body--they are ignored for bare declarations. I don't know if that's by intent, or if it's a GCC issue. For reference: $ gcc --version gcc (GCC) 7.4.0
I found that when building the latest
master
branch on Cygwin, while testing #16246, that thousands of warnings were generated at build time like:Granted this is just a warning, so I don't think it's a serious issue.
It seems the test that was supposed to check for
__attribute__
support was not working as expected. The#pragma
s only take effect if I provide a function body--they are ignored for bare declarations. I don't know if that's by intent, or if it's a GCC issue. For reference: