Recent

Author Topic: Installing Lazarus on a Raspberry PI 4.  (Read 1675 times)

guachipelintree

  • Newbie
  • Posts: 5
Installing Lazarus on a Raspberry PI 4.
« on: December 03, 2023, 08:34:06 pm »
Hello,

Some years ago I could install Lazarus on a RPI with just installing the OS and then with three commands.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install lazarus

Then I was able to give the command startlazarus from a terminal window and it always worked like a charm.

2 years ago I bought another RPI4 and installed 64 bit os. After the three commands, it would not work. I do not remember well, but it gave me a problem with the keyring. Ok the solution was to downgrade to 32 bit system and old version.

Today I bought another RPI4 and installed debian bookworm from scratch, and after the three commands, startlazarus would crash the xterminal.
One time it worked when I ran startlazarus as root, but then it compiled one time and ran the program, but next time startlazarus and the icon in the dropdownmenu from lazarus would simply crash the xwindows and run into the x11 or is it wayland loginscreen.
After some reading I understood that wayland would be the problem, so I turned that off, and tried to get back to X11. Now it would not even boot into X and trying to fix that I ran into issues.
Then tried 32 bit versions, same problems. Some old versions of os's but to  no simple avail.
I went through gtk+ troubles, dependency issues, even tried with QT. Then I got a precompiled version to work after installing gtk, but the debugger categorically errors out and without debugging, programming is not so much fun or maybe even impossible.

It is not that I am too lazy to get it work, and I believe that much much effort of all kind of non paid volunteers is put into this software.

So let's get down to earth.

As a minimum, I would expect Lazarus to work from scratch with the three simple commands from above, or selecting and installing Lazarus IDE from the installer software that comes with the os.
If I were a rookie, and kind of that is where I stuck, then I believe 100% of the people who would try out this software would become demotivated and give up.
Lazarus for windows does not give me issues though.
But I believe it is a waste of your good intentions to not have a simple, robust installation that would at least work, even if it would do the minimum, and later on encouraging the user to continue to find solutions. Crashing an OS is hard to achieve on linux. Or at least I have never seen anything before that would crash X and make it need to restart.

I myself probably will find a way around and make it work, but I am just thinking out loud about what newbies would do and the frustration that it is causing, and the public user support that it is destroying. Remember that every user of your software will make the software stronger, even if they are not helping with the development, a user helps the software just by installing it on hisher hardware.


paweld

  • Hero Member
  • *****
  • Posts: 1268
Best regards / Pozdrawiam
paweld

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4541
  • I like bugs.
Re: Installing Lazarus on a Raspberry PI 4.
« Reply #2 on: December 03, 2023, 09:09:05 pm »
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install lazarus
That uses packages created by your distro. Lazarus project does not provide them.
Please create a bug report for your distro.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

dbannon

  • Hero Member
  • *****
  • Posts: 3156
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Installing Lazarus on a Raspberry PI 4.
« Reply #3 on: December 04, 2023, 06:45:40 am »
.....
One time it worked when I ran startlazarus as root, but then it compiled one time and ran the program, but next time startlazarus and the icon in the dropdownmenu from lazarus would simply crash the xwindows and run into the x11 or is it wayland loginscreen.

Sadly, I would not expect much to work after you did that I am afraid. Running as root will leave various temp and transitional files owned by root and unable to be written by yourself. Golden rule in *nix world, don't run anything as root unless there is a very good reason. There is never a good reason to run something like Lazarus as root.

I suggest you use the package manager to completely remove all traces of fpc and Lazarus. Then, probably a good idea to make sure you remove ~/.lazarus

Then, if you absolutely must use the Repo versions, re run those three commands and try again. This time look carefully at any error messages and report them to Debian. They will take your report seriously.

However, as usual, I suggest you use the Debian repo to install FPC and its source then, install Lazarus by building it from source. Its easy and reliable. See https://wiki.freepascal.org/Installing_Lazarus_on_Linux#Build_Lazarus_from_Source

Code: Pascal  [Select][+][-]
  1. cd to some suitable dir
  2. wget https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/fixes_3_0/lazarus-fixes_3_0.zip
  3. unzip lazarus-fixes_3_0.zip
  4. cd lazarus-fixes_3_0
  5. make bigide

Note that a Pi 4 with only 2G ram needs extra swap space enabled.


But I believe it is a waste of your good intentions to not have a simple, robust installation that would at least work,....

There is, I mentioned it above.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

guachipelintree

  • Newbie
  • Posts: 5
Re: Installing Lazarus on a Raspberry PI 4.
« Reply #4 on: December 05, 2023, 08:39:25 am »
Thanks for the answers.
You guys are top of the bill, and enthusiastic about making this work.
Then, when I write in a forum I always try to make the story chewy in such a way that search engines will find the probable answer to problems for people with my mindset.
That, because my mindset was not able to put in the correct search terms to find the correct answer while the answer existed. I believe that is called prompt engineering. 

For myself I have some worries.
When I write a software for use by others, and my programs are not too complex, I always try to make it robust, think about intercepting errors that could come up like disk full, memory full, divide by 0, timing errors, memory leaks, well you know what I am talking about.

So if I really want it robust, then I use linux and I have made software in Lazarus in the past that has run for 5 years on a pi zero, until the pi died, without ever needing to reboot. Bought a new pi zero and transferred the chip over because the software ran in the memory because sd's are an issue and for that reason I used a small ramdrive and networking to get data out, in order to spare the sd chip. And it continued.

So my point is that for ever what reason, now I saw this wayland crashing.
I never saw X11 crashing and I am talking from redhat 2.0. times, meaning I am old.

imo his means that wayland is overrated, because this software did not see something coming and it was obliged to crash and restart.
What if I had a document open and lost information?


guachipelintree

  • Newbie
  • Posts: 5
Re: Installing Lazarus on a Raspberry PI 4.
« Reply #5 on: December 05, 2023, 08:51:15 am »
And because Sunday I was in a hurry I did the following

Installed Raspberry Pi OS (Legacy) Lite 64 bit bookworm
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install xserver-xorg-core
sudo apt-get install xserver-xorg
sudo apt-get install xorg
sudo apt-get install openbox
sudo apt-get install lightdm
sudo apt-get install lazarus
ran raspi-config and turned on turn on x11vnc (will install), boot into desktop, turn on ssh
reboot pi.
Now I must ssh into the system and run x11vnc& not as root.
Vnc into the desktop and right-click to open a terminal
startlazarus and it worked like a charm.
And in reality, I like the minimalistic desktop without the installation of the rest of the things I never use.
« Last Edit: December 05, 2023, 09:00:13 am by guachipelintree »

 

TinyPortal © 2005-2018