Topic: ninja - number of threads by compilation

Tibor

Topic Opener
Joined: 2009-03-23, 23:24 UTC+1.0
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2014-10-26, 00:44 UTC+2.0

Hi,

New compilation is using ninja - AFAIK. But it kills my PC due to low memory. I have i3 procesor = 4 cores => 6 threads. And only 4 GB memory.

6 threads is too much, so how can I decrease number of threads? Permanently, in a config file probably. Or environmental variable?

I have linux

Thanks!


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56 UTC+2.0
Posts: 3317
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2014-10-26, 13:17 UTC+1.0

http://martine.github.io/ninja/manual.html#_running_ninja

e.g ninja -C build -j 20 changes into the build directory and runs 20 build commands in parallel.

You will have to edit the compile.sh for this though, which can be a pain in the butt with merging branches. Maybe we could have this as a command line parameter to compile.sh?


Busy indexing nil values

Top Quote
wl-zocker

Joined: 2011-12-30, 17:37 UTC+1.0
Posts: 492
Ranking
Tribe Member
Location: Germany
Posted at: 2014-10-26, 16:53 UTC+1.0

I also would appreciate some control of the number of threads. My computer freezes almost everytime I compile.


"Only few people know how much one has to know in order to know how little one knows." - Werner Heisenberg

Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 23:24 UTC+1.0
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2014-10-26, 21:24 UTC+1.0

I am glad I am not the one feeling this as a problem.

Command line parameter to compile.sh would be quite good, but I would prefer environmental variable like:

WIDELANDS_NINJA_THREADS=3

and this would be put into bashrc or so. Then I would not need to remember this at all.

Edited: 2014-10-26, 21:25 UTC+1.0

Top Quote