Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-10

Installing Lazarus on Raspbian Jessie on a Pi2B?

15 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

I have now returned home and got myself the hardware for starting the development in FPC of my controller software for the Raspberry Pi2B. When I installed RaspBian it turned out to be the latest version Jessie and when I realized that I think I need to get confirmation here before I waste time:
Will Lazarus/FPC run properly on a Raspberry Pi2B with Raspbian Jessie?

If so is there a tutorial for that case somewhere?

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Bo Berglund
Bo Berglund wrote 9 lines
I have now returned home and got myself the hardware for starting the development in FPC of my controller software for the Raspberry Pi2B. When I installed RaspBian it turned out to be the latest version Jessie and when I realized that I think I need to get confirmation here before I waste time: Will Lazarus/FPC run properly on a Raspberry Pi2B with Raspbian Jessie? If so is there a tutorial for that case somewhere?

Just to complete my inquiry here is a link to a setup guide: http://www.tweaking4all.com/hardware/raspberry-pi/install-lazarus-pascal-on-raspberry-pi-2/

But it is specifically said to be working on Raspbian Wheezy. The tutorial was written before Raspbian Jessie was out, though, so the reservations in the tutorial might be against other distros different from Raspbian. But I don't know this so I would like to find out if I should downgrade to Wheezy?
Or if the installation procedure will work also on Jessie...

Bo Berglund Developer in Sweden

Reply by email

Mark Morgan Lloyd
to Bo Berglund: I have now returned home and got myself the hardware for starting the development in FPC…
Bo Berglund wrote 9 lines
I have now returned home and got myself the hardware for starting the development in FPC of my controller software for the Raspberry Pi2B. When I installed RaspBian it turned out to be the latest version Jessie and when I realized that I think I need to get confirmation here before I waste time: Will Lazarus/FPC run properly on a Raspberry Pi2B with Raspbian Jessie? If so is there a tutorial for that case somewhere?

If it runs properly, why should you need a tutorial?

Note my comment elsewhere:

> The major "gotcha" is that you can't (by default) SSH into it > as root, which causes problems if you need to run a GUI (i.e. > not just console I/O) program as root with the X11 stuff passing > over the SSH connection.

If you have problems with gtk2, I suggest also trying with Qt which will require the libqt4pas-dev (Debian) package. Please keep us updated since you're the local expert: I didn't even know that Raspbian had progressed to Jessie, and am far too busy to play with it at the moment.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Bo Berglund
to Bo Berglund: On Fri, 02 Oct 2015 18:49:23 +0200, Bo Berglund Just to complete my inquiry here is a…
Bo Berglund wrote
Just to complete my inquiry here is a link to a setup guide: http://www.tweaking4all.com/hardware/raspberry-pi/install-lazarus-pascal-on-raspberry-pi-2/

I went ahead and followed the tutorial for installing Lazarus/FPC but did it on Raspbian-Jessie.

It failed at the first make step....

These were the steps I took following the configuration of the Pi2 including setting swap to 1000 MB and rebooting:

Install Subversion:
--------------------
sudo su
apt-get update
apt-get install -y subversion

Retrieve the boot version of FPC:
------------------------------------
mkdir /usr/local/fpc
cd /usr/local/fpc
wget
http://sourceforge.net/projects/freepascal/files/Linux/2.6.4/fpc-2.6.4.arm-linux.tar tar xvf fpc-2.6.4.arm-linux.tar
cd fpc-2.6.4.arm-linux
./install.sh (Reply /usr/local to the first question)

Download latest FPC sources:
-------------------------------
cd /usr/local/fpc
svn co http://svn.freepascal.org/svn/fpc/trunk source cd source

Compile the FPC compiler:
-------------------------
make all OPT=-dFPC_ARMHF

This is the step that fails after some considerable time and the message displayed at the bottom of the screen is:

