Cup of Linux

Distro-specific Discussion => Manjaro Only => Topic started by: Spatry on September 08, 2014, 03:40:04 PM

Title: Multi-CORE compiling using Yaourt.
Post by: Spatry on September 08, 2014, 03:40:04 PM
I did a little digging around and I was looking for a solution which would allow me to compile AUR packages using all 4 cores of my CPU when building wine-silverlight.

Step 1: open /etc/makepkg.conf

Step 2: uncomment #MAKEFLAGS="-j2" by removing the # symbol at the beginning of the line.

Step 3: if you have a dual core processor change the line to MAKEFLAGS="-j3" Quad core processors MAKEFLAGS="-j5" octocores would be MAKEFLAGS="-j9" and so on... This formula is assuming you have one processor with (x) cores hence the original line stating "-j2" meaning one processor, one core.

Step 4: When you use yaourt an option is given to edit the PKGBUILD. Make sure there is a line in the PKGBUILD which says options=('!makeflags'). If it is not there, you will need to add this line, otherwise multi-core compilation will not proceed.

In testing this, it appears that the compile process is going faster. It is my understanding that this may not work for compiling everything so your mileage may vary. Cheers.
Title: Re: Multi-CORE compiling using Yaourt.
Post by: c00ter on September 08, 2014, 07:15:42 PM
This could be a real time-saver. It usually takes my wee old compy 5-10 mins. to compile google-chrome-stable. :)
Title: Re: Multi-CORE compiling using Yaourt.
Post by: lcRONOS on December 09, 2014, 03:22:34 PM
In Gentoo when compiling packages I believe you can also specify the Makeflags option for a specific package when installing it, I'm not sure whether that's a portage feature or something you can do with any package during a compile though.  I'm surprised that that's not something that is in the initial set up though, because even as a Gentoo user (that step is mandatory when installing Gentoo) I didn't think about that.
Title: Re: Multi-CORE compiling using Yaourt.
Post by: MrCoe on June 15, 2017, 03:19:21 AM
What if you have an i7 with 4 cores and 8 threads ?, could you in theory up the setting ?
Title: Re: Multi-CORE compiling using Yaourt.
Post by: Ironclaw on February 14, 2019, 05:11:56 AM
General rule is number of cores + 1
Title: Re: Multi-CORE compiling using Yaourt.
Post by: Spatry on February 14, 2019, 07:20:08 AM
I will add that this works when building packages from the aur with "makepkg" instead of AUR helpers like trizen, yay or yaourt. I have MAKEFLAGS="-j9" in my configuration and all 8 threads on my thinkpad are used when compiling AUR packages.
Title: Re: Multi-CORE compiling using Yaourt.
Post by: drsteve on July 12, 2020, 11:18:11 PM
Awesome information!
THANK YOU!
I will give it a whirl next time I am needing to compile.
I like using Shutter and in the past remember needing to install it which took a VERY LONG TIME every time!