Sign in Join

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

Mailing lists / fpc-pascal / 2015-02

How do you build FPC?

15 messages · 8 people · –

Reply by email Subscribe to this list Your subscription

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

Jon Foster

I'm using i386 32bit Linux for most of my development and currently using FPC 2.6.0. I'm trying to understand how to build FPC for various scenarios: Cross-compiling FPC for another architecture. Building FPC crosscompilers and related units so I can compile for them from my Linux machine. And building new FPC versions.

There seems to be a massive lack of documentation about the FPC build process and many things I try get me know where. I'll do something like "make deb" and I get "/bin/cp: cannot stat `logs': No such file or directory ..." Or I do "make build OS_TARGET=win32 SMARTLINK=YES DEFAULTUNITS=YES NOGDB=1" and it builds a i386-linux RTL with i386-win32 packages!?!?

I've tried building on I386 Linux, PPC Linux, PPC OSX, just to name the ones that I remember. I've tried simple builds of newer FPCs, cross compiling FPC, building crosscompilers and units. Building Debian packages.

Not once have I ever been able to get it to do what I want. There is obviously a lot of pieces I'm missing from what I've dug up on the wiki, docs and included text files.

Is there documentation for compiling FPC? Am I just missing it somewhere? FPC seems incredibly flexible and I'd like to take advantage of it on some other platforms but so far it looks like that is reserved for a wizard elite somewhere and nobody is saying how to get there.

TIA - Jon

Sent from my Debian Linux workstation -- http://www.debian.org/intro/about Jon Foster JF Possibilities, Inc. 541-410-2760 Making computers work for you!

Reply by email

Mark Morgan Lloyd
to Jon Foster
Jon Foster wrote 25 lines
I'm using i386 32bit Linux for most of my development and currently using FPC 2.6.0. I'm trying to understand how to build FPC for various scenarios: Cross-compiling FPC for another architecture. Building FPC crosscompilers and related units so I can compile for them from my Linux machine. And building new FPC versions. There seems to be a massive lack of documentation about the FPC build process and many things I try get me know where. I'll do something like "make deb" and I get "/bin/cp: cannot stat `logs': No such file or directory ..." Or I do "make build OS_TARGET=win32 SMARTLINK=YES DEFAULTUNITS=YES NOGDB=1" and it builds a i386-linux RTL with i386-win32 packages!?!? I've tried building on I386 Linux, PPC Linux, PPC OSX, just to name the ones that I remember. I've tried simple builds of newer FPCs, cross compiling FPC, building crosscompilers and units. Building Debian packages. Not once have I ever been able to get it to do what I want. There is obviously a lot of pieces I'm missing from what I've dug up on the wiki, docs and included text files. Is there documentation for compiling FPC? Am I just missing it somewhere? FPC seems incredibly flexible and I'd like to take advantage of it on some other platforms but so far it looks like that is reserved for a wizard elite somewhere and nobody is saying how to get there.

The document that is usually cited is
http://www.stack.nl/~marcov/buildfaq.pdf which I think is still generally valid. I don't know whether this is the only URL, or if it's also hosted on the FreePascal site.

In all cases the correct compiler to start with is the current one (i.e. at the time of writing v2.6.4), the makefiles generally check and enforce this and it is unwise to override it.

Apart from that, and with the caveat that I am not a core developer and this is probably not an orthodox opinion or advice, for building natively on Linux (also Solaris, OS X etc.) I simply use something like

make NOGDB=1 OPT='-O- -gl -Xs-' all

That's a very conservative build, with minimal optimisation etc. so that if something goes wrong a backtrace can be had without having to rebuild. Alternatively see http://wiki.freepascal.org/fpcup

To get the idea of how bootstrapping and cross compilers hang together, you might find http://wiki.freepascal.org/Native_MIPS_Systems useful. I tweaked that a few days ago since I think a couple of steps were in the wrong order.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Marco van de Voort
to Jon Foster: I'm using i386 32bit Linux for most of my development and currently using FPC 2.6.0. I'm…

