Recent

Author Topic: Lazarus with RPi 3  (Read 30371 times)

krolikbest

  • Full Member
  • ***
  • Posts: 247
Lazarus with RPi 3
« on: October 27, 2016, 08:40:16 pm »
Hi

i try to install fpc and lazarus on Raspberry Pi 3 (system Raspbian). Could someone to explain me how to do it? On the Wiki I've found only for RPi 1 or 2, and making sudo ... get error , even stop working Raspbian :(

Thx in advance,

Martin

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Lazarus with RPi 3
« Reply #1 on: October 27, 2016, 11:55:36 pm »
Should not differ between Pi version, the underlying Raspbian OS is the same for all boards. You need to get your hands better on Raspbian first as:
Quote
making sudo ... get error , even stop working Raspbian
is a sign you don't know the OS well enough to work on it.

krolikbest

  • Full Member
  • ***
  • Posts: 247
Re: Lazarus with RPi 3
« Reply #2 on: October 28, 2016, 09:19:43 am »
I know i don't know :) (OS of course), but want to port some of my programs i've written for windows to RPi3. instead of public whipping, i need some explanation hoto install :)

Martin

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: Lazarus with RPi 3
« Reply #3 on: October 28, 2016, 09:41:59 am »
You could try cross-compiling first.
And for this cross-compiling, you could use a NewPascal install. See:
https://github.com/newpascal/newpascal/releases/tag/np_sc-v1.0.34

And also (very important) look at this message-thread:
http://forum.lazarus.freepascal.org/index.php/topic,27211.msg226806.html#msg226806
If you have a form, you will need this into the beginning of your Lazarus lpr-file:
Code: Pascal  [Select][+][-]
  1. {$IFDEF LINUX}
  2.   {$IFDEF FPC_CROSSCOMPILING}
  3.     {$linklib libc_nonshared.a}
  4.     {$IFDEF CPUARM} // this is for Raspberry Pi and similars
  5.       // if we have a GUI (form), uncomment
  6.       {$linklib GLESv2}
  7.     {$ENDIF}
  8.   {$ENDIF}
  9. {$ENDIF}

Thaddy

  • Hero Member
  • *****
  • Posts: 14382
  • Sensorship about opinions does not belong here.
Re: Lazarus with RPi 3
« Reply #4 on: October 28, 2016, 09:43:21 am »
There is a version on getlazarus.org that I use myself sometimes (if I need 3.0/1.7 instead of trunk) on a RPi3.
Works out of the box on Raspbian. See http://www.getlazarus.org/setup/?download#none and navigate to the Raspberry.

You may have noticed I actually use it a lot. This is the ONLY version that I know that has no issues and is compiled correctly.
The latter is important if you also want to do trunk builds later yourself.

Note that it is absolutely not necessary to cross-compile first on a RPi2 or 3 (Or even 1, but that is slower and needs swapspace setup now).
These little boxes are perfectly capable of building natively.
At the moment I can not fully recommend the newpascal solution yet for beginners and advise strongly to use the version from my above link.
This opinion may change in the future....
« Last Edit: October 28, 2016, 09:50:15 am by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

rvk

  • Hero Member
  • *****
  • Posts: 6169
Re: Lazarus with RPi 3
« Reply #5 on: October 28, 2016, 09:48:27 am »
If you want to install trunk you can follow the guidelines I once posted.
http://forum.lazarus.freepascal.org/index.php/topic,33254.msg215422.html#msg215422

Note1: That is not a script but are guidelines/commands you need to execute to download and compile FPC & Lazarus.

Note2: It will put Lazarus in /usr/local/share/lazarus. I haven't gotten around to putting Lazarus in a user-directory.

Thaddy

  • Hero Member
  • *****
  • Posts: 14382
  • Sensorship about opinions does not belong here.
Re: Lazarus with RPi 3
« Reply #6 on: October 28, 2016, 09:52:45 am »
This IS as script and it works even for beginners:
http://www.getlazarus.org/download/?platform=raspberry

Will give you a perfect install on your Raspberry Pi 3.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

rvk

  • Hero Member
  • *****
  • Posts: 6169
Re: Lazarus with RPi 3
« Reply #7 on: October 28, 2016, 10:08:27 am »
This IS as script and it works even for beginners:
http://www.getlazarus.org/download/?platform=raspberry

Will give you a perfect install on your Raspberry Pi 3.
When is the last time you tried the script? It doesn't work (for me).
At least if Curl is installed it won't follow the redirect of the dropbox download.
(not sure if the wget will. yes, wget will so if curl isn't installed it will work without change.)
You need to add -L to the curl command for that in the download-function in the script.

Not sure if curl is installed standard on RPI3 pixel but I don't think a beginner will find that easily.

Note: The getlazarus script downloads a precompiled version from dropbox.
(less to go wrong that way I guess :))
« Last Edit: October 28, 2016, 10:10:07 am by rvk »

krolikbest

  • Full Member
  • ***
  • Posts: 247
Re: Lazarus with RPi 3
« Reply #8 on: October 28, 2016, 10:09:07 am »
I did:
First i've downloaded new version of Rasbian and installed then
once again i've written sudo apt-get fpc, then sudo apt-get lazarus and installed version 1.2.4. Can i get something more new than 1.2.4

Thanks very much for your previous help!

martin

rvk

  • Hero Member
  • *****
  • Posts: 6169
