User avatar
Gavinmc42
Posts: 2359
Joined: Wed Aug 28, 2013 3:31 am

Lazarus/Free Pascal

Mon Apr 16, 2018 10:13 am

Any idea how to install latest Lazarus and Free Pascal?
I have been using Debian, Raspbian and others, Gentoo packages/installs are different ;)
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
sakaki
Posts: 119
Joined: Sun Jul 16, 2017 1:11 pm

Re: Lazarus/Free Pascal

Mon Apr 16, 2018 11:11 am

So, I had a quick look at FPC yesterday, since you'd mentioned it earlier.

The current main-tree FPC ebuild on Gentoo doesn't support aarch64/arm64 at the moment. To write a tweaked one that will work, I'd need an aarch64-linux binary FPC package for the bootstrapping phase of the build (as modern FPC seems to need FPC to build it, essentially, much as rust needs rust to build), or detailed cross-compile instructions.

To be more specific: currently, the 3.0.4 ebuild downloads the generic FPC build and source packages from sourceforge, and then an arch-specific binary package, also from sourceforge. So on a 64-bit Linux PC, for example, it would download (from prefix https://sourceforge.net/projects/freepascal/files/):
  1. Source/3.0.4/fpcbuild-3.0.4.tar.gz/download (OK for all arches)
  2. Source/3.0.4/fpc-3.0.4.source.tar.gz/download (OK for all arches)
  3. Linux/3.0.4/fpc-3.0.4.x86_64-linux.tar/download (for bootstrapping on 64-bit linux PCs only)
Where (3) is the binary package used during bootstrapping (the precompiled/binary FPC compiler therein is used to compile the FPC sources, and the resulting FPC compiler is then used to compile the FPC sources again).

Accordingly, to build on aarch64-linux rather than x86_64, I'd either need an equivalent binary package to (3) for aarch64-linux (which I can't see on sourceforge at a quick glance, although it's entirely possible I've missed it!), or some detailed cross-compilation instructions from x86_64-linux to aarch64-linux (as I don't use FPC day-to-day).

So, if you could point me to either or both of the above, I'd be happy to write the ebuild for FPC. And once FPC is available, we can look at Lazarus.

best, sakaki

User avatar
Gavinmc42
Posts: 2359
Joined: Wed Aug 28, 2013 3:31 am

Re: Lazarus/Free Pascal

Mon Apr 16, 2018 12:13 pm

Yep, bootstrapping compilers, lots of fun, it's only hard the first time ;)

And 64bit Laz/FPC is only one stage, I then want to get this ported.
https://ultibo.org/wiki/Main_Page
This works on Debian and gives clues along the way, however apt-get install is not Gentoo's way
https://ultibo.org/forum/viewtopic.php? ... ller#p5697

I have used this before for Laz/FPC
https://www.getlazarus.org/setup/?download#linux
But cross compiling Aarch64 is new territory for me.

The goal is a 64bit Linux distribution for testing Aarch64/NEON coding before doing it in baremetal with Ultibo.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
sakaki
Posts: 119
Joined: Sun Jul 16, 2017 1:11 pm

Re: Lazarus/Free Pascal

Mon Apr 16, 2018 12:17 pm

If you are plugged into the FPC community / message boards (as unfortunately I am not) perhaps you could ask there, in case there is an obvious answer for the aarch64-linux binary-tarball-for-bootstrapping issue?

User avatar
Gavinmc42
Posts: 2359
Joined: Wed Aug 28, 2013 3:31 am

Re: Lazarus/Free Pascal

Mon Apr 16, 2018 12:29 pm

Buried in here is some efforts so far.
https://ultibo.org/forum/viewtopic.php? ... it=Aarch64

QEMU/Aarch64 is sort of working.
https://ultibo.org/forum/viewtopic.php? ... 4&start=30

Goal is to turn this QEMU version into real baremetal Aarch64/NEON version
https://ultibo.org/forum/viewtopic.php? ... N&start=20

That opens up lots of interesting possibilities then, like doing camera stuff without the VC4 hardware jpeg/h.264.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
Gavinmc42
Posts: 2359
Joined: Wed Aug 28, 2013 3:31 am

Re: Lazarus/Free Pascal

Wed Apr 18, 2018 6:42 am

https://github.com/newpascal/fpcupdelux ... ag/v1.6.0o

Had forgotten about fpcupdeluxe.
Compile/crosscompile from/to anything? Maybe.

Laz/FPC is pretty self contained, I have run it from USB sticks on PC's.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
Gavinmc42
Posts: 2359
Joined: Wed Aug 28, 2013 3:31 am

Re: Lazarus/Free Pascal

Tue Dec 11, 2018 11:55 am

Time to revisit this.
Free Pascal versions that compile for and on Aarch64.
ftp://ftp.freepascal.org/pub/fpc/snapsh ... h64-linux/

Still need to compile Lazarus but now there is a compiler. ;)
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
sakaki
Posts: 119
Joined: Sun Jul 16, 2017 1:11 pm

