Changeset 7546d8b for chapter04/settingenviron.xml
- Timestamp:
- 11/21/2023 12:45:26 AM (8 months ago)
- Branches:
- xry111/clfs-ng
- Children:
- e49e2ea
- Parents:
- 2df066c9 (diff), 01247ac (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter04/settingenviron.xml
r2df066c9 r7546d8b 199 199 </important> 200 200 201 <para> 202 For many modern systems with multiple processors (or cores) the 203 compilation time for a package can be reduced by performing a "parallel 204 make" by telling the make program how many processors are available via 205 a command line option or an environment variable. For instance, an Intel 206 Core i9-13900K processor has 8 P (performance) cores and 207 16 E (efficiency) cores, and a P core can simultaneously run two threads 208 so each P core are modeled as two logical cores by the Linux kernel. 209 As the result there are 32 logical cores in total. One obvious way to 210 use all these logical cores is allowing <command>make</command> to spawn 211 up to 32 build jobs. This can be done by passing the 212 <parameter>-j32</parameter> option to <command>make</command>: 213 </para> 214 215 <screen role='nodump'><userinput>make -j32</userinput></screen> 216 217 <para> 218 Or set the <envar>MAKEFLAGS</envar> environment variable and its 219 content will be automatically used by <command>make</command> as 220 command line options: 221 </para> 222 223 <screen role='nodump'><userinput>export MAKEFLAGS=-j32</userinput></screen> 224 225 <important> 226 <para> 227 Never pass a <parameter>-j</parameter> option without a number to 228 <command>make</command> or set such an option in 229 <envar>MAKEFLAGS</envar>. Doing so will allow <command>make</command> 230 to spawn infinite build jobs and cause system stability issue. 231 </para> 232 </important> 233 234 <para> 235 To use all logical cores available for building packages in 236 <xref linkend='chapter-cross-tools'/> and 237 <xref linkend='chapter-temporary-tools'/>, set <envar>MAKEFLAGS</envar> 238 now in <filename>.bashrc</filename>: 239 </para> 240 241 <screen><userinput>cat >> ~/.bashrc << "EOF" 242 <literal>export MAKEFLAGS=-j<replaceable>$(nproc)</replaceable></literal> 243 EOF</userinput></screen> 244 245 <para> 246 Replace <replaceable>$(nproc)</replaceable> with the number of logical 247 cores you want to use if you don't want to use all the logical cores. 248 </para> 249 201 250 <para>Finally, to ensure the environment is fully prepared for building the 202 251 temporary tools, force the <command>bash</command> shell to read
Note:
See TracChangeset
for help on using the changeset viewer.