Latest Posts

Topic: How to compile faster?

kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 19:48
Posts: 2442
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-12-02, 08:02

When compiling via compile.sh it tooks more then half an hour to compile on my computer. Half an hour is the time depending on a fresh download. Once it is compiled recompiling gets a bit faster. Is there a way to make compiling faster for test purposes?

I tried to use ninja, but it fails when compiling.


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
Tmk
Avatar
Joined: 2010-05-08, 17:06
Posts: 44
Ranking
Pry about Widelands
Posted at: 2015-12-02, 14:54

You could extend the make command in the compile.sh with the jobs option: make -j X, where X is the number of threads your CPU can handle.

Edited: 2015-12-02, 14:56

Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2015-12-03, 20:23

kaputtnik wrote:

Once it is compiled recompiling gets a bit faster. Is there a way to make compiling faster for test purposes?

Because second time it compiles only changed files - if any

I tried to use ninja, but it fails when compiling.

Why it failed - not enough RAM? I have 4 GB RAM and am not able to compile with ninja...


Top Quote
kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 19:48
Posts: 2442
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-12-03, 20:36

Tibor wrote:

Why it failed - not enough RAM? I have 4 GB RAM and am not able to compile with ninja...

I have about 3Gb...

Thanks Tmk, but this will not increase the speed on my system.


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2015-12-03, 20:42

You could try this: https://ccache.samba.org/

I have never set this up myself though.


Busy indexing nil values

Top Quote
QCS

Joined: 2009-12-29, 21:47
Posts: 256
Ranking
Tribe Member
Posted at: 2015-12-04, 09:48

ccache will help compiling the same compilation again, as if you are doing "ninja clean && ninja" (or the same with "make" instead of "ninja", depending on your flavour).

It will not help compiling faster after git pull or manual modifications to source files and doing "ninja" or "make" like in development situations, as it is not the "same compilation" usually.

Other than that, ccache is a real PITA, causing linking errors you can not explain and having to remove the whole cache to solve.

What could help you would be a distcc setup if you have a decent machine not capable of playing widelands but aiding you as compilation workhorse.


CMake is evil.

Top Quote