ThibaultLemaire/HomeworldSDL

Make it possible to use all cores during compilation

Opened this issue · 1 comments

By just running make, only one CPU core is used for compilation.

I tried using make -j $(nproc) but it fails pretty early:

../../../tools/kas2c/lexer.l:7:10: fatal error: parser.h: No such file or directory
 #include "parser.h"
          ^~~~~~~~~~

If run again after this, it goes through and outputs a working executable. There seems to be a step early in the compilation process that can't be done while other jobs run.

I got a 2min 58s compilation time on single core, and a 1min 37s compilation time on four cores.

After running ../configure, the folder Linux/tools/kas2c contains just a Makefile. Upon running make, it seems to first copy files within the directory. This seems to be the problem that prevents running multiple jobs as the files needed for other jobs aren't copied yet