Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#11872 closed enhancement (fixed)

Document some more details about building, particularly with cmake and meson.

Reported by: ken@… Owned by: ken@…
Priority: normal Milestone: 9.0
Component: BOOK Version: SVN
Severity: normal Keywords:


With traditional packages, we have assumed that by the time people come to BLFS they know something about CFLAGS and CXXFLAGS.

With cmake and ninja things are slightly different. The effect of the cmake build variants is not widely documented, and until now we have just used the default on meson, which currently is 'debugrelease' and leaves runtime assertions (if any - they do not seem to be common) enabled : that is what triggered this, mesa can be very very slow when loading levels for games if the assertions are built.

In some of our cmake recipes we do specify Release builds, but not for all of them and I think we need to understand the practical effects, and also whether forcing CFLAGS and CXXFLAGS can override these defaults (I have so far established that it does in meson).

Removing the assertions might affect testsuites.

Keeping the default flags of '-O2 -g' may not be very helpful if trying to debug a program where the compiler has optimized away or inlined or reordered certain parts of the program.

Also, in the old days 'make' almost always showed what commands it was running. These days, many CMMI programs just report 'CC something, LD something' and ninja by default only shows the target number and the total, and what the target is. Telling people how to see the commands will help when things go wrong.

Change History (9)

comment:1 by ken@…, 4 years ago

Owner: changed from blfs-book to ken@…
Status: newassigned

comment:2 by Pierre Labastie, 4 years ago

At least for mesa (but I guess for any package using NDEBUG), passing -Db_ndebug=true to meson allows to remove assertions, even if using "debug" or "debugoptimized" buildtype. And if using buildtype=release, passing -Db_ndebug=false allows to add assertions...

comment:3 by ken@…, 4 years ago

Bruce posted to the list some (edited) output from 'meson configure' (the output is badly formatted) which shows the default values for mesa-19.0.0.

Mention that command for people who need to see what the defaults are.

comment:4 by Bruce Dubbs, 4 years ago

We've updated BLFS adding a section

Working with different build systems

Can we close this ticket?

comment:5 by ken@…, 4 years ago

I'm not convinced it is ready. You wanted to alter (undisclosed) items, and Brendan L's comment today looks like a better approach for meson.

I committed my initial version to make it open season for editing it.

Will look at addressing Brendan's suggestions in a day or two.

And I'm not entirely sure Pierre will be happy - I get the impression he might prefer to build meson packages with '-O2 -g' and -DNDEBUG', although I do not understand why.

in reply to:  6 comment:7 by ken@…, 4 years ago

Replying to bdubbs:

Ken, See r21417.

Thanks. I somehow missed that. Looks good, but Brendan's suggestion to look at the txt file seems better than what I had, will get to that eventually.

comment:8 by ken@…, 4 years ago

Resolution: fixed
Status: assignedclosed

Fixed at r21420, Errors and Omissions Excepted.

comment:9 by Bruce Dubbs, 4 years ago

Milestone: 8.59.0

Milestone renamed

Note: See TracTickets for help on using tickets.