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

set a default buildtype in MesonNinja easyblock

Open jfgrimm opened this issue 1 year ago • 2 comments

for e.g. CMake we add -DCMAKE_BUILD_TYPE=Release by default. We don't currently do anything like that for meson: https://github.com/easybuilders/easybuild-easyblocks/blob/develop/easybuild/easyblocks/generic/mesonninja.py#L95

this means we actually default to debug without optimisations (ref):

Option Default value Description Is per machine Is per subproject
buildtype {plain, debug, debugoptimized, release, minsize, custom} debug Build type to use no no

these options correspond to (ref):

buildtype debug optimization
plain false plain
debug true 0
debugoptimized true 2
release false 3
minsize true s

jfgrimm avatar Apr 05 '24 11:04 jfgrimm

I wonder if CFLAGS are saving us here anyway? Of course we should still set this, but we might not be as bad as it seems in general :) I do hope it picks up -march flags in general as well, otherwise it would still be bad. We do normally just go with -O2 with easybuild though, but i suspect differences are minimal.

Semi related: https://github.com/easybuilders/easybuild-easyblocks/issues/3032#issuecomment-2039612792

Micket avatar Apr 05 '24 14:04 Micket

@Micket yes, it probably does. Better to be explicit though, rather than relying on what has priority internally in meson

jfgrimm avatar Apr 05 '24 14:04 jfgrimm