[SOLVED] How to build the SVN version of FPC - under Windows lazarus / 8-Other ---------------------------------------------------------------------- micheus · 2012-05-02 21:58 I have tried to build the fpc (http://svn.freepascal.org/svn/fpc/trunk), but I have not success. The Getting Lazarus documentation doesn't tell me much about how to build it under Windows: Compiling and installing FPC. The first problem - I didn't have Make.exe installed and I doesn't come with the fpc sources. So, I download the makew32.zip and asldw32.zip (from ftp://ftp.freepascal.org/pub/fpc/contrib/utils/win32/) and I added it to the environment variable PATH; By trying to run it I got this message: QuoteC:\Freeware\SVN_sources\fpc>make makefile:135: *** Compiler .exe not found.  Stop. By checking the Makefile (line 135) I could verify that it was related to FPC: Quote135:  $(error Compiler $(FPC) not found) I found this strange, as I'm trying to build the it - the FPC.  Anyway ... ... I downloaded and installed the latest FPC compile (2.6.0) and used Make All at the fpc directory. Now lot of makefiles were processed but I'm getting this compiler error and I have no idea about what is still absent in my dev environment: Quote... make -C win32 debug make[2]: Entering directory `C:/Freeware/SVN_sources/fpc/rtl/win32' make all DEBUG=1 make[3]: Entering directory `C:/Freeware/SVN_sources/fpc/rtl/win32' make[3]: Leaving directory `C:/Freeware/SVN_sources/fpc/rtl/win32' make[2]: Leaving directory `C:/Freeware/SVN_sources/fpc/rtl/win32' make[1]: Leaving directory `C:/Freeware/SVN_sources/fpc/rtl' make -C utils debug make[1]: Entering directory `C:/Freeware/SVN_sources/fpc/utils' make all DEBUG=1 make[2]: Entering directory `C:/Freeware/SVN_sources/fpc/utils' make -C fppkg all make[3]: Entering directory `C:/Freeware/SVN_sources/fpc/utils/fppkg' C:/Freeware/FPC/2.6.0/bin/i386-win32/ppc386.exe fpmake.pp -n -FuC:/Freeware/SVN_ sources/fpc/rtl/units/i386-win32 -FuC:/Freeware/SVN_sources/fpc/packages/paszlib /units/i386-win32 -FuC:/Freeware/SVN_sources/fpc/packages/fcl- process/units/i386 -win32 -FuC:/Freeware/SVN_sources/fpc/packages/hash/units/i386-win32 -FuC:/Freew are/SVN_sources/fpc/packages/fpmkunit/units/i386-win32 PPU Loading C:\Freeware\SVN_sources\fpc\rtl\units\i386-win32\system.ppu PPU Invalid Version 148 Fatal: Can't find unit system used by fpmake Fatal: Compilation aborted make[3]: *** [fpmake] Error 1 make[3]: Leaving directory `C:/Freeware/SVN_sources/fpc/utils/fppkg' make[2]: *** [fppkg_all] Error 2 make[2]: Leaving directory `C:/Freeware/SVN_sources/fpc/utils' make[1]: *** [fpc_debug] Error 2 make[1]: Leaving directory `C:/Freeware/SVN_sources/fpc/utils' make: *** [utils_debug] Error 2 SVN FPC base path -> C:/Freeware/SVN_sources/fpc/ FPC 2.6.0 path -> C:/Freeware/FPC/2.6.0/bin/i386-win32/ MakeW32 path -> C:/Freeware/makew32/bin/i386-win32/ I did some searches but I didn't found anything with "PPU Invalid Version 148" (only other numbers and in different situations). Does anybody can suggest me anything? TIA Micheus ---------------------------------------------------------------------- lainz · 2012-05-02 22:24 This is the article you need: http://wiki.freepascal.org/Installing_Lazarus#Installing_Free_Pascal_u nder_Windows Tested by me and works. ---------------------------------------------------------------------- Martin_fr · 2012-05-02 23:45 The one and only http://www.stack.nl/~marcov/buildfaq.pdf (This is by someone from the fpc team) The very first thing to know:    The ONLY supported way of building FPC , is with the released FPC compiler.    You must have the exact previous release to what you want to build installed. For 2.7.1, this means 2.6.0 must be installed (no other version will do, only 2.6.0) Yes some people do it different, and it may work, but there is no support, and if it breaks... your problem..... QuoteThe first problem - I didn't have Make.exe installed Should be in the fpc install Additionally, you find a set of tools here: http://svn.freepascal.org/svn/fpcbuild/trunk/install/binw32 But use that as last resource, if the install failed.   ---------- Have fpc 2.6.0 installed, say in C:\fpc\260 Have the svn of trunk/2.7.1 in C:\fpc\svn\trunk    Make an important note: If ever you update from SVN => BEFORE updating do "make clean" Put the following in a batch file makefpc.bat - for the PATH => ensure you do have the ";" in it - adapt OPT as you need - create the empty folder c:\FPC\trunk - the bat should be in C:\fpc\svn\trunk   and be executed in C:\fpc\svn\trunk (with this as current dir) PATH=C:\FPC\260\bin\i386-win32; SET FPC=C:\FPC\260\bin\i386-win32\fpc.exe make.exe clean  distclean make.exe all  OPT="-gw -godwarfset -O-1"  make.exe install  INSTALL_PREFIX=c:\FPC\trunk  COPYTREE=echo - run it, good luck - copy the fpc.cfg from the 260 install, and adapt all pathes in it ---------------------------------------------------------------------- micheus · 2012-05-03 20:06 Martin_fr, it worked fine!  Thank you for these valuable tips. Just a last question: Now that I will build Lazarus, may I use the prior version of fpc (2.6.0 - in this case) or should I use the new one in the trunk? I know I will need to set the correct path for the fpc in the Lazarus preferences dialog. Also, how can I know what is the version I'm building from trunk? As I use TortoiseSVN to download the latest files, I think I should to know about it in order to use the previous version as you had pointed me. Maybe you could suggest me the correct workflow to build Lazarus when I rebuild the fpc from thunk. Thank you. ---------------------------------------------------------------------- Martin_fr · 2012-05-03 23:23 Glad to hear About, what version trunk: Lazarus trunk is currently 1.1 Though that really can nat be called a Version. 1.1 is a dummy version. Since every day it is a different revision. Use the tortoise svn "Repro browser to explore. There is a branch http://svn.freepascal.org/svn/lazarus/branches/fixes_1_0  (created 1 Apr 2012) This branch is currently 0.9.31 and the 1.0 release will be made from this. For working I suggest to build the IDE with the released 2.6 compiler. But for debugging your apps, you will need the LCL and all packages compiled with 2.7.1 (since you build that with debug info) you can either: 1) Have several lazarus installations Then each Lazarus MUST have it's own config (never let 2 lazarus share a config) Use --primary-config-path=C:\somewhere I suggest to add it to all your lazarus, including your existing install. So none of your installations uses the default config location. This is in case you start any of them without  --primary-config- path=xxx . If you do, and you have a Lazarus that uses the default location, then you are at risk of screwing it up... 2) Build your IDE with 2.6.0. Then change the compiler. As soon as you build a project the IDE should rebuild required packages. I would suggest to enforce that, and build them yourself: - Save your 2.6.0 build Lazarus.exe - Build "clean all" with 2.7.1 - Restore the Lazarus exe. The 2.6.0 build exe will work with the 2.7.1 fpc. No problems ---------------------------------------------------------------------- micheus · 2012-05-04 12:07 I will try these suggestions this weekend. Thank you. ---------------------------------------------------------------------- micheus · 2012-05-08 20:42 It worked and I could build Lazarus by using it too. What I have now:  - SVN base dir -> C:\Freeware\SVN_sources  - FPC svn sources -> C:\Freeware\SVN_sources\FPC  - Lazarus svn sources -> C:\Freeware\SVN_sources\Lazarus  - FPC compiled base dir -> C:\Freeware\FPC\trunk  - Lazarus compiled base dir -> C:\Freeware\Lazarus\trunk I have these two batch files: Quote from: MAKEFPC.BATSET PATH=%PATH%;C:\Freeware\FPC\2.6.0\bin\i386-win32; SET FPC=C:\Freeware\FPC\2.6.0\bin\i386-win32\fpc.exe cd .\fpc make.exe clean distclean make.exe all  OPT="-gw -godwarfset -O-1" make.exe install  INSTALL_PREFIX=C:\Freeware\FPC\trunk  COPYTREE=echo cd .. Quote from: MAKELAZ.BATSET PATH=%PATH%;C:\Freeware\FPC\trunk\bin\i386-win32; SET FPC=C:\Freeware\FPC\trunk\bin\i386-win32\fpc.exe cd .\lazarus make.exe clean make.exe all  OPT="-g -O-1" make.exe install  INSTALL_PREFIX=C:\Freeware\lazarus\trunk cd .. and the shortcut is: C:\Freeware\lazarus\trunk\startlazarus.exe --primary-config-path=C:\Freeware\lazarus\trunk Versions are: Laz 1.1 +FPC 2.7.1 By starting Lazarus, in Lazarus IDE Configuration I entered these paths: Lazarus: .\Compiler: C:\Freeware\FPC\trunk\bin\i386-win32\fpc.exeFPC source: C:\Freeware\SVN_sources\fpc Note: If in the fpc.cfg I enable the "Optimizer switches for i386 compiler" (-Op386) the IDE didn't start and the IDE configuration is shown asking me about the Compiler and with this message below: Error: system.ppu not found. Check your fpc.cfg. But it's nothing a big problem - I can leave it disable, no problem. Thanks /Micheus ---------------------------------------------------------------------- micheus · 2012-05-11 15:57 Every time one problem is solved a new appears... : Building the SVN version of Lazarus - under Windows