-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
BLD: Check Intel compiler when checking complex types in build #25044
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
base: main
Are you sure you want to change the base?
Conversation
Fixes numpy#25034. use clearer syntax Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
320cea0
to
0ff966e
Compare
Rebased to fix the accidental submodule merge (and squash commits). Since it's a one line change and nobody commented on it, will assume this is a step in the right direction. Thanks @lysnikolaou. |
I'm not sure about this, but I think I can recall EDIT: Yes, |
Argg, sorry... Interesting, but that makes me think that more that switching to C11 requires also changing this here in gh-25072. |
also add 'std=' flags and avoid a '-utf-8' flag by adding '-source-charset'
I added a few more changes, especially the one needed for fast math from this comment in the issue and adding a few more
|
Hmm. it seems |
Yup, that's right. I think |
This is what we want, right?
So `cc.get_id() == 'msvc' or cc.get_id() == 'clang-cl' |
CI is passing |
I don't understand the Intel/fastmath related change well enough to comment on it, but the rest looks good! |
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.
This looks pretty good, thanks Matti and Lysandros. One question in a comment inline. Second question: there are quite a few more __INTEL_COMPILER
usages in the code base, did you audit those, or only changed the 3 in this PR in response to build/test failures?
_intel_c99_flag = cc.get_supported_arguments('/Qstd=c99') | ||
add_project_arguments(_intel_c99_flag, language: 'c') | ||
_intel_c17 = cpp.get_supported_arguments('/Qstd=c++17') | ||
add_project_arguments(_intel_c17, language: 'cpp') |
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.
This whole if
block looks incorrect, because it hardcodes flags that should be set already by the default options higher up. And that may be a problem soon because I already have a PR open to upgrade from C99 to C11. Did you add this to work around a problem with the default flags Meson is adding? If so, let's add a comment and link the upstream issue for it.
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.
This was to solve the same problem as in #25072: hundreds of warnings about needed language standards. I am happy to wait for that PR to land first.
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.
Oh yes, you added the /Qstd=c99
warning higher up. That should already be added, because we have c_std=c99'
in default_options
at the top of meson.build
. If it's indeed not added, can you open a Meson issue for it?
To check if it's added:
cd build
python ../vendored-meson/meson/meson.py introspect --targets -i | grep c99
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.
On main
of course the build fails when checking for complex, which what started this whole exercise in the first place. But if I run the command on the broken build, I do not see any c99
. Maybe I need to create a minimal reproducer for a proper meson issue.
I only added This PR is still incomplete: linking fails. To recap (from a comment in the issue), to test this PR one needs to
If we decide this is important, there is an example github repo with a workflow that downloads and caches the compiler. |
I tried this before in scipy/scipy#16957. It's a real pain to work with. I'm hoping the Intel compilers before available in conda-forge (we had some discussions with Intel engineers around that), then it'll be much easier. I wouldn't bother now. |
Needs rebase. |
Be good to finish this. |
There is so much already in 2.0 I didn't want to add more. Also
and I have not gotten it to work yet |
Got it. I only wanted to remind you all of it, just in case it was missed. |
With new version of visual studio professional following is the status: Build command: python -m pip install . -Cbuild-dir=build -Csetup-args=-Dallow-noblas=false -Csetup-args=-Dblas-order=mkl -Csetup-args=-Dlapack-order=mkl -Csetup-args=-Dblas=mkl -Csetup-args=-Dlapack=mkl Selecting Microsoft compilers with MKL PASSES: set CC=clang-cl Setting intel icx fails with error npy_clongdouble definition is not compatible with C99 complex definition ! By default numpy selected cl compiler + MKL during build with new intelOneAPI. icx is still a problem. same error. For numpy 2.1.3 meson fails to detect icx:
|
Fixes #25034.