Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2019-11

make fpc -j (--jobs) / Windows

4 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin

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?

Using make from
https://svn.freepascal.org/svn/fpcbuild/trunk
folder install\binw64
Having checked from the windows task manager, that this is indeed the make.exe that is being used

make.exe --jobs=8 all

Calling make --help identifies make knows the argument.

I get an average cpu usage of 8 to 9 % (6 Cores / 12 threads means this is one core).
Throughout the entire compile, the peak load is 15%

System
Windows 10 64 bits
I7 8700K  (6cores / 12 threads) / 32 gb ram / no swapfile, so there is no swapping, and there is plenty of free ram
All data on SSD (M2)

The task manager shows (while building a 32 bit fpc ):
- several make.exe (no cpu usage), but there will be several even for one task, as make descends into directories
- one fpmake
- one ppc386.exe

So for all I can say, no speedup due to --jobs.

Reply by email

Jonas Maebe
to Martin
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

Reply by email

Florian Klämpfl
to Jonas Maebe: Yes, but afaik not in the way that fpcmake-generated files uses make. It only works on…
Jonas Maebe wrote 10 lines
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).

The make delivered with 3.0.x does this.

Reply by email