In our previous episode, Jon Foster said:

Is there documentation for compiling FPC? Am I just missing it somewhere? FPC seems incredibly flexible and I'd like to take advantage of it on some other platforms but so far it looks like that is reserved for a wizard elite somewhere and nobody is saying how to get there.

Did you read the buildfaq mentioned on the more information page of FPC?

http://www.freepascal.org/moreinfo.var

It is somewhat outdated, but describes general principles and dependencies very well.

Reply by email

Mark Morgan Lloyd
to Marco van de Voort
Marco van de Voort wrote 12 lines
In our previous episode, Jon Foster said: > Is there documentation for compiling FPC? Am I just missing it > somewhere? FPC seems incredibly flexible and I'd like to take advantage > of it on some other platforms but so far it looks like that is reserved > for a wizard elite somewhere and nobody is saying how to get there. Did you read the buildfaq mentioned on the more information page of FPC? http://www.freepascal.org/moreinfo.var It is somewhat outdated, but describes general principles and dependencies very well.

If you update that, check the embedded URL: it's lost the ~ (tilde) so 404s.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

leledumbo
to Jon Foster: I'm using i386 32bit Linux for most of my development and currently using FPC 2.6.0. I'm…
FPC seems incredibly flexible and I'd like to take advantage

of it on some other platforms but so far it looks like that is reserved for a wizard elite somewhere and nobody is saying how to get there.

Other than the buildfaq, reading the Makefile.fpc might help (assuming you already know make) since all Makefiles are generated by fpcmake. The process is currently run hybrid with fpmake in many places (but as far as I can see, not all make has been replaced). Reading and understanding fpmake might help you, too.

I myself customize my FPC directory layout, such that I can easily update my FPC from svn and cross build to 8 different targets (excluding host) with a single script execution, using only single fpc.cfg for all of them.

The build process is no magic and easily understandable. Section 7 of the cross compiling wiki explains the prerequisites well, and in general, make all CPU_TARGET=<target cpu> OS_TARGET=<target os> suffices (optionally install if you want), except perhaps for arm targets where there are multiple implementations of FPU mode which you have to choose at make time.

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/How-do-you-build-FPC-tp5721047p5721051.html Sent from the Free Pascal - General mailing list .

Reply by email

Jon Foster
to Mark Morgan Lloyd: The document that is usually cited is http://www.stack.nl/~marcov/buildfaq.pdf which I…
Mark Morgan Lloyd wrote 16 lines
Jon Foster wrote: > [...] > There seems to be a massive lack of documentation about the FPC build > process and many things I try get me know where. I'll do something like > "make deb" and I get "/bin/cp: cannot stat `logs': No such file or > directory ..." Or I do "make build OS_TARGET=win32 SMARTLINK=YES > DEFAULTUNITS=YES NOGDB=1" and it builds a i386-linux RTL with i386-win32 > packages!?!? > [...] The document that is usually cited is http://www.stack.nl/~marcov/buildfaq.pdf which I think is still generally valid. I don't know whether this is the only URL, or if it's also hosted on the FreePascal site. [...]

Thanks for that link! I have something to read tonight. :-)

Sent from my Debian Linux workstation -- http://www.debian.org/intro/about Jon Foster JF Possibilities, Inc. 541-410-2760 Making computers work for you!

Reply by email

vfclists .
to leledumbo: of it on some other platforms but so far it looks like that is reserved for a wizard…
leledumbo wrote 34 lines
> FPC seems incredibly flexible and I'd like to take advantage of it on some other platforms but so far it looks like that is reserved for a wizard elite somewhere and nobody is saying how to get there. Other than the buildfaq, reading the Makefile.fpc might help (assuming you already know make) since all Makefiles are generated by fpcmake. The process is currently run hybrid with fpmake in many places (but as far as I can see, not all make has been replaced). Reading and understanding fpmake might help you, too. I myself customize my FPC directory layout, such that I can easily update my FPC from svn and cross build to 8 different targets (excluding host) with a single script execution, using only single fpc.cfg for all of them. The build process is no magic and easily understandable. Section 7 of the cross compiling wiki explains the prerequisites well, and in general, make all CPU_TARGET=<target cpu> OS_TARGET=<target os> suffices (optionally install if you want), except perhaps for arm targets where there are multiple implementations of FPU mode which you have to choose at make time. -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/How-do-you-build-FPC-tp5721047p5721051.html Sent from the Free Pascal - General mailing list . _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Do you have some FPC/Lazarus compilation scripts or sample fpc.cfg files you can share?

