From: Rich Freeman <rich0@gentoo.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] "emerge --jobs=1 ..." vs "MAKEOPTS=-j1 emerge ..."
Date: Sun, 21 Jun 2020 06:20:33 -0400 [thread overview]
Message-ID: <CAGfcS_k8Vf29DGOiBU0UBwX+=JA96a0Qk8Q0w5zETxtf7oyGZA@mail.gmail.com> (raw)
In-Reply-To: <24303.11806.371890.563490@tux.local>
On Sun, Jun 21, 2020 at 5:53 AM Dr Rainer Woitok
<rainer.woitok@gmail.com> wrote:
>
> is there any difference between running "emerge --jobs=1 ..." and runn-
> ing "MAKEOPTS=-j1 emerge ..."?
>
Yes.
--jobs=1 tells emerge to build one package at a time.
-j1 tells make to compile one file at a time when building a package.
So, if you have 10 independent packages containing 10 independent C
files, --jobs=10 and -j10 will build all 100 C files in parallel.
--jobs=1 and -j10 will build each package in series, with all 10 C
files in each package in parallel. --jobs=10 and -j1 will build all
10 packages in parallel, but each one will build one C file at a time.
If you have the cores to spare each is useful, because rarely are
either packages or the files within them completely independent. So
running both in parallel maximizes the opportunity to keep your cores
busy, of course at the cost of memory if you spawn too many. It is
hard to perfectly predict the optimal combination since portage can't
tell how parallel any particular package is.
Setting -j1 is necessary in some build systems due to bugs in the
dependency expressions inside them. This SHOULD be done by packages
automatically, but sometimes it is missed. Bugs should be filed in
these cases to get the ebuilds fixed, but in the meantime setting -j1
can fix this. (This was recently discussed on this list for that pam
dependency - which has already been fixed in the repo so you don't
actually need to worry about it now.) It shouldn't really be
necessary to set --jobs=1 unless you're running out of RAM, because it
is pretty rare to have portage dependency issues and if you do chances
are the package will break either way (because the unspecified
dependency just won't be built at all - unlike with make where
generally everything does get built just in the wrong order).
Hopefully this helps...
--
Rich
prev parent reply other threads:[~2020-06-21 10:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-21 9:53 [gentoo-user] "emerge --jobs=1 ..." vs "MAKEOPTS=-j1 emerge ..." Dr Rainer Woitok
2020-06-21 10:11 ` [gentoo-user] " Holger Hoffstätte
2020-06-21 10:20 ` Rich Freeman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAGfcS_k8Vf29DGOiBU0UBwX+=JA96a0Qk8Q0w5zETxtf7oyGZA@mail.gmail.com' \
--to=rich0@gentoo.org \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox