ENH: Add support for building with clang-cl#13816
ENH: Add support for building with clang-cl#13816bashtage wants to merge 21 commits intonumpy:mainfrom
Conversation
|
I think this is useful, I have hopes that clang will eventually give us opensource C and Fortran compilers for windows, especially the latter. |
|
Can you compile cpython with clangcl on windows? I am a bit surprised we need to add our own ClangCL class to distutils. It would indeed be useful to set up a windows CI run under 32-bit and 64-bit for this. |
There is an open ticket with a patch to allow it to build: https://bugs.python.org/issue33351 This said, distutils doesn't support clang-cl any more than distutils supports icc on windows. It is unfortunate that commands like CC={cl|icl|clang-cl} python setup.py develop don't work Windows like that do on Unix. AKAICT this is why NumPy would need to directly support clang-cl (if it is a good idea). |
|
How would this play out for clang on linux, since the new class is windows-specific? |
|
clang on unix is trivial since you can use cc=clang python setup.py install. Windows doesn't honor cc variables. |
|
What is the magical incantation to get runtests.py or setup.py to use clang on windows? |
|
I used the same trick that is used for icc See https://software.intel.com/en-us/articles/numpyscipy-with-intel-mkl |
|
It is likely that I'm not doing it correctly. |
|
|
|
That would probably help. I think clang-cl might still need a few settings since it isn't 100% identical to cl. |
|
@bashtage : I <3 that PR. If you're interested in extra tests, I can launch the full pythran recompilation based on this, we are in great need for such support, and currently rely on a dirty hack for clang-cl support. |
|
I would like to finish this in the next month or so. Needs a good bit of cleaning I think. |
|
Any news on this PR? :) |
|
I hope another ping 4 months later does not constitute bad form. 😉 |
5f1d7dc to
6b0aab5
Compare
|
@mattip I've updated to reflect changes and this is working. I have also improved it. Any idea how I could take this forward? |
ac28f73 to
c79ee85
Compare
|
I think it is there, although ideally it would get a CI run. |
eb7c496 to
d3f06a2
Compare
d3f06a2 to
47c0516
Compare
Add support for clang-cl on Windows
Fix compiler for recent changes in NumPy
Add support for --compiler in run tests
Clarify methods to build or test
Make definition and implementation match exactly for clang-cl compat
Forbid compiling 32 with 64 bit clang-cl and vice versa Link against built-ins on 32-bit platforms Improve formatting and add comments
Correct == incorrectly changed to not in
Co-authored-by: Matti Picus <matti.picus@gmail.com>
Fix for inlining issue Try lld-link
Add optimization Revert changes for warnings awaiting numpy#18432 Small clean up of commented code
_udiv128 is not available in clang-cl Revert change from llabs to labs
Cast to silence warning Fix type in compiler_type check
Remove check which isn't needed when calling setup with arguments in the correct order
47c0516 to
4c31368
Compare
Port over changes needed to compile NumPy using clang-cl from numpy#13816. Desirable to retain these even though distutils is effectively deprecated and so not worth the effort to alter.
4c31368 to
b445c57
Compare
Bug continues on clang-cl
|
Do we wish to continue working on this PR, given numpy.distutils has been officially deprecated? |
|
The PR is eol. I think the good parts all got merged in other PRs. |
|
Let's close this |
Add support for clang-cl on Windows
NumPy builds and passes with clang-cl.
cc @matthew-brett