Re: Lazarus/Free Pascal

Tue Dec 11, 2018 7:59 pm

Thanks for the heads up!
I'm testing the forthcoming 1.3.1 release of gentoo-on-rpi3-64bit right now, but I'll have a look at this once it is landed.

Best, sakaki

User avatar
Gavinmc42
Posts: 2359
Joined: Wed Aug 28, 2013 3:31 am

Re: Lazarus/Free Pascal

Wed Dec 12, 2018 1:59 am

Gentoo64 1.3.1 will have the new mesa-18.3.1?
Not sure about latest VC4 mesa bug fixes, can be hard to keep up ;)

Getting very close to having a Gentoo64 Pi as my first choice in Aarch64 and OpenGL/ES development.
Cross compiling is such a pain :oops:
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
sakaki
Posts: 119
Joined: Sun Jul 16, 2017 1:11 pm

Re: Lazarus/Free Pascal

Thu Dec 13, 2018 1:52 am

Gavinmc42 wrote: Gentoo64 1.3.1 will have the new mesa-18.3.1?
Not sure about latest VC4 mesa bug fixes, can be hard to keep up ;)
I see 18.3.1 went into the main tree on the 11th of this month (commit). However, the isshoni.org mirror has been locked for a week or so, for 1.3.1 image tests, so the version on the image will be 18.3.0. The 18.3.1 will follow immediately the tree is unlocked after release, however, so your first genup run on the new image should get you the newest (i.e., 18.3.1) version.

hth, sakaki

User avatar
Gavinmc42
Posts: 2359
Joined: Wed Aug 28, 2013 3:31 am

Re: Lazarus/Free Pascal

Thu Dec 13, 2018 3:17 am

Thanks Sakaki.
Just in time for some fun coding over the Xmas break.

According to this there does not seem to be anything major in 18.3.1.
https://www.mesa3d.org/relnotes/18.3.1.html
Looks like I currently have 18.3.0-rc4.
That will probably be good enough for do the OpenGL demo stuff in Pascal.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
Gavinmc42
Posts: 2359
Joined: Wed Aug 28, 2013 3:31 am

Re: Lazarus/Free Pascal

Wed Jan 16, 2019 12:48 pm

Latest 3.3.1 Aarch64 fpc is compiling but manual installation needs more manual reading.
Normal installs to Windows and x86 Linux is well documented,but those install scripts work anyway.
Path issues means cut and pasting missing files to where they can be found.
Hello is a 1MB+ executable file as it contains the runtime + debug as well.

Most install methods will automatically generate a .fpc.cfg file with all the paths etc sorted out.
Existing installs like fpcup, fpcupdeluze will build fpc/lazarus from source grabbed from the net.
Building from source requires a build compiler version with 3.0.4 being the latest version?

However there is no aarch64 3.0.4 version, catch 22.
The snapshot 3.3.1 works fine if just unzipped to a folder.
Can it be used to make an Aarch64 3.0.4 build version, which is then used to make the 3.3.1 version?

Lazarus is the normal IDE for Free Pascal but as shown Geany can be used for simple stuff.
The Lazarus IDE is built from source and needs a working fpc install.
The Textmode fp IDE also works.
There is another fpc IDE http://www.msegui.com/

A Gentoo ebuild script to install the binary from the snapshot file may be easier to learn than the usual install from source.
But as I understand ebuild it is so things are built from source.
I cannot say I am not learning about compilers :lol:

Do C compilers make the smallest helloworld exe files?
C, C++ , gnu and clang, Rust, Go, Pony, Pascal can now be tested.
How many can be used for baremetal on Pi's?

What else is already on Gentoo64 , Python, Perl, PHP?
Attachments
Screenshot_2019-01-16_12-04-35.png
Screenshot_2019-01-16_12-04-35.png (222.19 KiB) Viewed 391 times
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Return to “Gentoo”