zog
Posts: 200
Joined: Sun Nov 20, 2011 5:43 pm
Contact: Website

Lazarus 2 and fpc 3.0.4

Mon Mar 25, 2019 12:05 am

Dear All,
Has anyone managed to get Lazarus 2 up and running on Raspian Stretch.

I haven't been using Lazarus on the pi for a while so I thought I would download a noobs image and start from scratch.

I installed the stock version using
apt-get install lazarus

and then realised it was quite a few version behind the latest version so I decided to uninstall it and try to build it from source.

The installer fell over for Lazarus so I thought I might build fpc version 3.0.4 first but this won't build either as

libgdb.a

is missing.

Anyone got any ideas ?

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

Re: Lazarus 2 and fpc 3.0.4

Mon Mar 25, 2019 6:01 am

Someone really needs to build the binaries for Raspberry Pi's.
I did get the 64bit binary working in Gentoo64.
But the Laz build scripts expect an older compiler :o

Tried installing many times with many versions.
fpcupdeluxe is not perfect yet either.
I might actually have to read the manual.

The Ultibo install script works and installs Laz 1.6 and fpc 3.1.1, but it is very specific and not the full Laz/fpc.
But it is sign it is possible ;) If you know what you are doing.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

zog
Posts: 200
Joined: Sun Nov 20, 2011 5:43 pm
Contact: Website

Re: Lazarus 2 and fpc 3.0.4

Mon Mar 25, 2019 5:51 pm

Thanks for the reply. I will try to find out how to get fpc 3.0.4 to compile on the pi3 B+ as well as Lazarus 2. The guys over on the lazarus forums report that they have 3.0.4 running on the Pi 3 B+, so it's possible.

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

Re: Lazarus 2 and fpc 3.0.4

Tue Mar 26, 2019 12:44 am

I found the premade binaries, even the aarch64 version 3.2-3.3, this saves compiling fpc.
They come with the text mode IDE FP so you can start doing stuff.
I have even used Geany to compile free pascal code ;)

The Laz compile scripts need to be modified, but that is a learning curve I have yet to master.
There is another IDE , MSEide and MSEgui that could be of use, sadly Martin has passed but many hope his code goes on.
https://github.com/mse-org/mseide-msegui

I use Gentoo64 so as well as the native aarch64 version an armhf cross compiler is needed for 32bit code.
I also hope to cross compile for the RISC-V 32 and 64 one day.
It is all looking possible now with the latest versions.

If I remember right you can force Raspbian to install a newer version than the default.
Recently Debian split the install for fpc and lazarus to make this easier.

As Raspbian Debian is moving to 4.19 and 64bit, two versions will be needed.
It is much better now than 6 months ago, it will be easy in another 6 months.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

nicolap8
Posts: 327
Joined: Mon Mar 13, 2017 9:45 pm

Re: Lazarus 2 and fpc 3.0.4

Wed Apr 10, 2019 9:55 pm

Hi all!
This is what I've done:

1) from http://www.getlazarus.org I downloaded https://www.getlazarus.org/download/?platform=raspberry the setup.sh script
2) executed setup.sh and put fpc in /homes/pi/fpcminimal
3) fetch sources:

Code: Select all

svn co http://svn.freepascal.org/svn/fpc/tags/release_3_0_4 fpc304 
4) modify the makefile because it want to be compiled with a previuos version of fpc! Search for "REQUIREDVERSION"
5) use this script to compile (change fpcminimal path if required)

Code: Select all

sudo su
export PPC_CONFIG_PATH=/home/pi/fpcminimal/bin
export PATH=$PPC_CONFIG_PATH:$PATH
make all install zipinstallall OPT="-dFPC_ARMHF -CX -CpARMV6 -CfVFPV2 -CaEABIHF -OpARMV6 -O2 -OoFASTMATH -XX -Xs" 
sudo rm -f /usr/local/bin/ppcarm
sudo ln -s /usr/local/lib/fpc/3.0.4/ppcarm /usr/local/bin/ppcarm 
Note1: You'll need a swap file of at least 512MB if you want to rebuild the Lazarus IDE
Note2: If you want to compile ONLY for RPi 3B change the -Cp and -Op options :-)

I wish that's all... at least for fpc: to compile Lazarus you need to fetch sources and compile. I've not done yet but the way is straight!

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

Re: Lazarus 2 and fpc 3.0.4

Thu Apr 11, 2019 1:03 am

Ah, if only someone knew how to make a deb with the GPIO stuff included. ;)
It must be getting close, but the Raspbian one needs updating.

I have recently been using Laz/FPC to make and test language interpreters on Windows and Linux.
Next step is to try doing it on Pi's and then baremetal.

There is so much here that could be updated to Pi's.
Working my way through the Crenshaw tuts, learning lots.
http://pp4s.co.uk/main/tu-trans-comp-jc-intro.html
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

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

Re: Lazarus 2 and fpc 3.0.4

Sat Apr 13, 2019 9:43 am

I sometimes forget these pages.
https://www.getlazarus.org/setup/?download#linux
Looks like there has been an update, Laz 2.0.0 with fpc 3.3.1

After I install Laz/fpc this is next.
https://ultibo.org/forum/viewtopic.php?f=4&t=887
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Return to “Other programming languages”