RTL rebuild optimization lazarus / 64-FPC development ---------------------------------------------------------------------- avra · 2021-07-13 11:48 I have used fpcupdeluxe to download trunks of FPC and LAZ into c:/Prg/Lazarus/TrunkAll. For testing purpose I have made a small RTL change to sysutils.pp and used these to recompile RTL: Quotec:\Prg\Lazarus\TrunkAll\fpcsrc> c:\Prg\Lazarus\fpc.3.2.2\bin\i386-win32\make.exe clean distclean c:\Prg\Lazarus\TrunkAll\fpcsrc> c:\Prg\Lazarus\fpc.3.2.2\bin\i386-win32\make.exe all c:\Prg\Lazarus\TrunkAll\fpcsrc> c:\Prg\Lazarus\fpc.3.2.2\bin\i386-win32\make.exe install INSTALL_PREFIX=c:\Prg\Lazarus\TrunkAll\fpc My test project which uses that small RTL change compiles from both command line and Lazarus, and Lazarus can rebuild (if needed) without problems. Everything works fine but takes time. The question is (since I am going to do this a lot), is there a way to speed this up? Is it safe to avoid make clean distclean, and do I really need full make all? I will only change several sub files of sysutils. ---------------------------------------------------------------------- marcov · 2021-07-13 11:52 Only if your programs don't depend on units that depend on sysutils. I do this a lot when debugging package chm, just recompile and move it over the old units. But few units depend on units in package CHM (only lhelp, but that can be kept as exe without recompilation). So in short: yes, you can, but for a core unit as sysutils this is pretty useless. ---------------------------------------------------------------------- avra · 2021-07-13 11:58 Quote from: marcov on July 13, 2021, 01:52:28 pmSo in short: yes, you can, but for a core unit as sysutils this is pretty useless.I was afraid that would be the case. Thanks! ---------------------------------------------------------------------- Jonas Maebe · 2021-07-13 16:49 You can just use distclean, it already includes clean. You can add the following options to make to speed it up: -j X FPMAKEOPT="-T X", with X = the number of parallel processes to use ---------------------------------------------------------------------- avra · 2021-07-13 20:28 Quote from: Jonas Maebe on July 13, 2021, 06:49:48 pmYou can just use distclean, it already includes clean.Thanks! Quote from: Jonas Maebe on July 13, 2021, 06:49:48 pmYou can add the following options to make to speed it up: -j X FPMAKEOPT="-T X", with X = the number of parallel processes to useYou nailed it. That was going to be my next search/question, but didn't have a chance with such mind reading devs. ---------------------------------------------------------------------- avra · 2021-07-14 06:22 Initial FPC rebuild time on XEON W-2125 with 4 cores and 8 threads on M.2 SSD was 6 minutes and 55 seconds. Removing clean reduced it to 6 minutes and 0 seconds. Adding 8 threads reduced it further to 4 minutes and 15 seconds. Much nicer. Thanks! ---------------------------------------------------------------------- avra · 2021-07-14 07:05 I've lost much more time then I liked in finding such basic info, so I have created a wiki page with rebuild automation script: https://wiki.freepascal.org/FPC_recompilation_automation Hope it helps someone