From ece2ef539c4881c691322386d6194cc0e7fa4cc0 Mon Sep 17 00:00:00 2001 From: Enhex Date: Wed, 23 Dec 2020 08:17:42 +0200 Subject: [PATCH 01/10] use `nproc` instead of hardcoded number of threads. on linux nproc command prints the number of virtual cores available, and putting it inside grave accents will evaluate the command and replace it with its output. --- development/compiling/compiling_for_linuxbsd.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/development/compiling/compiling_for_linuxbsd.rst b/development/compiling/compiling_for_linuxbsd.rst index 6f8f01a7542..14c23f27ec4 100644 --- a/development/compiling/compiling_for_linuxbsd.rst +++ b/development/compiling/compiling_for_linuxbsd.rst @@ -98,10 +98,11 @@ Start a terminal, go to the root dir of the engine source code and type: :: - scons -j8 platform=linuxbsd + scons -j`nproc` platform=linuxbsd A good rule of thumb for the ``-j`` (*jobs*) flag, is to have at least as many threads compiling Godot as you have cores in your CPU, if not one or two more. +```nproc``` can be used to automatically use the number of cores your system has. Feel free to add the ``-j`` option to any SCons command you see below. .. note:: From aa55b2f2db0bddc9ad48e2c19941e4f6238e9b10 Mon Sep 17 00:00:00 2001 From: Enhex Date: Wed, 23 Dec 2020 22:20:22 +0200 Subject: [PATCH 02/10] Update development/compiling/compiling_for_linuxbsd.rst Co-authored-by: Hugo Locurcio --- development/compiling/compiling_for_linuxbsd.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/development/compiling/compiling_for_linuxbsd.rst b/development/compiling/compiling_for_linuxbsd.rst index 14c23f27ec4..6bd7346b66f 100644 --- a/development/compiling/compiling_for_linuxbsd.rst +++ b/development/compiling/compiling_for_linuxbsd.rst @@ -98,7 +98,7 @@ Start a terminal, go to the root dir of the engine source code and type: :: - scons -j`nproc` platform=linuxbsd + scons -j$(nproc) platform=linuxbsd A good rule of thumb for the ``-j`` (*jobs*) flag, is to have at least as many threads compiling Godot as you have cores in your CPU, if not one or two more. From 8dc4b251145d837753976ded9cfa9fea487b9ff9 Mon Sep 17 00:00:00 2001 From: Enhex Date: Wed, 23 Dec 2020 22:50:44 +0200 Subject: [PATCH 03/10] show how to automatically all cores instead of using nproc directly, because it isn't available on BSD --- development/compiling/compiling_for_linuxbsd.rst | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/development/compiling/compiling_for_linuxbsd.rst b/development/compiling/compiling_for_linuxbsd.rst index 6bd7346b66f..f044036021a 100644 --- a/development/compiling/compiling_for_linuxbsd.rst +++ b/development/compiling/compiling_for_linuxbsd.rst @@ -98,13 +98,22 @@ Start a terminal, go to the root dir of the engine source code and type: :: - scons -j$(nproc) platform=linuxbsd + scons -j8 platform=linuxbsd A good rule of thumb for the ``-j`` (*jobs*) flag, is to have at least as many threads compiling Godot as you have cores in your CPU, if not one or two more. -```nproc``` can be used to automatically use the number of cores your system has. Feel free to add the ``-j`` option to any SCons command you see below. +You can automatically use all available cores with command subtitution. + +On Linux you can use ``nproc``: +:: + scons -j$(nproc) + +On BSD you can use ``sysctl -n hw.ncpu``: +:: + scons -j$(sysctl -n hw.ncpu) + .. note:: Prior to Godot 4.0, the Linux/\*BSD target was called ``x11`` instead of From f21444ce84f4a234a0f53691fc130616a4092ec8 Mon Sep 17 00:00:00 2001 From: Enhex Date: Wed, 23 Dec 2020 22:53:16 +0200 Subject: [PATCH 04/10] fix typo --- development/compiling/compiling_for_linuxbsd.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/development/compiling/compiling_for_linuxbsd.rst b/development/compiling/compiling_for_linuxbsd.rst index f044036021a..7845db20e2f 100644 --- a/development/compiling/compiling_for_linuxbsd.rst +++ b/development/compiling/compiling_for_linuxbsd.rst @@ -104,7 +104,7 @@ A good rule of thumb for the ``-j`` (*jobs*) flag, is to have at least as many threads compiling Godot as you have cores in your CPU, if not one or two more. Feel free to add the ``-j`` option to any SCons command you see below. -You can automatically use all available cores with command subtitution. +You can automatically use all available cores with command substitution. On Linux you can use ``nproc``: :: From b2ac4f6039db7608ba2dd98f140c45310ae655f0 Mon Sep 17 00:00:00 2001 From: Enhex Date: Wed, 23 Dec 2020 22:57:19 +0200 Subject: [PATCH 05/10] CI fix --- development/compiling/compiling_for_linuxbsd.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/development/compiling/compiling_for_linuxbsd.rst b/development/compiling/compiling_for_linuxbsd.rst index 7845db20e2f..bb32b9ff355 100644 --- a/development/compiling/compiling_for_linuxbsd.rst +++ b/development/compiling/compiling_for_linuxbsd.rst @@ -45,7 +45,7 @@ Distro-specific one-liners | **Debian** / | :: | | **Ubuntu** | | | | sudo apt-get install build-essential scons pkg-config libx11-dev libxcursor-dev libxinerama-dev \ | -| | libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libudev-dev libxi-dev libxrandr-dev yasm | +| | libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libudev-dev libxi-dev libxrandr-dev yasm |subtitution +------------------+-----------------------------------------------------------------------------------------------------------+ | **Fedora** | :: | | | | @@ -109,7 +109,7 @@ You can automatically use all available cores with command substitution. On Linux you can use ``nproc``: :: scons -j$(nproc) - + On BSD you can use ``sysctl -n hw.ncpu``: :: scons -j$(sysctl -n hw.ncpu) From c51597b660a929964c52da2c06a2903ffaefbb44 Mon Sep 17 00:00:00 2001 From: Enhex Date: Thu, 24 Dec 2020 00:50:34 +0200 Subject: [PATCH 06/10] fix typo --- development/compiling/compiling_for_linuxbsd.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/development/compiling/compiling_for_linuxbsd.rst b/development/compiling/compiling_for_linuxbsd.rst index bb32b9ff355..72c10ec8d03 100644 --- a/development/compiling/compiling_for_linuxbsd.rst +++ b/development/compiling/compiling_for_linuxbsd.rst @@ -45,7 +45,7 @@ Distro-specific one-liners | **Debian** / | :: | | **Ubuntu** | | | | sudo apt-get install build-essential scons pkg-config libx11-dev libxcursor-dev libxinerama-dev \ | -| | libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libudev-dev libxi-dev libxrandr-dev yasm |subtitution +| | libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libudev-dev libxi-dev libxrandr-dev yasm | +------------------+-----------------------------------------------------------------------------------------------------------+ | **Fedora** | :: | | | | From 949ebf060e7b126db96bc3113d4de206a1688c57 Mon Sep 17 00:00:00 2001 From: Enhex Date: Thu, 24 Dec 2020 00:56:16 +0200 Subject: [PATCH 07/10] try to fix CI complaint about indentation --- development/compiling/compiling_for_linuxbsd.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/development/compiling/compiling_for_linuxbsd.rst b/development/compiling/compiling_for_linuxbsd.rst index 72c10ec8d03..a53327ab917 100644 --- a/development/compiling/compiling_for_linuxbsd.rst +++ b/development/compiling/compiling_for_linuxbsd.rst @@ -107,10 +107,12 @@ Feel free to add the ``-j`` option to any SCons command you see below. You can automatically use all available cores with command substitution. On Linux you can use ``nproc``: + :: scons -j$(nproc) On BSD you can use ``sysctl -n hw.ncpu``: + :: scons -j$(sysctl -n hw.ncpu) From bf4175725a5bce87ac4914be26b4f201bdf9059c Mon Sep 17 00:00:00 2001 From: Enhex Date: Thu, 24 Dec 2020 00:59:35 +0200 Subject: [PATCH 08/10] fix syntax --- development/compiling/compiling_for_linuxbsd.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/development/compiling/compiling_for_linuxbsd.rst b/development/compiling/compiling_for_linuxbsd.rst index a53327ab917..bb2da95a741 100644 --- a/development/compiling/compiling_for_linuxbsd.rst +++ b/development/compiling/compiling_for_linuxbsd.rst @@ -109,11 +109,13 @@ You can automatically use all available cores with command substitution. On Linux you can use ``nproc``: :: + scons -j$(nproc) On BSD you can use ``sysctl -n hw.ncpu``: :: + scons -j$(sysctl -n hw.ncpu) .. note:: From df0a8bb64a2473d0c7528aa01adb4daf5ebee7d0 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 24 Dec 2020 14:48:09 +0100 Subject: [PATCH 09/10] Apply suggestions from code review --- development/compiling/compiling_for_linuxbsd.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/development/compiling/compiling_for_linuxbsd.rst b/development/compiling/compiling_for_linuxbsd.rst index bb2da95a741..fe79ae0d61c 100644 --- a/development/compiling/compiling_for_linuxbsd.rst +++ b/development/compiling/compiling_for_linuxbsd.rst @@ -106,13 +106,13 @@ Feel free to add the ``-j`` option to any SCons command you see below. You can automatically use all available cores with command substitution. -On Linux you can use ``nproc``: +On Linux, you can use ``nproc``: :: scons -j$(nproc) -On BSD you can use ``sysctl -n hw.ncpu``: +On BSD, you can use ``sysctl -n hw.ncpu``: :: From d2da2ef55b53a8d885b8460117e661e0665628e1 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 24 Dec 2020 14:48:37 +0100 Subject: [PATCH 10/10] Apply suggestions from code review --- development/compiling/compiling_for_linuxbsd.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/development/compiling/compiling_for_linuxbsd.rst b/development/compiling/compiling_for_linuxbsd.rst index fe79ae0d61c..688359faa01 100644 --- a/development/compiling/compiling_for_linuxbsd.rst +++ b/development/compiling/compiling_for_linuxbsd.rst @@ -104,7 +104,7 @@ A good rule of thumb for the ``-j`` (*jobs*) flag, is to have at least as many threads compiling Godot as you have cores in your CPU, if not one or two more. Feel free to add the ``-j`` option to any SCons command you see below. -You can automatically use all available cores with command substitution. +You can automatically use all available CPU cores with command substitution. On Linux, you can use ``nproc``: @@ -112,7 +112,7 @@ On Linux, you can use ``nproc``: scons -j$(nproc) -On BSD, you can use ``sysctl -n hw.ncpu``: +On \*BSD, you can use ``sysctl -n hw.ncpu``: ::