Frank Church ======================= http://devblog.brahmancreations.com

Reply by email

leledumbo
to vfclists .: Do you have some FPC/Lazarus compilation scripts or sample fpc.cfg files you can share?…
Do you have some FPC/Lazarus compilation scripts or sample fpc.cfg files

you can share?

The build script:
build-fpc-cross-all.sh
<http://free-pascal-general.1045716.n5.nabble.com/file/n5721321/build-fpc-cross-all.sh> My fpc.cfg:
fpc.cfg
<http://free-pascal-general.1045716.n5.nabble.com/file/n5721321/fpc.cfg>

Now read carefully. The final directory layout is now: $outdir
+ <fpc built binaries except the actual compiler>
+ $stableversion
++ <standard $fpcdir/lib/fpc/$stableversion layout>
+ $svnversion
++ <standard $fpcdir/lib/fpc/$svnversion layout>
+ $srcdir
+ lexyacc
+ tmp

* The script assumes you have proper assembler/linker accessible in PATH and use above fpc.cfg
* Adjust fpc.cfg above to your environment
* Please start with latest release, since the script doesn't pass OVERRIDEVERSIONCHECK=1 to make. If you insist, however, just add that flag to make
* The script passes GDBMI=1 when building host, so you can still have debugger enabled for fpIDE without libgdb.a exists
* tmp will be temporary destination folder, before the contents are mv-ed and rsynced with $outdir
* In case of failure, there will be build-fpc-cross-all.log in the current directory from which you can search for triple asterisks (***) to find what went wrong
* $stableversion doesn't have to be there, I just do it for single fpc.cfg requirement
* $srcdir too, but I never move it out of $outdir, though

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/How-do-you-build-FPC-tp5721047p5721321.html Sent from the Free Pascal - General mailing list .

Reply by email

vfclists .
to leledumbo
leledumbo wrote 52 lines
> Do you have some FPC/Lazarus compilation scripts or sample fpc.cfg files you can share? The build script: build-fpc-cross-all.sh < http://free-pascal-general.1045716.n5.nabble.com/file/n5721321/build-fpc-cross-all.sh > My fpc.cfg: fpc.cfg <http://free-pascal-general.1045716.n5.nabble.com/file/n5721321/fpc.cfg> Now read carefully. The final directory layout is now: $outdir + <fpc built binaries except the actual compiler> + $stableversion ++ <standard $fpcdir/lib/fpc/$stableversion layout> + $svnversion ++ <standard $fpcdir/lib/fpc/$svnversion layout> + $srcdir + lexyacc + tmp * The script assumes you have proper assembler/linker accessible in PATH and use above fpc.cfg * Adjust fpc.cfg above to your environment * Please start with latest release, since the script doesn't pass OVERRIDEVERSIONCHECK=1 to make. If you insist, however, just add that flag to make * The script passes GDBMI=1 when building host, so you can still have debugger enabled for fpIDE without libgdb.a exists * tmp will be temporary destination folder, before the contents are mv-ed and rsynced with $outdir * In case of failure, there will be build-fpc-cross-all.log in the current directory from which you can search for triple asterisks (***) to find what went wrong * $stableversion doesn't have to be there, I just do it for single fpc.cfg requirement * $srcdir too, but I never move it out of $outdir, though -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/How-do-you-build-FPC-tp5721047p5721321.html Sent from the Free Pascal - General mailing list . _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Thanks.