[ 53%] Compiled package utils-fprcp
Start compiling package utils-h2pas for target arm-linux. Executing command "/usr/local/bin/plex h2pas/scan.l h2pas/scan.pas" The installer encountered the following error:
External command "/usr/local/bin/plex h2pas/scan.l h2pas/scan.pas" failed with exit code 256. Console output:
TP Lex Version 4.1a [April 2000], Copyright (c) 1990-2000 Albert Graef

FATAL: cannot open file /usr/lib/fpc/lexyacc/yylex.cod

Makefile:2403: recipe for target 'all' failed
make[2]: *** [all] Error 1
make[2]: Leaving directory '/usr/local/fpc/source/utils' Makefile:2650: recipe for target 'utils_all' failed make[1]: *** [utils_all] Error 2
make[1]: Leaving directory '/usr/local/fpc/source' Makefile:2895: recipe for target 'build-stamp.arm-linux' failed make: *** [build-stamp.arm-linux] Error 2

What could I do to get over this error so the make can complete?? Obviously the make in the source dir should work, but maybe not with the FPC version 2.6.4?
If that is the case, how could I get an ARM7 version of the compiler to use for compiling the trunk version of fpc?

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Mark Morgan Lloyd: If it runs properly, why should you need a tutorial? Note my comment elsewhere: If you…
Mark Morgan Lloyd wrote 25 lines
Bo Berglund wrote: > I have now returned home and got myself the hardware for starting the > development in FPC of my controller software for the Raspberry Pi2B. > When I installed RaspBian it turned out to be the latest version > Jessie and when I realized that I think I need to get confirmation > here before I waste time: > Will Lazarus/FPC run properly on a Raspberry Pi2B with Raspbian > Jessie? > > If so is there a tutorial for that case somewhere? If it runs properly, why should you need a tutorial? Note my comment elsewhere: >> The major "gotcha" is that you can't (by default) SSH into it >> as root, which causes problems if you need to run a GUI (i.e. >> not just console I/O) program as root with the X11 stuff passing >> over the SSH connection. If you have problems with gtk2, I suggest also trying with Qt which will require the libqt4pas-dev (Debian) package. Please keep us updated since you're the local expert: I didn't even know that Raspbian had progressed to Jessie, and am far too busy to play with it at the moment.

The tutorial is quoting the Lazarus GUI but at a later point in time in the steps to install FPC and Lazarus. I have managed to get VTK server running but only after manually starting it. But it is not yet needed.
I am now in an SSH PuTTY shell trying to install fpc and Lazarus.

As I already posted I followed the tutorial and got to a make error basically complaining about a missing file in the fpc source tree. This is in the first make command in the tutorial where fpc trunk is going to be built from sources using fpc 2.6.4 for arm-linux.

This is a problem I have no chance to fix....

Bo Berglund Developer in Sweden

Reply by email

Mark Morgan Lloyd
to Bo Berglund: On Fri, 02 Oct 2015 22:11:48 +0200, Bo Berglund I went ahead and followed the tutorial…
Bo Berglund wrote 11 lines
On Fri, 02 Oct 2015 22:11:48 +0200, Bo Berglund wrote: > Just to complete my inquiry here is a link to a setup guide: > http://www.tweaking4all.com/hardware/raspberry-pi/install-lazarus-pascal-on-raspberry-pi-2/ > I went ahead and followed the tutorial for installing Lazarus/FPC but did it on Raspbian-Jessie. It failed at the first make step....

Go back to discussion in The Other Place and start off with the right FPC binary. Once you've got it you can recompile FPC if you like (I prefer to), then once you're happy with that compiling Lazarus is a no-brainer /provided/ that you have enough RAM+swap set up.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Bo Berglund
to Bo Berglund: On Fri, 02 Oct 2015 21:45:50 +0000, Mark Morgan Lloyd The tutorial is quoting the Lazarus…
Bo Berglund wrote 6 lines
As I already posted I followed the tutorial and got to a make error basically complaining about a missing file in the fpc source tree. This is in the first make command in the tutorial where fpc trunk is going to be built from sources using fpc 2.6.4 for arm-linux. This is a problem I have no chance to fix....

