Recent

Author Topic: Installing Lazarus on Raspberry PI OS  (Read 6839 times)

RHollerich

  • New member
  • *
  • Posts: 8
Installing Lazarus on Raspberry PI OS
« on: August 27, 2020, 06:25:45 pm »
Has any one had any luck getting the latest Lazarus source to compile on the newest Buster Raspberry PI OS for a PC (not the hardware)? If so, can you point me to the info to accomplish it? I downloaded fpc-3.2.0-x86_64-linux.tar, as well as the source tar, and lazarus-2.0.10-2.tar.gz. I have FPC installed and working, but any time I try to compile Lazarus, I keep getting all kinds of "skipping incompatible ..." errors. Note: I used the same Lazarus source tar and the fpc-3.2.0.arm-linux.tar file to install Free Pascal and compile Lazarus on the hardware without problems. But using the same process on the PC OS version isn't working.
 Thanks for any help you can provide.

af0815

  • Hero Member
  • *****
  • Posts: 1291
Re: Installing Lazarus on Raspberry PI OS
« Reply #1 on: August 27, 2020, 10:11:11 pm »
is fpcupdeluxe running in this enviroment ?

It looks like a special Version of x86-64 buster, not more. look for the kernel running.
« Last Edit: August 27, 2020, 10:13:55 pm by af0815 »
regards
Andreas

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Installing Lazarus on Raspberry PI OS
« Reply #2 on: August 28, 2020, 03:12:07 am »
Most probably you need a cross-compiler to ARM. It's a little old and uses i386 as the starting compiler but see "Setup Cross Compile For ARM" for general instructions on how to do it.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Rainbow6

  • New Member
  • *
  • Posts: 25
Re: Installing Lazarus on Raspberry PI OS
« Reply #3 on: August 28, 2020, 05:59:04 am »
Try fpcupdeluxe - https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/

Download the versions fpcupdeluxe-arm-linux or fpcupdeluxe-armv6hf-linux - one of these should work.

You don’t need to download a FPC package - fpcupdeluxe will fetch a bootstrap compiler and is compiling FPC and Lazarus from source - you can even select which SVN version you want to have. Maybe you have to install some libs or tools (like SVN) using apt - but no FPC or Lazarus packages.

HTH

TRon

  • Hero Member
  • *****
  • Posts: 2540
Re: Installing Lazarus on Raspberry PI OS
« Reply #4 on: August 28, 2020, 06:21:17 am »
Download the versions fpcupdeluxe-arm-linux or fpcupdeluxe-armv6hf-linux - one of these should work.
Just a small question. How does that work on a x86 machine/Operating system ?

TS never mentioned wanting to setup a cross-compiler, just a compiler. And yes, TS does write conflicting statements there.

RHollerich

  • New member
  • *
  • Posts: 8
Re: Installing Lazarus on Raspberry PI OS
« Reply #5 on: August 28, 2020, 07:00:43 am »
Thanks for the suggestions. I was able to get the latest FPC and Lazarus installed using fpcupdeluxe, but it did not turn out easy using it either.

For those that mentioned I should use the "arm" versions, I rquested help installing on a PC running the latest Raspberry PI OS Desktop version which uses the PC processor, not the Arm processor used by the PI hardware.

Using the command "uname -m", the PI OS on the PC said it was using "x86-64". Hence my attempt to install the x86-64 version of FPC which succeeded, but failed when compiling with Lazarus.

Using the x86-64 version of fpcupdeluxe on a clean PC install of the Raspberry PI OS Desktop also failed with errors about missing files, even after installing all the dependencies needed by fpcupdeluxe. So, just to see what happened, I downloaded "fpcupdeluxe-i386-linux" and, lo and behold, it ran just fine and installed both FPC and Lazarus without any problems.

So, either the Raspberry PI OS on my PC is reporting the wrong processor type, or the i386 version of fpcupdeluxe also works for the x86_64 processor.

Maybe if I get the time, I will try manually installing the i386 Linux of FPC on my Pi Desktop and see if it compiles Lazarus.

TRon

  • Hero Member
  • *****
  • Posts: 2540