The building process needs as much help as it can get.

Frank Church ======================= http://devblog.brahmancreations.com

Reply by email

Jon Foster
to Jon Foster: I'm using i386 32bit Linux for most of my development and currently using FPC 2.6.0. I'm…

I'm trying to get FPC to build again and although I'm getting along a lot better I still don't seem to be able to get the knack of it. First I'd like to know if anyone has any updated build instructions? I've been on the wiki and read the "build faq" PDF document. Both are good as far as they go. But neither is anywhere near complete.

My first major dilemma, and what this email pertains to, is building Debian packages. I went to grab the latest FPC 3 from SF and found that the usual tarball of Debian packages doesn't exist. So I downloaded the "fpcbuild" tarball for FPC 3.0.0 and tried the "make deb".

After I banged on it for many hours applying several crude patches it finally makes packages again. But all of this leads me to believe that Debian packages for FPC are no longer maintained / supported? If so what's the story? Maybe my crude hacks could be put to use or I could help out some way?

After installing the packages and doing some simple builds I thought all was good... Nope! Turns out several of the compiled units, from the packages folder aren't getting packaged. I fixed a few of the *.install.in files to include the missing package unit folders. However, at least in some situations, it looks like some of the additional unit files are getting missed by the deb packaging.

My current need is the StrUtils unit, which I must say I'm shocked to find is not part of the core RTL but is in a package?!?! I don't get that but that's your decision. Through injecting breakpoints in the package build process I have found that the unit files are getting built and installed into the temporary distribution folders. But somehow they aren't making it into the final packages.

I'm still working on it but I thought I'd ask and see if anyone knows where in the Debian package building stuff things are getting lost?

I do want to commend the FPC developers. There are only two pieces of software that continue to impress me release after release: the Linux kernel and FreePascal compiler (not Lazarus).

My system stats: Debian 7 i386. FPC 3.0.0 as the currently installed compiler, first from the binary tarball package and then from my package build attempts, which are mostly functional.

TIA - Jon

Sent from my Debian Linux workstation -- http://www.debian.org/intro/about Jon Foster JF Possibilities, Inc. 541-410-2760 Making computers work for you!

Reply by email

Karoly Balogh (Charlie/SGR
to Jon Foster

Hi,

Jon Foster wrote 5 lines
After I banged on it for many hours applying several crude patches it finally makes packages again. But all of this leads me to believe that Debian packages for FPC are no longer maintained / supported? If so what's the story? Maybe my crude hacks could be put to use or I could help out some way?

Well, I guess the main issue is, Debian splits the FPC "packages" into separate packages. :) Because it not only installs the package, but all of its dependencies (for example C static link libs), therefore a global FPC "packages" package with all its dependencies would be *HUGE*. But maybe for 3.0 that decision should have been modified, and Debian should have bundled a 'set of packages' as a .deb package, instead of each package as a separate .deb alone... I mean the various FCL or the various RTL packages are certainly just one "package" from the user PoV...

And yes, I'm not sure if the .deb packaging is still maintained in FPC's own build system. Maybe the people doing the actual packaging for Debian could help you there?

My current need is the StrUtils unit, which I must say I'm shocked to find is not part of the core RTL but is in a package?!?! I don't get that but that's your decision.

Again, that's because FPC doesn't think about "packages" the way Debian and Linux distributions in general think. Remember, we deploy the same structure on all of our supported platforms. We even provide Linux binary builds, where "packages" is just one archive, with a specific directory structure and that's it.

So we moved out large chunks from the RTL (including strutils) to separate packages, because it reduces compiler build times and therefore speeds up development. Also, it's makes easier the maintenance of some RTL features, which are in fact separate from the rest of the RTL really. I guess the Debian packaging situation was simply not considered while making that decision, given most FPC developers themselves don't use distribution provided packages.

Anyway, packages not finding a given unit in another package could be probably fixed by adding additional dependencies to that other package.

