Skip to contentSkip to conversation

perl: use parallel build where possible

PATCH In review Alexander Kanavin 2 participants 3 messages Mar 2, 2018 – Mar 5, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perl: use parallel build where possible

While the upstream just runs a number of make tasks hardcoded to a single thread in succession, we can add '-j n_threads' to a few of them. The benefit is real: on my machine the do_compile() time goes from 250 seconds to about 90.

---
 meta/recipes-devtools/perl/perl_5.24.1.bb | 5 +++++
 1 file changed, 5 insertions(+)
meta/recipes-devtools/perl/perl_5.24.1.bb +5 -0
index f13a63a80a3..67cc8d668db 100644
@@ -184,6 +184,11 @@ do_compile() {
         # Fix to avoid recursive substitution of path
         sed -i -e 's|(@libpath, ".*"|(@libpath, "${STAGING_LIBDIR}"|g' cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
 
+        # Build auxillary make targets (more/more2/more3/more4) in parallel.
+        # Unfortunately the core target will race, and so remains single-threaded.
+        # Still, this cuts do_compile() time from 250 seconds to about 90.
+        sed -i -e 's, more, ${PARALLEL_MAKE} more,g' Cross/Makefile
+
         cd Cross
         oe_runmake perl LD="${CCLD}"
 }
Signature · 1 line
2.15.1
#1 lore raw
Quoted 11 lines · Alexander Kanavin

While the upstream just runs a number of make tasks hardcoded to a single thread
in succession, we can add '-j n_threads' to a few of them. The benefit
is real: on my machine the do_compile() time goes from 250 seconds to about 90.

---
 meta/recipes-devtools/perl/perl_5.24.1.bb | 5 +++++

 1 file changed, 5 insertions(+)

I like the idea of the patch but I think it triggered:

https://autobuilder.yocto.io/builders/nightly-world/builds/806/steps/BuildImages/logs/stdio

Cheers,

Richard

#2 lore raw
Quoted 8 lines · Richard Purdie
Quoted 7 lines · Alexander Kanavin

While the upstream just runs a number of make tasks hardcoded to a single thread
in succession, we can add '-j n_threads' to a few of them. The benefit
is real: on my machine the do_compile() time goes from 250 seconds to about 90.

Quoted 8 lines
Quoted 4 lines
---
  meta/recipes-devtools/perl/perl_5.24.1.bb | 5 +++++
  1 file changed, 5 insertions(+)

I like the idea of the patch but I think it triggered:

https://autobuilder.yocto.io/builders/nightly-world/builds/806/steps/BuildImages/logs/stdio

Unfortunately it's also a race:

| JSON::PP 2.27103 is not available
...
| Unsuccessful Makefile.PL(ext/ODBM_File): code=65280 at make_ext.pl line 521. | makefile:590: recipe for target 'lib/auto/ODBM_File/ODBM_File.so' failed

Maybe we should look into reducing perl dependencies instead, particularly look into whether perl is really still needed for RDEPENDS of various ptests of 'core' packages.

Alex