BTW, should I post this problem on the fpc list instead of here? It seems to be an fpc build problem, Lazarus has not yet been downloaded...

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Mark Morgan Lloyd: Go back to discussion in The Other Place and start off with the right FPC binary. Once…
Mark Morgan Lloyd wrote
Go back to discussion in The Other Place and start off with the right FPC binary. Once you've got it you can recompile FPC if you like (I prefer to), then once you're happy with that compiling Lazarus is a no-brainer /provided/ that you have enough RAM+swap set up.

I assumed that by "The Other Place" you meant the free-pascal.general mailing list/newsgroup (I am using the Gmane news mirror) so I went there and tried to find something regarding this but failed.

Could you specify the subject of the thread please?

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Bo Berglund: On Fri, 02 Oct 2015 22:11:48 +0200, Bo Berglund I went ahead and followed the tutorial…
Bo Berglund wrote 7 lines
Executing command "/usr/local/bin/plex h2pas/scan.l h2pas/scan.pas" The installer encountered the following error: External command "/usr/local/bin/plex h2pas/scan.l h2pas/scan.pas" failed with exit code 256. Console output: TP Lex Version 4.1a [April 2000], Copyright (c) 1990-2000 Albert Graef FATAL: cannot open file /usr/lib/fpc/lexyacc/yylex.cod

I went looking for /usr/lib/fpc/lexyacc/yylex.cod and found that the directory /usr/lib/fpc did not even exist!

Is that part of the install of fpc 2.6.4 for arm??? If so why is it missing?
Otherwise did I get the wrong compiler to compile trunk with? It was retrieved thusly:
wget
http://sourceforge.net/projects/freepascal/files/Linux/2.6.4/fpc-2.6.4.arm-linux.tar

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Bo Berglund: On Fri, 02 Oct 2015 18:49:23 +0200, Bo Berglund Just to complete my inquiry here is a…
Bo Berglund wrote 15 lines
On Fri, 02 Oct 2015 18:49:23 +0200, Bo Berglund wrote: >Will Lazarus/FPC run properly on a Raspberry Pi2B with Raspbian >Jessie? > Just to complete my inquiry here is a link to a setup guide: http://www.tweaking4all.com/hardware/raspberry-pi/install-lazarus-pascal-on-raspberry-pi-2/ But it is specifically said to be working on Raspbian Wheezy. The tutorial was written before Raspbian Jessie was out, though, so the reservations in the tutorial might be against other distros different from Raspbian. But I don't know this so I would like to find out if I should downgrade to Wheezy? Or if the installation procedure will work also on Jessie...

I will answer myself:
----------------------
After a number of hours spent in vain to install in Raspbian Jessie I reverted to Raspbian Wheezy from May 5, 2015 and with that the tutorial linked to above works just fine!
So the problems I had was caused by me using the wrong version of Raspbian!

I now have Lazarus running with FPC 3.1.1 on my Raspberry Pi2B and I can access the desktop if need be using VNC.

All so far seems to work fine (only made a small Hello world program to chack that it does work).

The tutorial describes installing averything from sources downloaded using subversion, so I guess that means I now have the bleeding edge trunk version of both fpc and lazarus for ARM. :)

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Mark Morgan Lloyd: If it runs properly, why should you need a tutorial? Note my comment elsewhere: If you…
Mark Morgan Lloyd wrote 5 lines
If you have problems with gtk2, I suggest also trying with Qt which will require the libqt4pas-dev (Debian) package. Please keep us updated since you're the local expert: I didn't even know that Raspbian had progressed to Jessie, and am far too busy to play with it at the moment.

Just to update:
After changing to Raspbian Wheezy the tutorial I linked to worked fine and I now have fpc 3.1.1 and Lazarus trunk installed from sources retrieved with svn. :)

Bo Berglund Developer in Sweden

Reply by email