That said, if anyone feels like helping out with the current packaging situation on whatever platform, he's certainly very welcomed to do so. :)

Cheers,

Charlie

Reply by email

Tomas Hajny
to Karoly Balogh (Charlie/SGR
Karoly Balogh wrote
On Mon, 5 Sep 2016, Jon Foster wrote:

Hello everybody,

Please note that the original poster (Jon Foster) is apparently not subscribed to the mailing list (although he has not mentioned this in his post). I suggest that you include him in Cc: of your replies - forwarding the response of Charlie to his e-mail below to make sure it gets to him...

Regards

Tomas
(one of fpc-pascal mailing list moderators)

Show quoted text 48 lines
Hi, > After I banged on it for many hours applying several crude patches it > finally makes packages again. But all of this leads me to believe that > Debian packages for FPC are no longer maintained / supported? If so > what's the story? Maybe my crude hacks could be put to use or I could > help out some way? Well, I guess the main issue is, Debian splits the FPC "packages" into separate packages. :) Because it not only installs the package, but all of its dependencies (for example C static link libs), therefore a global FPC "packages" package with all its dependencies would be *HUGE*. But maybe for 3.0 that decision should have been modified, and Debian should have bundled a 'set of packages' as a .deb package, instead of each package as a separate .deb alone... I mean the various FCL or the various RTL packages are certainly just one "package" from the user PoV... And yes, I'm not sure if the .deb packaging is still maintained in FPC's own build system. Maybe the people doing the actual packaging for Debian could help you there? > My current need is the StrUtils unit, which I must say I'm shocked to > find is not part of the core RTL but is in a package?!?! I don't get > that but that's your decision. Again, that's because FPC doesn't think about "packages" the way Debian and Linux distributions in general think. Remember, we deploy the same structure on all of our supported platforms. We even provide Linux binary builds, where "packages" is just one archive, with a specific directory structure and that's it. So we moved out large chunks from the RTL (including strutils) to separate packages, because it reduces compiler build times and therefore speeds up development. Also, it's makes easier the maintenance of some RTL features, which are in fact separate from the rest of the RTL really. I guess the Debian packaging situation was simply not considered while making that decision, given most FPC developers themselves don't use distribution provided packages. Anyway, packages not finding a given unit in another package could be probably fixed by adding additional dependencies to that other package. That said, if anyone feels like helping out with the current packaging situation on whatever platform, he's certainly very welcomed to do so. :) Cheers, -- Charlie

Reply by email

Tomas Hajny
to Karoly Balogh (Charlie/SGR: Well, I guess the main issue is, Debian splits the FPC "packages" into separate packages.…
Karoly Balogh wrote
On Mon, 5 Sep 2016, Jon Foster wrote:

Hi,

(now putting my "mailing list member" hat on ;-) )

Show quoted text 5 lines
> After I banged on it for many hours applying several crude patches it > finally makes packages again. But all of this leads me to believe that > Debian packages for FPC are no longer maintained / supported? If so > what's the story? Maybe my crude hacks could be put to use or I could > help out some way?

The Debian rules are primarily maintained by a Debian package maintainer, not directly inside the SVN repository of FPC (although we're more than happy to merge them to mainstream if they are supplied to us) and not necessarily up to the latest changes of FPC. See
https://packages.debian.org/source/sid/fpc for information about the current status there.

Show quoted text 8 lines
Well, I guess the main issue is, Debian splits the FPC "packages" into separate packages. :) Because it not only installs the package, but all of its dependencies (for example C static link libs), therefore a global FPC "packages" package with all its dependencies would be *HUGE*. But maybe for 3.0 that decision should have been modified, and Debian should have bundled a 'set of packages' as a .deb package, instead of each package as a separate .deb alone... I mean the various FCL or the various RTL packages are certainly just one "package" from the user PoV...

.
.

See the link above (or install/debian/*.in in fpcbuild) - such a grouping is indeed performed in Debian.

I leave the other parts of the original message to others knowing more about the current status than me.

Tomas

Reply by email