Re: Installing Lazarus on Raspberry PI OS
« Reply #6 on: August 28, 2020, 07:40:33 am »
Using the command "uname -m", the PI OS on the PC said it was using "x86-64". Hence my attempt to install the x86-64 version of FPC which succeeded, but failed when compiling with Lazarus.
"failed' is too little information.

Quote
Using the x86-64 version of fpcupdeluxe on a clean PC install of the Raspberry PI OS Desktop also failed with errors about missing files, even after installing all the dependencies needed by fpcupdeluxe.
Again, too little information.

Quote
So, either the Raspberry PI OS on my PC is reporting the wrong processor type, or the i386 version of fpcupdeluxe also works for the x86_64 processor.
It works for both. That is: 32-bit compiled programs are able run on on a 64-bit OS (not the other way around), provided that you have a 32-bit subsystem installed on your 64 bit OS.

Quote
Maybe if I get the time, I will try manually installing the i386 Linux of FPC on my Pi Desktop and see if it compiles Lazarus.
As said, as long as you have the 32-bit subsystem installed/setup correctly and have all the dependencies in place then that will work.

Thaddy

  • Hero Member
  • *****
  • Posts: 14393
  • Sensorship about opinions does not belong here.
Re: Installing Lazarus on Raspberry PI OS
« Reply #7 on: August 28, 2020, 07:57:37 am »
How much memory has your Pi? You need a bigger swap file if it is only 1 GB. Make it at least 1 GB.
After that you can build FPC 3.2.0 as well as Lazarus on the Rasberry Pi. I do that almost every day.
A Raspberry Pi with 4 or 8GB does not need a larger swap file.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

rvk

  • Hero Member
  • *****
  • Posts: 6171
Re: Installing Lazarus on Raspberry PI OS
« Reply #8 on: August 28, 2020, 09:21:07 am »
So, either the Raspberry PI OS on my PC is reporting the wrong processor type, or the i386 version of fpcupdeluxe also works for the x86_64 processor.
On https://www.raspberrypi.org/downloads/raspberry-pi-os/ you only see the 32 bit.
Or are you using an experimental version?
There is a 64 bit test version at https://www.raspberrypi.org/forums/viewtopic.php?t=275370


Rats... it's this one: https://www.raspberrypi.org/downloads/raspberry-pi-desktop/
Not sure if that one is 64 bit. Trying now.

Which image did you use?

I know FPC can fail to compile on Debian Intel 32 bit. Something about the binutils which you'll need another version for.
« Last Edit: August 28, 2020, 09:24:31 am by rvk »

PascalDragon

  • Hero Member
  • *****
  • Posts: 5486
  • Compiler Developer
Re: Installing Lazarus on Raspberry PI OS
« Reply #9 on: August 28, 2020, 09:27:30 am »
How much memory has your Pi? You need a bigger swap file if it is only 1 GB. Make it at least 1 GB.
After that you can build FPC 3.2.0 as well as Lazarus on the Rasberry Pi. I do that almost every day.
A Raspberry Pi with 4 or 8GB does not need a larger swap file.

You did read the part where RHollerich said that they're using a x86-variant of the Raspberry Pi OS on x86 hardware?

@RHollerich: as TRon said, it's not enough to say that it failed. What exactly failed? What where the errors? It could simply be that packages were missing if you managed to get x86_64 FPC running, but not Lazarus.

rvk

  • Hero Member
  • *****
  • Posts: 6171
Re: Installing Lazarus on Raspberry PI OS
« Reply #10 on: August 28, 2020, 09:55:51 am »
I installed the Raspberry Pi OS for PC and it indeed states x86_64.
The iso name is 2020-02-12-rpd-x86-buster.iso. (which could mean x86_32 and x86_64)

But according to this the kernel matches the CPU (x86_64 in my case in Virtualbox) but the programs should be 32bit.
https://www.raspberrypi.org/forums/viewtopic.php?t=220884#p1355424
Quote
Kernel loaded will match the CPU either x86-32 or x86-64...

..though it is 32bit userland...

So you can indeed try to install the 32 bit version of FPC and Lazarus and see if that works better.

Edit:
And indeed... using dpkg-query -l I see a lot of i386 packages installed.
« Last Edit: August 28, 2020, 10:21:42 am by rvk »

MarkMLl

  • Hero Member
  • *****
  • Posts: 6692
