Skip to content
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

CMakeMake could default CMAKE_BUILD_TYPE to RelWithDebInfo instead of Release #3032

Open
bartoldeman opened this issue Nov 14, 2023 · 4 comments
Labels
EasyBuild-5.0 EasyBuild 5.0
Milestone

Comments

@bartoldeman
Copy link
Contributor

Release sets -O3 -DNDEBUG which overrides the default -O2 from easybuild.
RelWithDebInfo sets -O2 -g -DNDEBUG so is more compatible, and the debug info doesn't hurt (it increases the size of the binary but not much compared to typical datasets many researchers deal with, and it does make profiling easier and debug backtraces much more legible).

One could also let it depend on toolchainopts, i.e. if 'opt': True is set, then use Release else RelWithDebInfo?

@bartoldeman bartoldeman added the EasyBuild-5.0 EasyBuild 5.0 label Nov 14, 2023
@boegel boegel added this to the 5.0 milestone Dec 6, 2023
@boegel boegel changed the title cmakemake.py could default CMAKE_BUILD_TYPE to RelWithDebInfo instead of Release CMakeMake could default CMAKE_BUILD_TYPE to RelWithDebInfo instead of Release Dec 6, 2023
@boegel
Copy link
Member

boegel commented Dec 6, 2023

@Flamefire Thoughts on this?

@Flamefire
Copy link
Contributor

I'm a bit worried given that the additional size is not only storage but also bandwidth from the shared filesystem on a cluster where the additional data gets transferred on every use although it is rarely used by most users and more of interest to developers/maintainers.

And we also don't add -g to ConfigureMake based ECs, do we? So why for CMakeMake?

Maybe we could have another flag which is used to decide whether we add -g (CMake honors $CXXFLAGS as well as configure-make, so we could add it there)

As for using another build type: We have the build_type option for CMakeMake which can be changed in ECs and/or via hooks. Maybe that is better for customization than having larger binaries for everyone by default?

@Micket
Copy link
Contributor

Micket commented Apr 5, 2024

Yes I agree we should be consistent, so it would be

  • CMakeMake/Ninja RelWithDebInfo
  • MesonNinja (debugoptimized) https://mesonbuild.com/Running-Meson.html#configuring-the-build-directory
  • MakeCp just have -g in CFLAGS is the best we can do i guess? (essentially just toolchainopts debug=true by default i guess)
  • ConfigureMake also just -g in CFLAGS, i'm not aware of anything standard here.
  • Cargo maybe? Not the same structure, but there is the possibility of RUSTFLAGS=-g

Having a global option also sounds good to me. I don't imagine the size impact to be all that significant; it would in total be far less than a single NVHPC install.

@Flamefire
Copy link
Contributor

As mentioned I don't worry only about the size but also about the additional bandwidth used when transferring the binaries from the global filesystem to the nodes on each use by many users with no use for most of them

(essentially just toolchainopts debug=true by default i guess)

Sounds like we already have a flag for that. So if we already add -g for MakeCp (only) when toolchainopts debug=true then this could be used for choosing RelWithDebInfo in CMakeMake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EasyBuild-5.0 EasyBuild 5.0
Projects
Status: No status
Development

No branches or pull requests

4 participants