-
Notifications
You must be signed in to change notification settings - Fork 5
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
Tidies up CMake, enables core libraries to build with -Wall -Wextra -… #190
Conversation
e3d9978
to
30cb019
Compare
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.
Thanks a lot for tidyng all of this mess.
I have some minor comments which bots might have not found
CMakeLists.txt
Outdated
set(CMAKE_CXX_STANDARD 14) | ||
endif() | ||
|
||
# KS: If C++ standard is lower than C++ standard used for ROOT compilation things will go terribly wrong | ||
if(DEFINED ROOT_CXX_STANDARD AND ROOT_CXX_STANDARD GREATER CMAKE_CXX_STANDARD) | ||
set(CMAKE_CXX_STANDARD ${ROOT_CXX_STANDARD}) | ||
endif() | ||
cmessage(STATUS "CMAKE CXX Standard: ${CMAKE_CXX_STANDARD}") | ||
|
||
# KS: ROOT changed cmake in 6.32, we should move avay from using Luke's hack, keep it for due to compatibility | ||
if(ROOT_CXX_STANDARD LESS 14 AND ROOT_VERSION VERSION_LESS 6.32.00) | ||
cmessage(WARNING "ROOT CXX STANDARD: ${ROOT_CXX_STANDARD}") | ||
set(CMAKE_CXX_STANDARD 17) |
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.
can you try ussing ROOT_CXX_STANDARD?
It is in root cofnig
https://github.com/root-project/root/blob/8d5764957e4bcb9cdc0bca44f83fb2fb4fe1815d/cmake/scripts/RootUseFile.cmake.in#L12
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.
yep, done
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, no its not, if we 'use' the RootUseFile then it sets the standard for the whole compilation, but it doesn't expose directly what standard it uses. I'll just grab the flag-stripping code from NuHepMC
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've put something a bit hacky in for the moment. NuOscillator uses the nuhepmc/cmakemodules still and it ends up setting up root, so I'd need to PR it out of that to properly just let ROOT set itself up. But this builds for the moment
According to CI Minuit2 flag is no longer on
we were reyling on ROOT_CXX_FLAGS set via NuHEP Tools https://github.com/mach3-software/MaCh3/actions/runs/11558478688/job/32170957073?pr=190 |
13226a4
to
31d7b1b
Compare
b5d4fbf
to
4d68790
Compare
…Werror - updates to yaml 0.8.0 - updates to CPM 0.40.2 - removes dependency on NuHepMC/CMakeModules - sets CXX standard to 17, can probably roll it back, but there is C++17 code in here - separates warning/error flags from other compiler flags - warnings/errors become a separate interface target that we link privately to library code - all core libraries updated (hopefully minimally) to build under stringent compiler checks. Most of this is: * myvect.size() -> int(myvect.size()) * (int)mylong -> int(mylong) * (TObj*)SomeROOTFunc() -> static_cast<TObj*>(SomeROOTFunc()) - Also changes macro types to using declarations
- Updates note about float types for low memory structs - adds not about diagnostic disabling
- points NuOscillator at luketpickering fork momentarily to test letting that set up ROOT directly. - builds with DEBUG enabled now as well which was highlighting other issues during CI.
`abs` is a C-library function which operates on ints, `fabs` is the float version. We should use std::abs which is the C++ version that has overloads (which don't exist in C).
- also catches a few more uses of `abs` rather than `std::abs`.
- also fix bug in ROOT c++ standard constraint
afc9d27
to
5ab2064
Compare
- make Catch2 find_package quite - fix bug in GetPentaltyTerm where dial value was an int - lots of explicit type cats - ignore useless-cast in lots of places to allow M3::float_t = double/float compilation
a5e9318
to
9d795a2
Compare
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.
Soma comments
…Werror
Pull request description
Changes or fixes
Examples