Recent

Author Topic: Tutorial: Install Lazarus to Raspberry Pi  (Read 171 times)

Linkat

  • New member
  • *
  • Posts: 8
Tutorial: Install Lazarus to Raspberry Pi
« 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.

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

  • Hero Member
  • *****
  • Posts: 3098
  • My goal: build my own game engine using Lazarus
Re: Tutorial: Install Lazarus to Raspberry Pi
« Reply #1 on: August 17, 2019, 04:26:54 pm »
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

  • Full Member
  • ***
  • Posts: 156
Re: Tutorial: Install Lazarus to Raspberry Pi
« Reply #2 on: Today at 04:57:10 am »
o Lazarus v2.1.0 r61676, FPC v3.3.1 r42640, macOS 10.14.6 (with supplemental update), Xcode 10.3
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.0
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 18.04

Thaddy

  • Hero Member
  • *****
  • Posts: 8483
Re: Tutorial: Install Lazarus to Raspberry Pi
« Reply #3 on: Today at 08:50:13 am »
Do the Wiki instructions no longer work?

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

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.
« Last Edit: Today at 08:54:36 am by Thaddy »
Read the manuals and if you are a professional get a proper education in computer science. Makes the forum a lot cleaner.

Thaddy

  • Hero Member
  • *****
  • Posts: 8483
Re: Tutorial: Install Lazarus to Raspberry Pi
« Reply #4 on: Today at 09:06:36 am »
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.
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  [Select]
  1. 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  [Select]
  1. sudo apt-get purge lazarus && sudo apt-get purge fpc && sudo apt-get autoremove
If you did previously build from source, go to the directory root with the fpc directory as child and do
Code: Bash  [Select]
  1.  sudo rm -rf fpc && sudo rm /etc/fpc.cfg
do the same for lazarus, go to the parent directory of the lazarus directory and
Code: Bash  [Select]
  1.  sudo rm -rf lazarus
Last step: delete the hidden lazarus directory in /home/<user>:
Code: Bash  [Select]
  1. cd /home/<username>
  2. sudo rm -rf .lazarus
  3.  
Note the dot: it is a hidden directory (if it exists)

After that you can perform the above recommended  installation from apt without trouble.
« Last Edit: Today at 10:03:35 am by Thaddy »
Read the manuals and if you are a professional get a proper education in computer science. Makes the forum a lot cleaner.