Lazarus

Free Pascal => FPC development => Topic started by: sergioafern on March 13, 2018, 03:44:55 pm

Title: compiling fpc under windows 7
Post by: sergioafern on March 13, 2018, 03:44:55 pm
ok, this is the first time I  try to co0mpile the FPC from source code.
what I try to do after downloading the source code.
is open a file called pp.lpi with lazarus, and an run -> compile.

however I get an error at line 286:
{$error Cross-compiling from systems without support for an 80 bit extended floating point type to i386 is not yet supported at this time }

so, here is my question... where can I find instructions on how to compile the FPC compiler from the source code.
Title: Re: compiling fpc under windows 7
Post by: Bart on March 13, 2018, 03:51:11 pm
Fastest way:

Code: [Select]
cd path/to/fpc
make all
make install

This requires that you have 32-bit fpc 3.0.4 in your path.
It will build fpc and install it to the default path: c:\pp
It'll take a while, because it will cycle building the compiler.

Bart
Title: Re: compiling fpc under windows 7
Post by: sergioafern on March 13, 2018, 04:21:55 pm
OK, thanks.. I did that. it created a file called ppc1.exe

I created a simple hello world program.
when I try to compile it (using ppc1 hello.pas) I get this error:
fatal: can't find unit system used by hello.
fatal: compilation aborted.
Title: Re: compiling fpc under windows 7
Post by: Thaddy on March 13, 2018, 04:59:33 pm
If you stopped the compilation at ppc1 then you made a mistake. It needs to become ppc2, ppc3, until it subsequently becomes named ppc386 or ppcx86 or ppcarm etc depending on platform.
After that, the make rtl and packages will be automatically compiled with that last compiler. On a slow intel system that will take about 20 minutes. On the Raspberry Pi 3 the same.
You should not interrupt the make but let it run until everything is finished.
Title: Re: compiling fpc under windows 7
Post by: sergioafern on March 13, 2018, 06:15:23 pm
I did not interrupt it.. but I did see  many error 2 message.
Title: Re: compiling fpc under windows 7
Post by: sergioafern on March 13, 2018, 06:21:22 pm
ok, I got it to compile an executable called ppcx64.exe

however, trying to compile a simple hello world program still give me the error:

fatal: can't find unit system used by hello

Title: Re: compiling fpc under windows 7
Post by: marcov on March 13, 2018, 06:51:32 pm
Search for "freepascal buildfaq". Get the pdf.
Title: Re: compiling fpc under windows 7
Post by: Bart on March 14, 2018, 12:07:03 am
ok, I got it to compile an executable called ppcx64.exe

however, trying to compile a simple hello world program still give me the error:

fatal: can't find unit system used by hello

You should not try to compile calling ppcx64.exe that resides in the path\to\fpcsource\compiler directory.
Instead, if "make install" worked as expected (no errors), then fpc.exe will be in c:\pp\bin\x86_64 (?) (mine is in i386-win32 subdir, not sure how the 64-bit one is called). Also inside that folder there should be a fpc.cfg file, which a plain "make install" does not create.
Without the fpc.cfg file the compiler will not find any unit at all, not even the system unit.

There is a utility to create a .cfg file, I can't remember exactly what it's called (fpcmkcfg.exe looks like a good candidate, it'll reside in the same folder as fpc.exe), not how to use it.
Or you can just copy the fpc.cfg from your starting compiler (3.0.4) than use search and replace to adjust the paths.

Bart

Title: Re: compiling fpc under windows 7
Post by: Pascal on March 14, 2018, 06:10:45 am
Maybe this can help: http://wiki.freepascal.org/Installing_Lazarus#Compiling.2Finstalling_FPC_and_Lazarus_from_Sources_of_SVN_.28Win32.29 (http://wiki.freepascal.org/Installing_Lazarus#Compiling.2Finstalling_FPC_and_Lazarus_from_Sources_of_SVN_.28Win32.29)
TinyPortal © 2005-2018