cholla-hydro / cholla

A GPU-based hydro code
https://github.com/cholla-hydro/cholla/wiki
MIT License
60 stars 32 forks source link

Clang 17 Support + Fix for Missing OMP Headers #330

Closed bcaddy closed 9 months ago

bcaddy commented 9 months ago

Clang 17 Support

Clang-tidy 17 comes with some new checks and improvements to old ones. I made some small changes were needed so that those checks pass.

I updated the formatting for clang-format 17. Nothing major there, mostly it got better at aligning assignment statements properly.

clang-17 tools are available on C-3PO at /usr/lib/llvm-17/bin and can be added to your path with export PATH="/usr/lib/llvm-17/bin:$PATH"; make sure to remove clang 15 from your path first. Clang 17 is available on CRC's H2P cluster and Frontier.

OMP Support

The installation of clang on CRC systems doesn't include OMP. I didn't realize this initially and made a kind of hacky workaround that ended up making clang-tidy skip some of our headers too. The CRC is working on fixing this but in the meantime I have fixed the issues on our end using C-3PO. For future reference, if you want clang-tidy to know that something is a system header you have to pass its include path as -isystem $path$, no amount of header regex will do it properly.

Other

bcaddy commented 9 months ago

FYI, the issues with clang-tidy at the CRC have been resolved with the installation of the latest stable version of clang, v17.0.1. I've already gotten Cholla working with clang v16.0.6 in this PR and once I get it working with v17.0.1 I'll mark this PR as ready for review.

bcaddy commented 9 months ago

This is ready to merge. I fixed all the issues except the function naming convention which I turned back off; it's a lot of work to change all the function names and I'm just not up to it at the moment.