Set default CMAKE_BUILD_TYPE to Release and implement CMAKE_BUILD_TYPE FastBuild#474
Set default CMAKE_BUILD_TYPE to Release and implement CMAKE_BUILD_TYPE FastBuild#474marbre wants to merge 6 commits intoiree-org:masterfrom marbre:cmake_build_type
Conversation
LLVM only allows DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL. Hence, if the build type is set to fastbuild, we set the CMAKE_BUILD_TYPE to Release for LLVM.
|
So it looks like this increases the build time by another third (40 minutes, vs 30 minutes for the last run on master: https://github.com/google/iree/commit/fea7914fdd77e93976c055c366cd9d8373fae1d0/checks?check_suite_id=399128460). That surprises me. I would have expected it to be faster than debug. Should we reconsider making release the default? Maybe we should default to fastbuild |
|
Well regarding the default in the CMakeLists.txt, I think Release is the option to go. Anyway, fell free to pass |
|
Why do you say Release is better? You're probably the main one building with cmake, so I'm fine deferring to your judgement on that, but curious about your reasoning. Just doing a rough and unscientific test using cmake \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DIREE_BUILD_COMPILER=ON \
-DIREE_BUILD_TESTS=ON \
-DIREE_BUILD_SAMPLES=OFF \
-DIREE_BUILD_DEBUGGER=OFF \
..With BUILD_TYPE= So for strange reasons, Debug is actually even faster than FastBuild and it seems like things are about twice as fast on my workstation as on the GitHub runner. I guess if we start actually running tests, this balance would change quite a bit, but it seems like while we're just trying to get as much building as possible that the fastest build is the most desirable? It also calls into question somewhat the utility of fastbuild at all. |
|
Well, normally I build software with optimizations enabled, since I am not scared about compile time but rather about execution time. So I assume that Release would be the suitable default for a user. Regarding compile time, setting |
|
Fair enough. For now, since we're not actually running anything based on the build, let's at least default the CI to something that builds quickly. Can you change that as part of this PR? (build_tools/scripts/cmake_build.sh) Maybe for FastBuild we should build LLVM with Debug if that's faster? I'm testing that out now to see how it looks. |
|
Sure, I can adjust cmake_build.sh :) However, the question remains if we only want to keep 694d681 and set the CI to |
|
Well I forgot to actually run it with |
|
Yeah running with |
|
Okay, done. The CI should build with |
| rm -rf build/ | ||
| mkdir build && cd build | ||
| "$CMAKE_BIN" -DIREE_BUILD_COMPILER=ON -DIREE_BUILD_TESTS=ON -DIREE_BUILD_SAMPLES=OFF -DIREE_BUILD_DEBUGGER=OFF .. | ||
| "$CMAKE_BIN" -DCMAKE_BUILD_TYPE=Debug -DIREE_BUILD_COMPILER=ON -DIREE_BUILD_TESTS=ON -DIREE_BUILD_SAMPLES=OFF -DIREE_BUILD_DEBUGGER=OFF .. |
There was a problem hiding this comment.
I was saying I think this should be FastBuild
| "$CMAKE_BIN" -DCMAKE_BUILD_TYPE=Debug -DIREE_BUILD_COMPILER=ON -DIREE_BUILD_TESTS=ON -DIREE_BUILD_SAMPLES=OFF -DIREE_BUILD_DEBUGGER=OFF .. | |
| "$CMAKE_BIN" -DCMAKE_BUILD_TYPE=FastBuild -DIREE_BUILD_COMPILER=ON -DIREE_BUILD_TESTS=ON -DIREE_BUILD_SAMPLES=OFF -DIREE_BUILD_DEBUGGER=OFF .. |
There was a problem hiding this comment.
You're absolutely right. Sorry for that, as an excuse, it's quite late here.
There was a problem hiding this comment.
Oh, I could have picked that directly here on GitHub. Wasn't aware of this feature. Next time :)
|
Build times on the CI look better now, thanks! |
CMAKE_BUILD_TYPEtoReleaseFastBuildCMAKE_BUILD_TYPEis set toFastBuild, for LLVM theCMAKE_BUILD_TYPEis set toRelase