Re: Lazarus with RPi 3
« Reply #9 on: October 28, 2016, 10:12:44 am »
Can i get something more new than 1.2.4
Above these post we've already mentioned two ways to get a newer version.
Follow my guidelines to get the latest development version (trunk)
Or use the script from getlazarus.org. (if you have curl you'll need to add -L in the script to get it to work)

krolikbest

  • Full Member
  • ***
  • Posts: 247
Re: Lazarus with RPi 3
« Reply #10 on: October 28, 2016, 10:19:11 am »
thanks, i'll try.

martin

Thaddy

  • Hero Member
  • *****
  • Posts: 14382
  • Sensorship about opinions does not belong here.
Re: Lazarus with RPi 3
« Reply #11 on: October 28, 2016, 10:24:35 am »
This IS as script and it works even for beginners:
http://www.getlazarus.org/download/?platform=raspberry

Will give you a perfect install on your Raspberry Pi 3.
When is the last time you tried the script? It doesn't work (for me).

Just now. It is already finished. I will attach the screenshots from a newly unboxed rp3 with raspbian.
All I had to do was type ./setup.sh and press y a couple of times. Note that I have the dependencies installed when asked.
[edit]
Hmm...
A  second one (also on a new RP3) timed out.. Never seen that. Unexpected EOF? You've seen that?

I did something different: first one connected through cable, second one through wifi on the pi.
« Last Edit: October 28, 2016, 10:43:54 am by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Thaddy

  • Hero Member
  • *****
  • Posts: 14382
  • Sensorship about opinions does not belong here.
Re: Lazarus with RPi 3
« Reply #12 on: October 28, 2016, 10:45:16 am »
So eventually (after a retry on the second) both installed correctly on two new RP3 Raspbians using the getlazarus script.

I am out of hardware to test more ;) No pi's left, no sd cards left.
« Last Edit: October 28, 2016, 10:48:53 am by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

rvk

  • Hero Member
  • *****
  • Posts: 6169
Re: Lazarus with RPi 3
« Reply #13 on: October 28, 2016, 10:47:59 am »
This IS as script and it works even for beginners:
http://www.getlazarus.org/download/?platform=raspberry
Will give you a perfect install on your Raspberry Pi 3.
When is the last time you tried the script? It doesn't work (for me).
Just now. It is already finished. I will attach the screenshots from a newly unboxed rp3 with raspbian.
All I had to do was type ./setup.sh and press y a couple of times. Note that I have the dependencies installed when asked.
That's really strange. I just tried with a new installation with the 2016-09-23-raspbian-jessie and it had curl pre-installed.
Doing ./setup.sh got me the result below (because curl doesn't redirect without -L).

Do you have curl installed on your newly installed RPI3?
And what version of jessie did you use ??

Code: [Select]
Raspberry Free Pascal 3.0 with Lazarus install script
-----------------------------------------------------
This script will install a lightweight version of

The Free Pascal Compiler version 3.0
The Lazarus Development Environment

After install 280MB of drive space will be used

This lightweight version is designed specifically
for the Raspberry Pi running Raspbian OS

Enter an installation folder or press return to
accept the default install location

[/home/pi/Development/FreePascal]:

The install folder will be:
/home/pi/Development/FreePascal

Continue? (y,n): y

After install do you want to shortcuts created in:
/home/pi/.local/share/applications (y/n)? y

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
[b]tar: fpc.lazarus.raspberry.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
rm: cannot remove âfpc.lazarus.raspberry.tar.gzâ: No such file or directory
[/b]./setup.sh: line 206: /home/pi/Development/FreePascal/fpc/bin/fpcmkcfg: No such file or directory
find: `/home/pi/Development/FreePascal/lazarus/config': No such file or directory
find: `/home/pi/Development/FreePascal/lazarus/config': No such file or directory
find: `/home/pi/Development/FreePascal/lazarus': No such file or directory
find: `/home/pi/Development/FreePascal/lazarus': No such file or directory
cp: cannot stat â/home/pi/Development/FreePascal/lazarus/lazarus.desktopâ: No such file or directory
mv: cannot stat â/home/pi/Development/FreePascal/lazarus/lazarus.desktopâ: No such file or directory
./setup.sh: line 237: /home/pi/Development/FreePascal/fpc/bin/fpc-terminal.sh: No such file or directory
./setup.sh: line 238: /home/pi/Development/FreePascal/fpc/bin/fpc-terminal.sh: No such file or directory
./setup.sh: line 239: /home/pi/Development/FreePascal/fpc/bin/fpc-terminal.sh: No such file or directory
./setup.sh: line 240: /home/pi/Development/FreePascal/fpc/bin/fpc-terminal.sh: No such file or directory
chmod: cannot access â/home/pi/Development/FreePascal/fpc/bin/fpc-terminal.shâ: No such file or directory

Your Free Pascal 3.0 with Lazarus is now installed

On a complete clean RPI3 with new jessie:
Code: [Select]
pi@raspberrypi:~ $ curl --version
curl 7.38.0 (arm-unknown-linux-gnueabihf) libcurl/7.38.0 OpenSSL/1.0.1t zlib/1.2.8 libidn/1.29 libssh2/1.4.3 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API SPNEGO NTLM NTLM_WB SSL libz TLS-SRP
pi@raspberrypi:~ $
« Last Edit: October 28, 2016, 10:49:48 am by rvk »

Thaddy

  • Hero Member
  • *****
  • Posts: 14382
  • Sensorship about opinions does not belong here.
Re: Lazarus with RPi 3
« Reply #14 on: October 28, 2016, 10:54:04 am »
A Raspbian that came with the sd card, but with all updates that are available today:
raspi-config and an apt-get update and dist-upgrade
Only the second install via wifi had an unexpected EOF due to a time-out.

As you can see: cUrl is indeed installed by default.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

 

TinyPortal © 2005-2018