BLD: Verify the ability to compile C++ sources before initiating the build#20354
BLD: Verify the ability to compile C++ sources before initiating the build#20354rgommers merged 2 commits intonumpy:mainfrom
Conversation
|
The one CI failure is: |
|
This seems like a good idea, thanks @seiko2plus! I'll do some local testing. |
|
The debug CI job still trips on the same flag: Looks like the config test attempts to use a C compiler on a |
|
This is a cc1plus warning, so it is a c++ compiler and somehow it is getting a c-only option. NumPy defines the flag twice in the codebase, in The complete snippet |
|
Looking at the other |
|
Okay never mind, removed again. Should test more locally first. |
I have a workaround for this issue lay down in #19753, see: but I don't think it's a good idea. however, manually filtering any invalid c++ flags isn't a better idea too. it seems that I need to move the invalid c++ filter to |
numpy/distutils/ccompiler.py
Outdated
| ignore_c_flags = { | ||
| '-Werror=implicit-function-declaration', '-Wstrict-prototypes' | ||
| } | ||
| if hasattr(self, 'compiler_so'): |
There was a problem hiding this comment.
Just a guess, but the -Werror=implicit-function-declaration flag is present in both self.compiler_so and self.compiler. It's only removed from the former here. Maybe removing it from both is healthy; the code is too much of a spaghetti to be sure that only compiler_so will be used.
There was a problem hiding this comment.
parm need_cxx only used by build_ext and build_clib that's why this filter has never been called, I took my changes back, kept the original one as-is inside compiler_cxx() now we have two C++ filters and we should to put them in one place.
There was a problem hiding this comment.
I suggest just calling customize(need_cxx) inside cxx_compiler() which already clones the compiler instance, and we count only on method cxx_compiler() in the following code and the other one in build_clib to avoid duplicate initializing and unnecessary copying.
numpy/numpy/distutils/command/build_ext.py
Lines 256 to 265 in 20a2a70
Hmm, that's not good. IIRC that must always be done. Or implement |
|
I was mistaken it was actually called |
|
nothing better then the green color :) |
rgommers
left a comment
There was a problem hiding this comment.
Nice workaround, LGTM. Thanks @seiko2plus!
related to #20335