Mark Morgan Lloyd
to Bo Berglund: On Fri, 02 Oct 2015 21:54:40 +0000, Mark Morgan Lloyd I assumed that by "The Other Place"…
Bo Berglund wrote 13 lines
On Fri, 02 Oct 2015 21:54:40 +0000, Mark Morgan Lloyd wrote: > Go back to discussion in The Other Place and start off with the right > FPC binary. Once you've got it you can recompile FPC if you like (I > prefer to), then once you're happy with that compiling Lazarus is a > no-brainer /provided/ that you have enough RAM+swap set up. I assumed that by "The Other Place" you meant the free-pascal.general mailing list/newsgroup (I am using the Gmane news mirror) so I went there and tried to find something regarding this but failed. Could you specify the subject of the thread please?

See http://lists.freepascal.org/pipermail/fpc-pascal/2015-August/045156.html

Now that was when I was starting off with "Wheezy" dated 2014, which had some library problems which were not apparent with one dated 2015. So get the binaries tailored for the Rpi from the link I've given, if you want to recompile (e.g. from Subversion) don't put in the -FL and -Fl options until you need them.

After installation, check that there's a symlink in /usr/local/bin pointing to your new compiler (expect this to be in something like /usr/local/lib/fpc/3.0.1 if building the v3 release candidate).

Get the Lazarus source, but make sure you have enough memory before trying to build using make bigide or whatever. If the IDE appears to give problems with gtk2 try Qt, shout here if that doesn't make immediate sense to you.

It's fairly painless, but as you'll see people saying on a regular basis you've either got to start off with the right binaries for the RPi or you've got to cross-build them yourself.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Mark Morgan Lloyd
to Bo Berglund: On Fri, 02 Oct 2015 21:45:50 +0000, Mark Morgan Lloyd Just to update: After changing to…
Bo Berglund wrote 12 lines
On Fri, 02 Oct 2015 21:45:50 +0000, Mark Morgan Lloyd wrote: > If you have problems with gtk2, I suggest also trying with Qt which will > require the libqt4pas-dev (Debian) package. Please keep us updated since > you're the local expert: I didn't even know that Raspbian had progressed > to Jessie, and am far too busy to play with it at the moment. > Just to update: After changing to Raspbian Wheezy the tutorial I linked to worked fine and I now have fpc 3.1.1 and Lazarus trunk installed from sources retrieved with svn. :)

Well done :-)

I intermittently run Lazarus on a range of architectures from ARM to x86_64 using Linux and (where appropriate) Solaris, and it's rare to find any significant differences between them. Maintaining code that also has to run on Windows can be a bit more difficult, and having something that will compile on either Lazarus or Delphi benefits from a cautious approach.

Have you sorted out your earlier problems understanding what can be done over SSH etc.?

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Bo Berglund
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote
Have you sorted out your earlier problems understanding what can be done over SSH etc.?

I did all of the installation of fpc-lazarus-vnc on the command line using PuTTY over SSH.
When I was in the USA I also connected back home (other side of the Atlantic) using OpenVPN (server is a Pi) then connected PuTTY again to the remote Pi and installed VNC. Then I connected the desktop via VNC over the VPN tunnel.
All worked very well.

Bo Berglund Developer in Sweden

Reply by email

Mark Morgan Lloyd
to Bo Berglund
Bo Berglund wrote 13 lines
On Sat, 03 Oct 2015 10:20:39 +0000, Mark Morgan Lloyd wrote: > Have you sorted out your earlier problems understanding what can be done > over SSH etc.? > I did all of the installation of fpc-lazarus-vnc on the command line using PuTTY over SSH. When I was in the USA I also connected back home (other side of the Atlantic) using OpenVPN (server is a Pi) then connected PuTTY again to the remote Pi and installed VNC. Then I connected the desktop via VNC over the VPN tunnel. All worked very well.

Good. You might find that some X11 programs (including some versions of Lazarus) are significantly faster over VNC than over a remote X11 link (i.e. tunnelled over SSH, or set up using XDMCP). This usually happens because something starts polling input devices more rapidly than is reasonable, and VNC effectively caches things.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email