Re: Installing Lazarus on Raspberry PI OS
« Reply #11 on: August 28, 2020, 11:09:53 am »
Quote
Kernel loaded will match the CPU either x86-32 or x86-64...

..though it is 32bit userland...

Ouch. So it's exactly the sort of split-architecture hack that the Debian SPARC port used, which the developers spent an enormous amount of effort on trying to get expunged.

From the application POV, I'd expect it to be exactly equivalent to a standard Debian x86_64 (AMD64) with the multiarch package installed, which also implies 32-bit binutils etc.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

rvk

  • Hero Member
  • *****
  • Posts: 6171
Re: Installing Lazarus on Raspberry PI OS
« Reply #12 on: August 28, 2020, 11:12:45 am »
From the application POV, I'd expect it to be exactly equivalent to a standard Debian x86_64 (AMD64) with the multiarch package installed, which also implies 32-bit binutils etc.
Code: [Select]
pi@raspberry:~ $ uname -a
Linux raspberry 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1 (2020-01-26) x86_64 GNU/Linux
pi@raspberry:~ $ dpkg-query -l | grep binutils
ii  binutils                              2.31.1-16                           i386         GNU assembler, linker and binary utilities
ii  binutils-common:i386                  2.31.1-16                           i386         Common files for the GNU assembler, linker and binary utilities
ii  binutils-i686-linux-gnu               2.31.1-16                           i386         GNU binary utilities, for i686-linux-gnu target
ii  libbinutils:i386                      2.31.1-16                           i386         GNU binary utilities (private shared library)

The problem with binutils version 2.31 is that it doesn't compile FPC on 32 bit (always a Segmentation fault).
https://bugs.freepascal.org/view.php?id=34475#c112412

So if you want FPC on Debian Buster 32 bit, you'll need to upgrade or downgrade binutils, which is a complete HELL.

And you can't compile 64 bit on RPI OS Desktop for PC because build-essentials is installed for i386.
And you can't add amd64 version because only one can be installed at the same time (I think).
Code: [Select]
pi@raspberry:~ $ dpkg-query -l | grep build-ess
ii  build-essential                       12.6                                i386         Informational list of build-essential packages

So the only way to install FPC/Lazarus on such machine would be the precompiled/prebuild ones.
« Last Edit: August 28, 2020, 11:33:55 am by rvk »

Thaddy

  • Hero Member
  • *****
  • Posts: 14393
  • Sensorship about opinions does not belong here.
Re: Installing Lazarus on Raspberry PI OS
« Reply #13 on: August 28, 2020, 11:40:40 am »
The problem with binutils version 2.31 is that it doesn't compile FPC on 32 bit (always a Segmentation fault).
https://bugs.freepascal.org/view.php?id=34475#c112412
So the only way to install FPC/Lazarus on such machine would be the precompiled/prebuild ones.
So why can I compile everything daily?
I find that highly unlikely, since my Raspbian ld version is 2.31.1 and have no problems at all....

The only thing that is a bit different from standard Buster is that I added backports to the APT configuration.
Maybe ld 231.1 comes from backports.
« Last Edit: August 28, 2020, 11:49:26 am by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

rvk

  • Hero Member
  • *****
  • Posts: 6171
Re: Installing Lazarus on Raspberry PI OS
« Reply #14 on: August 28, 2020, 11:49:26 am »
The problem with binutils version 2.31 is that it doesn't compile FPC on 32 bit (always a Segmentation fault).
https://bugs.freepascal.org/view.php?id=34475#c112412
So the only way to install FPC/Lazarus on such machine would be the precompiled/prebuild ones.
So why can I compile everything daily?
The only thing that is a bit different from standard Buster is that I added backports to the APT configuration.
I find that highly unlikely, since my Raspbian ld version is 2.31.1 and have no problems at all....
Sorry... Binutils 2.31 on 32 bit on Intel processors (i386/i686).

Every Debian version I tried on i686/i386 (Debian itself and Buster) doesn't compile FPC.

(You are probably using arm on Raspberry Pi itself, but this topic is about "Buster Raspberry PI OS for a PC")

Has any one had any luck getting the latest Lazarus source to compile on the newest Buster Raspberry PI OS for a PC (not the hardware)?

 

TinyPortal © 2005-2018