Forum > Linux

Tutorial: Install Lazarus to Raspberry Pi

(1/27) > >>

Linkat:
Hi Raspi user,
because in the past 6 years I had a lot of trouble to install the current stable Lazarus versions with all the differently methods to my raspis, I wrote this tutorial. I'm sure there will be problems in the future too. So please give me information about this problems and how to solve this problems, so I can work on this tutorial.
Hopefully you'll have success with the installation.

The Raspberry Pi computers is a story of success. Unfortunately Lazarus is a language with minor importance on this. A main reason for it is, that the installation of Lazarus is to complex.

For the Intel- and AMD-CPU you have the easy to install deb- and rpm-packages.

So it would be very useful, if we had packages for the arm-CPU in the same way.

By the way: I think it would be nice to have a own section for the Raspberry Pi in this forum.

I hope we'll have a good discussion on it.

Handoko:
I've purchased my Raspberry but busy still don't have time to try it. Your tutorial will be very useful to me. Will follow your method when I have time.

Thank your for sharing it.

trev:
Do the Wiki instructions no longer work?

See: https://wiki.freepascal.org/Lazarus_on_Raspberry_Pi#Simple_installation_under_Raspbian

Thaddy:

--- Quote from: trev on August 19, 2019, 04:57:10 am ---Do the Wiki instructions no longer work?

See: https://wiki.freepascal.org/Lazarus_on_Raspberry_Pi#Simple_installation_under_Raspbian

--- End quote ---

Yes, they still work.  Raspbian Buster has fpc 3.0.4 and lazarus 2.0.0
As simple as sudo apt-get install fpc && sudo apt-get install lazarus.
Note that you will have to check of all paths are set up correctly in /etc/fpc.cfg

I would recommend, though, to install just fpc 3.0.4, then check out lazarus fixes and do make all install. After lazarus is compiled start lazarus, add/remove the packages you want (like OPM and  the two anchordocking) .
Subsequent re-compiles can be done with make clean all useride. Note you need to create a swap file with size 1024MB for this to work.

Thaddy:

--- Quote from: Linkat on August 17, 2019, 04:14:22 pm ---Hi Raspi user,
because in the past 6 years I had a lot of trouble to install the current stable Lazarus versions with all the differently methods to my raspis, I wrote this tutorial. I'm sure there will be problems in the future too. So please give me information about this problems and how to solve this problems, so I can work on this tutorial.
Hopefully you'll have success with the installation.

--- End quote ---
Thanks for the effort, but it is not necessary, because there are supported .debs in the Rasbian repository that are created and maintained by Debian.
If  you perform these simple steps you can subsequently update your installations by building from source and gives you a good and proper foundation to work with.

The recommended way is different from yours
Simply this is enough and strongly recommended:
--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install fpc && sudo apt-get install lazarus
For Raspbian buster this installs fpc 3.0.4 and Lazarus 2.0.0 and all its dependencies. and creates menu entries and icons.

Just verify that all the paths are correct in /etc/fpc.cfg
The install base is /usr so /usr/bin/ for the compiler and  /usr/lib/arm-linux-gnueabihf/fpc/3.0.4/ for the libraries.
If you need to adapt paths, use $FPCVERSION instead of 3.0.4.
Normally the paths are correct, but not if you have any previous installed versions or used an install from the freepascal or lazarus website. (these install in /usr/local)

===========================================================================================================================
The next is only necessary if you did not follow the above install previously:
Trouble shooting guidelines before a recommended install:
Steps for messed up and previous installations before installing from apt:
Should you have installations from the fpc/lazarus website first remove those:

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---sudo apt-get purge lazarus && sudo apt-get purge fpc && sudo apt-get autoremoveIf you did previously build from source, go to the directory root with the fpc directory as child and do

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- sudo rm -rf fpc && sudo rm /etc/fpc.cfgdo the same for lazarus, go to the parent directory of the lazarus directory and

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- sudo rm -rf lazarusLast step: delete the hidden lazarus directory in /home/<user>:

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---cd /home/<username>sudo rm -rf .lazarus Note the dot: it is a hidden directory (if it exists)

After that you can perform the above recommended  installation from apt without trouble.

Navigation

[0] Message Index

[#] Next page

Go to full version