cmake-native: Set --parallel for configure
cover cmake-native: Set --parallel for configure
The following changes since commit 14c291e1fb6324da46885b69fbd7f01b3c6b053e:
gcc-runtime: Add missing libc dependency (2018-12-18 16:19:30 +0000)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib rbt/cmake
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/cmake
Robert Yang (1):
cmake-native: Set --parallel for configure
meta/recipes-devtools/cmake/cmake-native_3.12.2.bb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
2.7.4
PATCH 1/1 cmake-native: Set --parallel for configure
This can save do_configure's time from 330s to 60s on my host.
--- meta/recipes-devtools/cmake/cmake-native_3.12.2.bb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-devtools/cmake/cmake-native_3.12.2.bb +3 -1
@@ -27,7 +27,9 @@ CMAKE_EXTRACONF = "\ " do_configure () { - ${S}/configure --verbose --prefix=${prefix} -- ${CMAKE_EXTRACONF} + ${S}/configure --verbose --prefix=${prefix} \ + --parallel=${@d.getVar('PARALLEL_MAKE').replace('-j ', '')} \ + -- ${CMAKE_EXTRACONF} } do_compile() {
Signature · 1 line
2.7.4
Quoted 1 line · Robert Yang
+ --parallel=${@d.getVar('PARALLEL_MAKE').replace('-j ', '')} \
See oe.utils.parallel_make_argument()
Ross
Quoted 4 lines · Ross
Quoted 1 line · Robert Yang
+ --parallel=${@d.getVar('PARALLEL_MAKE').replace('-j ', '')} \
See
oe.utils.parallel_make_argument()
Thanks, updated in the repo:
commit 19ac4e33e66353581191e7dfd866f6c0f73eafa6
Author: Robert Yang <[email protected]> Date: Tue Dec 18 17:48:22 2018 +0800
cmake-native: Set --parallel for configure
This can save do_configure's time from 330s to 60s on my host.
meta/recipes-devtools/cmake/cmake-native_3.12.2.bb +3 -1
@@ -27,7 +27,9 @@ CMAKE_EXTRACONF = "\ " do_configure () { - ${S}/configure --verbose --prefix=${prefix} -- ${CMAKE_EXTRACONF} + ${S}/configure --verbose --prefix=${prefix} \ + --parallel="${@oe.utils.parallel_make_argument(d, '%d')}" \ + -- ${CMAKE_EXTRACONF} } do_compile() {
// Robert
Quoted 3 lines
Ross
Quoted 1 line · Robert Yang
+ --parallel="${@oe.utils.parallel_make_argument(d, '%d')}" \
Tweaked when merging to mut to be:
+ ${S}/configure --verbose --prefix=${prefix} \
+ ${@oe.utils.parallel_make_argument(d, '--parallel=%d')} \
+ -- ${CMAKE_EXTRACONF}
I see similar wins here, walltime for cmake-native's build goes from five minutes to one minute.
(!!!)
Ross
Quoted 2 lines · Ross
I see similar wins here, walltime for cmake-native's build goes from five minutes to one minute.
For anyone playing along at home, this is what I did:
Cleaned tmp, applied patch to the mut branch.
$ git checkout HEAD^; bitbake cmake-native -C unpack $ git checkout mut ; bitbake cmake-native -C unpack
Force a full build of cmake-native for both commits.
Then use buildstats-diff to compare the runs:
$ buildstats-diff /data/poky-tmp/master/buildstats/* PKG TASK ABSDIFF RELDIFF CPUTIME1 -> CPUTIME2 cmake-native do_configure 29.1s +11.0% 265.7s -> 294.8s
Cumulative cputime:
18.0s +2.2% 13:41.4 (821.4s) -> 13:59.3 (839.3s)
Oh, that's odd: it took *more* time to run. But the output from my bitbake clearly showed bitbake taking five minutes before and one minute after.
Oh, *walltime* not *cputime*.
$ buildstats-diff /data/poky-tmp/master/buildstats/* --diff-attr walltime PKG TASK ABSDIFF RELDIFF WALLTIME1 -> WALLTIME2 cmake-native do_configure -214.6s -82.4% 260.4s -> 45.8s
Cumulative walltime:
-218.4s -72.3% 05:02.1 (302.1s) -> 01:23.7 (83.7s)
cputime is generally a more useful metric during a build, but for isolated tests like this walltime is also relevant. This is demonstrating that the same work is happening, but in parallel.
Ross