并行制作:将-j8设置为默认选项 [英] Parallel make: set -j8 as the default option
问题描述
我可以使用 -j
参数设置构建过程的线程数.例如,我有4个核心+4个虚拟.当我写: make -j8
时,速度增加了4倍.
是否可以将该值设置为默认值?(例如,在Linux Gentoo的配置文件中,可以设置此默认值.)
p.s.我有Arch Linux
您的问题与线程无关,而是由make执行的进程(作业).
在控制台上使用make时,一种简单的设置方法是:
alias make ="/usr/bin/make -j 8"
到您的 .profile
文件.
您还可以使用 setenv MAKEFLAGS'-j 8'
,但是在某些情况下 MAKEFLAGS
可以忽略此参数,因为要保持所需的进程数需要与递归进行
调用.幸运的是,该方法可与当前版本的GNU Make一起使用.>
I can set number of threads for the build process using -j
argument. For example, I have 4 cores +4 virtual. When I write: make -j8
the speed increases 4 times.
Is it possible to set that value as default? (For example, in Linux Gentoo, in config file, it's possible to set this default value).
p.s. I have Arch Linux
Your question is not about threads, but processes (jobs) executed by make.
The simple, way to set this, when make is used from the console is adding:
alias make="/usr/bin/make -j 8"
to your .profile
file.
You can also use setenv MAKEFLAGS '-j 8'
, but MAKEFLAGS
can ignore this parameter in some scenarios, because keeping desired number of processes requires communicating with recursive make
calls. Happily this method works with current versions of GNU Make.
这篇关于并行制作:将-j8设置为默认选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!