easybuild-easyblocks icon indicating copy to clipboard operation
easybuild-easyblocks copied to clipboard

`CMakeMake` could default CMAKE_BUILD_TYPE to RelWithDebInfo instead of Release

Open bartoldeman opened this issue 2 years ago • 4 comments

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 avatar Nov 14 '23 18:11 bartoldeman

@Flamefire Thoughts on this?

boegel avatar Dec 06 '23 08:12 boegel

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?

Flamefire avatar Dec 06 '23 09:12 Flamefire

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.

Micket avatar Apr 05 '24 11:04 Micket

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

Flamefire avatar Apr 05 '24 14:04 Flamefire