Hi,
Recently I notice that pamac uses only one core of my CPU when compiling AUR packages.
I looked up in the forum and found that we need to modify the MAKEFLAGS settings in /etc/makepkg.conf or ~/.makepkg.conf
Isn’t yay also just relies on makepkg thus doesn’t make any difference here? Of course you could pass makeflags there but it’s almost the same as modifying makepkg.conf. Why one should prefer it over pamac?
makepkg is the place.
(yes yay is mostly a wrapper for pacman/makepkg, when possible)
(whereas pamac should be using ALPM itself … so it mimics pacman, does not ‘use’ pacman … all in turn using makepkg)
So you want to edit its conf file: /etc/makepkg.conf
And set some options.
The first one is number of cores for compile. Its a simple -jX where X is the number of cores.
MAKEFLAGS="-j9"
We can also use nproc to get it automatically
MAKEFLAGS="-j$(nproc)"
Or combine that with math to accomplish something else, like all but 1 core:
MAKEFLAGS="j$(($(nproc)-1))"
You might also be interested in the compression flags.
Here threads set to 0 should use all of them: