Skip to content

Commit 4be7737

Browse files
committed
Ensure make -j uses a reasonable argument
1 parent 26de2ef commit 4be7737

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

developer-workflow/extension-modules.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ Now that the configuration is in place, it remains to compile the project:
547547
548548
.. tip::
549549

550-
Use ``make -j`` to speed-up compilation by utilizing as many CPU cores
550+
Use ``make -j $(nproc)`` to speed-up compilation by utilizing as many CPU cores
551551
as possible or ``make -jN`` to allow at most *N* concurrent jobs.
552552

553553
* ``make regen-configure`` updates the :cpy-file:`configure` script.

getting-started/setup-building.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,13 @@ do to get a pydebug build of CPython.
203203

204204
Once ``configure`` is done, you can then compile CPython with::
205205

206-
$ make -s -j2
206+
$ make -s -j $(nproc)
207207

208208
This will build CPython with only warnings and errors being printed to
209-
stderr and utilize up to 2 CPU cores. If you are using a multi-core machine
210-
with more than 2 cores (or a single-core machine), you can adjust the number
211-
passed into the ``-j`` flag to match the number of cores you have (or if your
212-
version of Make supports it, you can use ``-j`` without a number and Make
213-
will not limit the number of steps that can run simultaneously.).
209+
stderr. The ``-j`` argument means that :program:`make` will concurrently run
210+
tasks, limiting the number of parallel jobs to the number of CPU cores in your
211+
computer. You can adjust the number passed to the ``-j`` flag to change
212+
the limit on parallel jobs, which can trade RAM usage vs compilation time.
214213

215214
At the end of the build you should see a success message, followed
216215
by a list of extension modules that haven't been built because their
@@ -875,7 +874,7 @@ some of CPython's modules (for example, ``zlib``).
875874

876875
And finally, run ``make``::
877876

878-
$ make -s -j2
877+
$ make -s -j $(nproc)
879878

880879
There will sometimes be optional modules added for a new release which
881880
won't yet be identified in the OS-level build dependencies. In those cases,

index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ instructions please see the :ref:`setup guide <setup>`.
4343

4444
.. code-block:: shell
4545
46-
./configure --with-pydebug && make -j
46+
./configure --with-pydebug && make -j $(nproc)
4747
4848
.. tab:: macOS
4949

5050
.. code-block:: shell
5151
52-
./configure --with-pydebug && make -j
52+
./configure --with-pydebug && make -j $(nproc)
5353
5454
.. tab:: Windows
5555

0 commit comments

Comments
 (0)