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
CI: update tidy image #14589
CI: update tidy image #14589
Conversation
|
/rebuild |
|
I am struggling to make configuration work with clang 14 and MPI (so we can get MPI warnings).
But this leads to errors that clang-tidy can not find <mpi.h>. |
@tjhei I just checked the docker image: The problem is that you set CC=mpicc and CXX=mpicxx in the docker environment. With that the
The issue that remains is that the |
3007ff4
to
dc81d9b
Compare
@tjhei I took the liberty to update this branch with a workaround. |
565e0be
to
386980b
Compare
@tjhei I don't understand what's going on here. The docker image contains
And running the |
386980b
to
ddbe0bb
Compare
contrib/utilities/run_clang_tidy.sh
Outdated
@@ -41,9 +41,13 @@ if test ! -d "$SRC/source" -o ! -d "$SRC/include" -o ! -d "$SRC/examples" -o ! - | |||
fi | |||
echo "SRC-DIR=$SRC" | |||
|
|||
# unset CC and CXX | |||
unset CC | |||
unset CXX |
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.
@tjhei Completely unsetting CC and CXX fixes the configure issue. clang-tidy afterwards seems to be smart enough to accept the fact that the project had been configured with gcc.
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.
Alternatively, if you prefer, you can also add back the compiler wrappers (i.e. remove the two unset
) and specify -DMPI_INCLUDE_DIRS=/usr/include/x86_64-linux-gnu/mpich
as an option. This seems to work as well.
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.
@tjhei The current variant now uses the compiler wrappers + sets MPI_INCLUDE_DIRS
manually to make clang-tidy happy.
# enable MPI (to get MPI warnings) | ||
# export compile commands (so that run-clang-tidy.py works) | ||
ARGS=("-D" "DEAL_II_WITH_MPI=ON" "-D" "CMAKE_EXPORT_COMPILE_COMMANDS=ON" "-D" "CMAKE_BUILD_TYPE=Debug" "$@") | ||
ARGS=("-D" "DEAL_II_WITH_MPI=ON" "-D" "CMAKE_BUILD_TYPE=Debug" "$@") |
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.
I have removed CMAKE_EXPORT_COMPILE_COMMANDS
. We now set this unconditionally :-)
ddbe0bb
to
46d3ce3
Compare
@tjhei We will need to resolve the docker image issue, ie., whatever causes
Furthermore, clang-tidy-14 now warns at a couple of places that we have to fix up :-) |
54844a3
to
bb1a1e3
Compare
New warnings (54 new warnings):
|
160+ new warnings about "avoid repeating the return type from the declaration; use a braced ...":
|
550+ warnings about "C-style casts are discouraged; use static_cast/const_cast/reinterpret_cast":
|
Work around a bug with FindMPI.cmake not detecting the include path for mpich.
bb1a1e3
to
7058821
Compare
The warnings shown above about C-style casts are quite aggravating because they are not actually of the type
and the one in
and the one in
for which I can't even say what the cast is. In other words, these warnings are all wrong. |
And I also disagree about the brace-initializer-list in
one might save some typing by writing
instead, but (i) I don't think this is actually easier to read because I read this as "return a pair of values" rather than "call the constructor with these two arguments", and (ii) this becomes seriously difficult to read when the return type declaration of the function is a couple hundred lines away from the If we want to do anything about these cases, I'd much rather us write this as to avoid duplicating information:
|
This needs some work if we decide to move the |
@masterleinad What should we do here? Want to rebase and see what's left? |
We don't use |
@tjhei ? |
I also don't think anything here is still needed. |
This updates to clang 14 from 10.
Also updates cmake to 3.22.1 @tamiko