[fpc-devel] make fpc -j (--jobs) / Windows

Jonas Maebe jonas at freepascal.org
Fri Nov 22 17:54:35 CET 2019


On 22/11/2019 17:37, Martin wrote:
> I read several mailsĀ  in the past that pointed out how fast fpc would
> compile itself, if one uses "make --jobs=10" or similar.
> 
> If that is true, then first question: Does it work on Windows?

Yes, but afaik not in the way that fpcmake-generated files uses make. It
only works on Windows if you instantiate new make instances from the
makefile, but we use $(MAKE) everywhere, which reuses the same make
process (which supports parallelism on Unix platforms, but not on Windows).

That said,
1) the Windows RTL uses a build unit (to work around the slow compiler
process launching on Windows), so parallelism wouldn't help there anyway
2) the packages and utils directories use fpmake, which has its own
multithreading support. You can enable that by specifying FPMAKEOPT="-T
10" or similar. It is not possible to query the -j option from inside a
makefile, so it cannot be specified automatically to fpmake.

There are still some multithreading bugs in fpmake though, so
occasionally it will either crash or complain about missing dependencies
if you tell it to use more than one thread.


Jonas


More information about the fpc-devel mailing list