Skip to contentSkip to conversation

doc: Mention OE routine for setting BB_NUMBER_THREADS

PATCH Superseded Robert P. J. Day 2 participants 5 messages Mar 17, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc: Mention OE routine for setting BB_NUMBER_THREADS

Given the discussion of BB_NUMBER_THREADS, what it means and how to set it, it seems only fair to mention that it's probably already set.

---

doc/bitbake-user-manual/bitbake-user-manual-execution.rst +7 -0
index d74e768f..a2003997 100644
@@ -45,6 +45,13 @@ the BitBake command and its options, see ":ref:`The BitBake Command
    A possibly simpler solution is that some Linux distributions (e.g.
    Debian and Ubuntu) provide the ``ncpus`` command.
 
+   If you're using a relatively recent version of Poky or Openembedded,
+   the provided ``bitbake.conf`` file already comes with a call to an OE
+   utility routine that does this calculation for you::
+
+     # Default to setting automatically based on cpu count
+     BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}"
+
 Parsing the Base Configuration Metadata
 =======================================
 
Signature · 6 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                         http://crashcourse.ca

LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
#1 lore raw
Quoted 13 lines · Robert P. J. Day

Given the discussion of BB_NUMBER_THREADS, what it means and how to set it, it seems only fair to mention that it's probably already set.

---

doc/bitbake-user-manual/bitbake-user-manual-execution.rst +0 -0
index d74e768f..a2003997 100644

doc/bitbake-user-manual/bitbake-user-manual-execution.rst the BitBake command and its options, see ":ref:`The BitBake Command · line 48

Quoted 4 lines
doc/bitbake-user-manual/bitbake-user-manual-execution.rst +1 -0
@@ -45,6 +45,13 @@ the BitBake command and its options, see ":ref:`The BitBake Command
    A possibly simpler solution is that some Linux distributions (e.g.
    Debian and Ubuntu) provide the ``ncpus`` command.
 
+   If you're using a relatively recent version of Poky or Openembedded,

I think it would be better to avoid distro names in generic documentation

Quoted 21 lines
doc/bitbake-user-manual/bitbake-user-manual-execution.rst +6 -1
+   the provided ``bitbake.conf`` file already comes with a call to an OE
+   utility routine that does this calculation for you::
+
+     # Default to setting automatically based on cpu count
+     BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}"
+
 Parsing the Base Configuration Metadata
 =======================================
 
 
--

========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================

#2 lore raw
Quoted 17 lines · Khem Raj
Quoted 16 lines · Robert P. J. Day

Given the discussion of BB_NUMBER_THREADS, what it means and how to set it, it seems only fair to mention that it's probably already set.

---

doc/bitbake-user-manual/bitbake-user-manual-execution.rst +0 -0
index d74e768f..a2003997 100644
@@ -45,6 +45,13 @@ the BitBake command and its options, see ":ref:`The BitBake Command
    A possibly simpler solution is that some Linux distributions (e.g.
    Debian and Ubuntu) provide the ``ncpus`` command.
 
Quoted 3 lines

doc/bitbake-user-manual/bitbake-user-manual-execution.rst the BitBake command and its options, see ":ref:`The BitBake Command · line 48

Quoted 1 line
doc/bitbake-user-manual/bitbake-user-manual-execution.rst +1 -0
+   If you're using a relatively recent version of Poky or Openembedded,

I think it would be better to avoid distro names in generic documentation

... snip ...

normally, i'd agree, but given that 99.4237 per cent of bitbake
usage is in the context of OE or YP, if you're going to tell people about BB_NUMBER_THREADS, it is not out of line to point out that they almost certainly have that value calculated for them automatically already.

rday

#3 lore raw
Quoted 24 lines · Robert P. J. Day
Quoted 17 lines · Khem Raj
Quoted 16 lines · Robert P. J. Day

Given the discussion of BB_NUMBER_THREADS, what it means and how to set it, it seems only fair to mention that it's probably already set.

---

doc/bitbake-user-manual/bitbake-user-manual-execution.rst +0 -0
index d74e768f..a2003997 100644
@@ -45,6 +45,13 @@ the BitBake command and its options, see ":ref:`The BitBake Command
    A possibly simpler solution is that some Linux distributions (e.g.
    Debian and Ubuntu) provide the ``ncpus`` command.
 
Quoted 3 lines

doc/bitbake-user-manual/bitbake-user-manual-execution.rst the BitBake command and its options, see ":ref:`The BitBake Command · line 48

Quoted 1 line
doc/bitbake-user-manual/bitbake-user-manual-execution.rst +1 -0
+   If you're using a relatively recent version of Poky or Openembedded,

I think it would be better to avoid distro names in generic documentation

Quoted 7 lines

... snip ...

normally, i'd agree, but given that 99.4237 per cent of bitbake
usage is in the context of OE or YP, if you're going to tell people about BB_NUMBER_THREADS, it is not out of line to point out that they almost certainly have that value calculated for them automatically already.

OpenEmbedded is perhaps more appropriate here, since its the build system and would tend to cover all
OE based distributions including poky

Quoted 2 lines

rday

#4 lore raw
Quoted 33 lines · Khem Raj
Quoted 24 lines · Robert P. J. Day
Quoted 17 lines · Khem Raj
Quoted 16 lines · Robert P. J. Day

Given the discussion of BB_NUMBER_THREADS, what it means and how to set it, it seems only fair to mention that it's probably already set.

---

doc/bitbake-user-manual/bitbake-user-manual-execution.rst +0 -0
index d74e768f..a2003997 100644
@@ -45,6 +45,13 @@ the BitBake command and its options, see ":ref:`The BitBake Command
    A possibly simpler solution is that some Linux distributions (e.g.
    Debian and Ubuntu) provide the ``ncpus`` command.
 
Quoted 3 lines

doc/bitbake-user-manual/bitbake-user-manual-execution.rst the BitBake command and its options, see ":ref:`The BitBake Command · line 48

Quoted 1 line
doc/bitbake-user-manual/bitbake-user-manual-execution.rst +1 -0
+   If you're using a relatively recent version of Poky or Openembedded,

I think it would be better to avoid distro names in generic documentation

Quoted 7 lines

... snip ...

normally, i'd agree, but given that 99.4237 per cent of bitbake
usage is in the context of OE or YP, if you're going to tell people about BB_NUMBER_THREADS, it is not out of line to point out that they almost certainly have that value calculated for them automatically already.

Quoted 3 lines

OpenEmbedded is perhaps more appropriate here, since its the build system and would tend to cover all
OE based distributions including poky

i'm good with that, will re-submit.

rday