-
Notifications
You must be signed in to change notification settings - Fork 519
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
remove gsl-lite dependency #3225
base: develop
Are you sure you want to change the base?
Conversation
cpp-linter is really not great. It has false positives almost every time a change is made due to slight discrepancies in how different clang-format versions interpret things. I have gone through trying different clang-formats and still can't make it happy. It says to use version 15, but I can't find any straightforward way to install this on my mac. I will have to return later to figure out what it's fussing about. |
This is awesome -- thanks for removing this dependency! When I run clang format with LLVM 15.0.0 or LLVM 18.1.0, I get the following diff:
Seems like LLVM 19 made some change to behavior here unfortunately. |
I was able to push a fix for the formatting issue, but now it seems to be hitting a compile time issue when MPI is enabled. Could be an issue with some of the spans being changed to const types? |
Thanks for the fix John! I'll be able to fix that in a few days. |
I know I'm adding a PR right now on another little cleanup thing, but will come back to this soon to finish it. |
Description
The C++ GSL does barely anything. Span is nice, but it's barely any effort to just make your own. Less dependencies is nice to have. I have had one issue requiring manual reconfiguration of GSL lite before when building openmc, so this will reduce the chance of others running into that.
Also,
assert
is arguably superior toExpects
andEnsures
provided by GSL. If we want, we can do#define Expects assert
. But it's very nice to know many checks can be added withassert
that vanish when compiling outside debug mode.Lastly, since gsl::index is typedef'd to an int64_t 99.999999% of the time on modern computers, it replaced all instances with that. This would actually change behavior in certain cases on 32 bit computers, but using the 64 bit version can only help.
Checklist