8000 ENH: Improve clang-cl compliance by bashtage · Pull Request #24162 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Improve clang-cl compliance #24162

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

Merged
merged 4 commits into from
Jul 13, 2023
Merged

ENH: Improve clang-cl compliance #24162

merged 4 commits into from
Jul 13, 2023

Conversation

bashtage
Copy link
Contributor

Avoid unnecessary MSVC path when using clang-cl

This patch lets NumPy 2.0.0-dev compile using clang-cl on Windows.

Avoid unnecessary MSVC path when using clang-cl
@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Jul 11, 2023
@bashtage
Copy link
Contributor Author

There are 4 test failures

FAILED ..\build-install\Lib\site-packages\numpy\core\tests\test_einsum.py::TestEinsum::test_einsum_sums_int8
FAILED ..\build-install\Lib\site-packages\numpy\core\tests\test_einsum.py::TestEinsum::test_einsum_sums_uint8
FAILED ..\build-install\Lib\site-packages\numpy\core\tests\test_scalarmath.py::TestBitShifts::test_shift_all_bits[<<-l]
FAILED ..\build-install\Lib\site-packages\numpy\core\tests\test_scalarmath.py::TestBitShifts::test_shift_all_bits[<<-L]

@mattip
Copy link
Member
mattip commented Jul 11, 2023

Thanks for reviving clang-cl compliance.

The einsum tests seem sensitive to SIMD semantics, and were xfailed on macos with the move to meson. I don't remember seeing the shift_all_bits tests fail before.

@bashtage bashtage force-pushed the clang-cl-meson branch 2 times, most recently from fe5fdcf to 124e8fc Compare July 12, 2023 07:34
@bashtage
Copy link
Contributor Author

Any idea why np.show_config is platform dependent? When I ran it on Cygwin it said the keyword mode was not available. I don't see anything in __config__.py.in that would make this happen.

@rgommers
Copy link
Member

The mode keyword is new, so perhaps there was a version mixup somehow?

Copy link
Member
@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all LGTM now, thanks @bashtage.

For the new CI job, onfigure output is clean:

 C compiler for the host machine: clang-cl (clang-cl 16.0.6)
C linker for the host machine: lld-link lld-link 16.0.6
C++ compiler for the host machine: clang-cl (clang-cl 16.0.6)
C++ linker for the host machine: lld-link lld-link 16.0.6

The build log is pretty messy, but that's mostly a lot of repeats of:

 In file included from C:\hostedtoolcache\windows\Python\3.11.4\x64\Include\Python.h:86:
C:\hostedtoolcache\windows\Python\3.11.4\x64\Include/cpython/pytime.h(184,12): warning: declaration of 'struct timeval' will not be visible outside of this function [-Wvisibility]
    struct timeval *tv,
           ^
C:\hostedtoolcache\windows\Python\3.11.4\x64\Include/cpython/pytime.h(190,12): warning: declaration of 'struct timeval' will not be visible outside of this function [-Wvisibility]

plus some lapack_lite operator precedence warnings. Nothing that requires addressing now or is specific to clang-cl.

@rgommers rgommers merged commit 6411255 into numpy:main Jul 13, 2023
@rgommers rgommers added this to the 2.0.0 release milestone Jul 13, 2023
@charris charris modified the milestones: 2.0.0 release, 1.26.0 release Jul 13, 2023
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jul 14, 2023
JuliaPoo added a commit to JuliaPoo/numpy that referenced this pull request Jun 5, 2024
This is a follow up of numpy#26602 and numpy#24162 where previously
the test fails on Clang-cl. I've tried a few CI runs on my
fork and it seems the test passes now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0