cmake build system: change default build type to "Release"#36679
cmake build system: change default build type to "Release"#36679tgamblin merged 4 commits intospack:developfrom
Conversation
|
@scottwittenburg @tgamblin Any clue why this didn't result in a ton of builds in pipelines? Is it because pruning went a bit too far? |
|
By a fast inspection of the |
|
I think having |
|
|
|
IMHO there are very few cases where I need the debug information in production code, I'm more concerned about the size of the install tree. If When I do need debug information (i.e. development codes), I would be fine with rebuilding the world, so |
|
Edit: this PR is not the place to discuss it, let's do that in the issue. |
|
I don't think this is the correct thing to do. If anything, I think it is better to add Spack documentation that talks about configuring builds to be fully optimized for Building with |
|
I don't think it is very straightforward for the user to switch to |
Depending on the use case for Spack different options are preferential.
Yes, preferences that are actually requirements can be specified that way. You can also specify the requirement per-package too. packages:
trillinos:
require: ["build_type=Release"]Note, I would recommend using lists there instead of strings for composition purposes. |
|
Here there are real numbers in terms of size reduction: llnl/smith#764 |
|
I just tried and it looks like: doesn't work with non- |
|
The size reduction argument is pretty persuasive to me...I am willing to let go on my stance for a 20x reduction in binary footprint, that is significantly more impactful than +1 |
|
Sorry, I'm not convinced, even if there are 3 ✅s. How much of that "size argument" holds if you inject You can keep debug symbols compressed. I still think we want debug symbols in CI, it's useful for debugging segfaults, it doesn't really matter if source is preserved or not, at least you have symbol names. IMHO the upside of Release is enabling vectorization in GCC, even though that's already partially (?) enabled in GCC >= 12 in -O2. Losing debug info is really an annoyance. |
|
Then for the CI, how about: |
CMake does not by default strip symbols from binaries even for Release (StackOverflow, demo). Spack would need to pass |
|
Just for a counter point, I have had CI builds fail due to running out of disk space. This mainly happened in Docker builds but the logs were lost and it was a giant pain to figure out. IMO, debugging CI jobs directly from their output (except the logs to narrow it down locally) is usually not worth the time. But more importantly, your CI should as closely reflect your user experience as possible. |
I think for PR CI this can make sense, but for protected/develop/release CI I don't think there is is as much utility. Since those are really being used to generate build caches, I would argue that it is not really desired. For CI, if we can figure out how to get |
CMake has nothing to do with the example you give. Your example doesn't declare the function static, so of course it will be part of the symbol table.
This is incorrect in the sense that there isn't a symbol for static functions, so you get very tricky if not useless backtraces. |
I still think there is:
|
|
And to sum up the pros and cons:
👍 higher optimization level, including loop vectorization on older GCC Notice that debug symbols do not influence performance. Other than that:
|
Symbols are not exposed by default for executables (see
There are symbols for the outlined version of
I personally refuse to debug someone else's code without the original sources. The buildcache does not ship the sources (obviously), so I'd first rebuild from source. If I'm rebuilding from source anyway, I can set Poor bug reports will be reported no matter what. There is (a lot of) software built outside of Spack, and (a lot of) it is stripped on installation (my common encounters involve GPU or MPI vendor libraries or Glibc itself). Keeping debug info here will not help the situation.
I do not think people who care about performance will use the Spack public buildcache for their main build. As a dev for HPCToolkit I've learned that they want software built FWIW, most application teams we interact with are only interested in detailed performance for their code, they really couldn't care less about the tens of inlined templates in their library dependencies (RAJA/Kokkos, *BLAS, etc.). They should only need debug info for a few (often one) element of a large Spack spec, more than that isn't worth the storage quota. |
|
@alalazo fixed (and double-checked the rest of them). |
|
@tgamblin addressed |
|
@spackbot run pipeline |
|
@spackbot run pipeline |
|
I've started that pipeline for you! |
0e1b232 to
636ea85
Compare
The same was done for CMake in spack#36679.
The same was done for CMake in #36679.
The message is now outdated after spack#36679 which could lead to some confusion.
After spack#36679, the default build type is Release, so there is no need to explicitly set the build type as a custom variant.
The message is now outdated after #36679 which could lead to some confusion.
After #36679, the default build type is Release, so there is no need to explicitly set the build type as a custom variant.
The message is now outdated after spack#36679 which could lead to some confusion.
After spack#36679, the default build type is Release, so there is no need to explicitly set the build type as a custom variant.
fixes #22918
refers #36181
A point in favor of the switch, made by @ax3l :
In this PR the default build type of the CMake build system is changed from
RelWithDebInfotoRelease. Submitting this since the discussion pops up here and there, latest place being #36181. I think we should default to "Release", but curious what would be the point to avoid that choice.