-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Using Werror-all for Intel #2948
Conversation
ok the CI found the same issues I had in my code:
my second commit should fix them |
tests/CMakeLists.txt
Outdated
target_compile_options(${target_name} PRIVATE -Werror) | ||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") |
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.
Is this true for both Intel compilers? (IntelLLVM and classic Intel; both will match here)
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.
thx for the fast reply
No clue tbh. This is the first time I learned about IntelLLVM. I took a brief look at their docs but couldn't find it
Are you sure it would match both? According to CMake the CMAKE_CXX_COMPILER_ID
for IntelLLVM is IntelLLVM
also checking the docs more in detail I noticed that Werror
does exist, but it is not as strict as Werror-all
. Maybe Werror-all
is too strict? What do you think
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.
MATCH will find the word anywhere; Clang and AppleClang MATCH. So IntelLLVM will MATCH Intel. (I guess they chose LLVM to avoid MATCHing with Clang, as IntelClang would have matched, and due to the AppleClang compiler, that's a very common expression in CMakeLists.
The Clang-based Intel compiler is the "new" compiler, and the one they are supporting going forward. The old compiler is now renamed "Classic Intel" (as you can see in the docs), and is being killed off.
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.
The new compiler is called "Intel® oneAPI DPC++/C++ Compiler", the old one "Intel® C++ Compiler Classic", as you can see here: https://software.intel.com/content/www/us/en/develop/tools/oneapi/all-toolkits.html
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.
thx for the explanation.
I used STREQUAL
now, please let me know if it is ok
Ignore the unrelated failure for Python 3.10, that's due to pytest-dev/pytest#8539 |
so now the ward issues are fixed, but there are two more warnings:
I am not sure what to do about those. Maybe there are some limits or inlining specified? => see here |
I think we set something similar for the NVHPC (PGI) compiler, which I think shares some history with Intel (IIRC). |
EDIT 4/14: I was wrong before (below), I overlooked that this PR does not affect the pragma block. Note to myself: the smart_holder branch will need to be updated accordingly. For the smart_holder branch I had to move the pragma block in pybind11.h (#2873), which wasn't supported by anyone unfortunately. |
this is what I get when enabling the report:
I then thought it would probably be better to disable the warnings for the following reasons:
Bottom line now I disabled them, which I think is the best solution Thx for your help, please let me know what you think |
cool now the CI passes (except the build you said doesn't work) |
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.
Looks good to me.
Co-authored-by: Henry Schreiner <[email protected]>
thanks for the fast responses and help! |
Thanks! |
Description
For turning compiler warnings into errors with Intel I think it is necessary to use
Werror-all
instead ofWerror
Source
EDIT
Werror
exists too, butWerror-all
is more strictI think there will be some minor things to be fixed, at least I had to do this in my project.
Lets see if the CI picks it up :)
Suggested changelog entry: