Recent

Author Topic: how to build lazarus on raspberry pi 1  (Read 8025 times)

bee

  • Sr. Member
  • ****
  • Posts: 393
how to build lazarus on raspberry pi 1
« on: March 04, 2015, 05:09:49 pm »
Hi all,

I just got my Raspberry Pi 1 B+ model (Raspbian). I want to install the latest Free Pascal and Lazarus on it. I managed to successfully build Free Pascal trunk (v.3.1.1 from FPC's official SVN) on it using Free Pascal stable (v.2.6.4-arm-linux from FPC's official SourceForge repository). But I still failed to make the debugger works on the text-mode IDE. Any help how to make it works is very much appreciated.

Now, I'm trying to build Lazarus trunk, using FPC trunk. The build command is:

Code: [Select]
pi@raspi /usr/local/lazarus/trunk $ sudo make clean all OPT="-CpARMv6 -dFPC_ARMHF"
It's the same 'make' command I had used to build the FPC trunk. Unfortunately, it failed building Lazarus while assembling 'codeexplorer.pas'. The error message is:

Code: [Select]
...
Compiling codeexplorer.pas
Assembling codeexplorer
codeexplorer.pas(2831) Error: Can't call the assembler, error -1 switching to external assembling
codeexplorer.pas(2831) Fatal: There were 2 errors compiling module, stopping
Fatal: Compilation aborted
Makefile:3795: recipe for target 'lazarus' failed
...

Which I think a bit strange, because how could it not call the assembler? It's clearly there and the same assembler has been used to build FPC trunk successfully. I still haven't find any solutions to solve this problem. Could anybody here provide some clues?

I found someone seems to have no problem building Lazarus on Raspberry 2 using similar 'make' command above. It's on: http://otapi.com/2015/02/10/raspberry-pi-2-freepascal-lazarus-and-delphi/. I wonder, what's the difference between Raspi 1 and Raspi 2 in term of building Free Pascal and Lazarus?

Thank you.

Regards,

-Bee
« Last Edit: March 04, 2015, 05:19:18 pm by bee »
-Bee-

A long time pascal lover.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: how to build lazarus on raspberry pi 1
« Reply #1 on: March 04, 2015, 07:51:52 pm »
Stock FPC 2.6.x including 2.6.4 does not support v6/ARMHF (raspbian). Raspbian backported this support from trunk to 2.6.4 in their own versions, so this is all logical.

If you want to use stock files, crosscompile from 3.x (generated on a 2.6.x supported platform), or start with raspbian 2.6.4

bee

  • Sr. Member
  • ****
  • Posts: 393
Re: how to build lazarus on raspberry pi 1
« Reply #2 on: March 05, 2015, 06:19:40 am »
Hi Marco,

I have successfully build FPC 3.1.1 using FPC 2.6.4. I found no problem except that FP IDE couldn't activate the debugger. Otherwise, it's all fine. The generated FPC 3.1.1 supports v6/ARMHF. Well... I haven't tried it to compile big projects, but for some simple projects of mine, they run fine.

My problem now is how to build Lazarus trunk using FPC 3.1.1, as I described above. Any hints?

Thank you.

Regards,

-Bee
-Bee-

A long time pascal lover.

bee

  • Sr. Member
  • ****
  • Posts: 393
Re: how to build lazarus on raspberry pi 1
« Reply #3 on: March 07, 2015, 02:25:37 pm »
It seems like nobody uses Lazarus on Raspberry Pi 1. :(
-Bee-

A long time pascal lover.

irfanbagus

  • Jr. Member
  • **
  • Posts: 73
Re: how to build lazarus on raspberry pi 1
« Reply #4 on: March 07, 2015, 06:04:40 pm »
never try on raspi, but on linux just run 'make' command from lazarus source path will build lazarus. but you need working fpc (from raspbian repo should be ok) and gtk2-devel package.

but, even if it's working, get ready for long process because raspi cpu is very slow. if you just want to write application for raspi, my advise, just write (and debug) from linux pc then cross compile for raspi.

jwdietrich

  • Hero Member
  • *****
  • Posts: 1232
    • formatio reticularis
Re: how to build lazarus on raspberry pi 1
« Reply #5 on: March 07, 2015, 08:20:57 pm »
Small applications are easy to build even on Raspberry Pi 1.
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.2.6 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

richard_rtech

  • New Member
  • *
  • Posts: 35
Re: how to build lazarus on raspberry pi 1
« Reply #6 on: March 08, 2015, 03:42:27 pm »
I'm on my way out but I struggled with this and your first obsicle is that you may be running out of resource. Goggle enabling swap on USB drive and try again. When I started I had similar issues

FWIW I'm using the 'jessie' precompiled packages from : http://www.raspberrypi.org/forums/viewtopic.php?f=34&t=7422&start=75 old but work plenty well enough.


avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: how to build lazarus on raspberry pi 1
« Reply #7 on: March 09, 2015, 12:00:38 pm »
It seems like nobody uses Lazarus on Raspberry Pi 1. :(
It seams like someone is not using forum search:  ;)
http://forum.lazarus.freepascal.org/index.php/topic,23248.msg138609.html#msg138609
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

richard_rtech

  • New Member
  • *
  • Posts: 35
Re: how to build lazarus on raspberry pi 1
« Reply #8 on: March 09, 2015, 05:51:11 pm »
It seems like nobody uses Lazarus on Raspberry Pi 1. :(
It seams like someone is not using forum search:  ;)
http://forum.lazarus.freepascal.org/index.php/topic,23248.msg138609.html#msg138609

I was about to say the same. Its been covered quite a bit now and I know I've posted on it more than once.

I've had this error caused by running out of memory, google for adding swap on a USB drive and have fun. The Pi is painfully slow running the more recent versions, the Pi2 is way more useable. Do some googling about setting up cross compilation or just plain cheat and setup identical build environments on a Debian PC and the Pi, that way you can test and play around, ten when you need to try it on the PI itself you only have one build to worry about.

There is a repository with an older (but more recent than Raspbian) build in. Google "jessie pi lazarus"

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
Re: how to build lazarus on raspberry pi 1
« Reply #9 on: March 12, 2015, 05:22:45 pm »
Lazarus 3.0/FPC 3.2.2

ghamm

  • New Member
  • *
  • Posts: 29
Re: how to build lazarus on raspberry pi 1
« Reply #10 on: March 25, 2015, 10:11:10 pm »
I have a raspberry 2.. love it and love FP on it..  Lots of fun..

 

TinyPortal © 2005-2018