Parallel make: set -j8 as the default option

后端 未结 3 1102
既然无缘
既然无缘 2021-02-05 01:10

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

3条回答
  •  青春惊慌失措
    2021-02-05 01:18

    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.

提交回复
热议问题