Sign in Join

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

Mailing lists / lazarus / 2015-10

Building and starting Lazarus on Raspberry Pi2 with Raspbian Jessie

12 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Bo Berglund

I am creating this thread to move away my Lazarus build questions from the thread I was in recently, where it is really OT.

I was able to build both FPC (3.1.1 trunk from svn) and Lazarus (v 1.5 svn 50023 trunk from svn) using the writeup in this webpage: http://www.tweaking4all.com/hardware/raspberry-pi/install-lazarus-pascal-on-raspberry-pi-2 However it became apparent that something was wrong since I did not get to the pi home dir when saving stuff, instead it wound up in /root. THe webpage instructions started with sudo su and never did an exit so all of it was done using root.

Now I am trying to rectify that and I have done the following on advice here:
1) Disable the existing Lazarus install by renaming the folder: sudo mv /usr/local/share/lazarus /usr/local/share/lazarus_old

2) Create a folder /home/pi/development
3) Check out lazarus trunk into subdir development/lazarus (got svn 50059 this time)

4) Reconfigure Pi to boot to the command line interface to save memory and reboot.

5) Go to ~/development/lazarus and run:
time make bigide
This completes in about 17 minutes

6) Start tightvncserver and log on to the GUI via VNC
7) Now try to run Lazarus...

This is where it falls apart. The Lazarus entry on the Menu is of course non-working since the rename in step 1.

So using the main menu editor I added a new Lazarus entry into the Programming submenu by navigating to the startlazarus file inside the lazarus dir. So far so good. Except there is no Lazarus icon...

When starting from the new menu entry I got a dialog asking me if I had moved Lazarus and wanted to transfer the local settings to this new Lazarus, which I accepted. Next dialog regarding location of sources etc I also accepted.
Then when the IDE was to start I got an error dialog saying:

Error in EditorMacroScript
The package EditorMacroScript (pascalscript macros) has detected a problem and was deactivated.
The package failed its selftest with the message:
"Failed getstr2 [Ext
p: "456" / Got: "abc"]"

There was only an OK button so I hit that and Lazarus showed. It even loaded my last project. Which compiled and ran fine! :)

What is the deal here? Is this an error that should be resolved by me by starting over from scratch again (6th time this week) with a clean SDcard? :(
Or is it unimportant and can be solved in a different way? Which?

Bo Berglund Developer in Sweden

Reply by email

Mark Morgan Lloyd
to Bo Berglund
Bo Berglund wrote 6 lines
Error in EditorMacroScript The package EditorMacroScript (pascalscript macros) has detected a problem and was deactivated. The package failed its selftest with the message: "Failed getstr2 [Ext p: "456" / Got: "abc"]"

If you're compiling trunk and get something like this, the first thing to do is check whether somebody's just fixed it. It's very much a "movable feast" and it's difficult to know at which point's it's completely consistent, in general I try to work with the latest tagged release unless I specifically know there's something I should be testing.

$ svn ls http://svn.freepascal.org/svn/lazarus/tags ..
lazarus_1_4/
lazarus_1_4_2/
lazarus_1_4_4/ <--- Most recent
lazarus_1_4_RC1/
lazarus_1_4_RC2/
lazarus_1_4_RC3/

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 5 lines
If you're compiling trunk and get something like this, the first thing to do is check whether somebody's just fixed it. It's very much a "movable feast" and it's difficult to know at which point's it's completely consistent, in general I try to work with the latest tagged release unless I specifically know there's something I should be testing.

Well, as I said I just blindly followed the tutorial not really knowing what was going on in order to get Lazarus operational on the Pi. It prescribed trunk where it probably would have been appropriate to specify a release tag...
My task is to create a controller application using older object definition files from Delphi but targeting the Raspberry Pi2.

Show quoted text 9 lines
$ svn ls http://svn.freepascal.org/svn/lazarus/tags .. lazarus_1_4/ lazarus_1_4_2/ lazarus_1_4_4/ <--- Most recent lazarus_1_4_RC1/ lazarus_1_4_RC2/ lazarus_1_4_RC3/

Is there a non-destructive way to go backwards on revisions with svn? To be honest I have only actively used CVS as version control (daily since about 2000) and never before svn...
Would I have to scrap the existing checkout and start over? Or is there a "backwards" command that would get the sources of 1.4.4 and then still be possible to compile from the Lazaus Tools menu?

Notice that the very same tutorial got me FPC 3.1.1 built from source (trunk) and done as root...

Bo Berglund Developer in Sweden

Reply by email

Mark Morgan Lloyd
to Bo Berglund
Bo Berglund wrote 15 lines
On Thu, 15 Oct 2015 21:26:33 +0000, Mark Morgan Lloyd wrote: > If you're compiling trunk and get something like this, the first thing > to do is check whether somebody's just fixed it. It's very much a > "movable feast" and it's difficult to know at which point's it's > completely consistent, in general I try to work with the latest tagged > release unless I specifically know there's something I should be testing. Well, as I said I just blindly followed the tutorial not really knowing what was going on in order to get Lazarus operational on the Pi. It prescribed trunk where it probably would have been appropriate to specify a release tag... My task is to create a controller application using older object definition files from Delphi but targeting the Raspberry Pi2.

I simply used the standard 1.4 sources. And I'm pretty sure I've already told you that.

Show quoted text 16 lines
> $ svn ls http://svn.freepascal.org/svn/lazarus/tags > .. > lazarus_1_4/ > lazarus_1_4_2/ > lazarus_1_4_4/ <--- Most recent > lazarus_1_4_RC1/ > lazarus_1_4_RC2/ > lazarus_1_4_RC3/ > Is there a non-destructive way to go backwards on revisions with svn? To be honest I have only actively used CVS as version control (daily since about 2000) and never before svn... Would I have to scrap the existing checkout and start over? Or is there a "backwards" command that would get the sources of 1.4.4 and then still be possible to compile from the Lazaus Tools menu?

The problem with Subversion is that the revision number and tagged releases are distinct, so except in the case of trunk it's difficult to say "get 1.4.4, then step back one revision".

In the case of trunk (looking at an arbitrary machine here)...

$ cd /usr/local/share/lazarus-trunk
$ svn info
Path: .
URL: http://svn.freepascal.org/svn/lazarus/trunk
Repository Root: http://svn.freepascal.org/svn/lazarus Repository UUID: 4005530d-fff6-0310-9dd1-cebe43e6787f Revision: 40413
Node Kind: directory
Schedule: normal
Last Changed Author: mattias
Last Changed Rev: 40413
Last Changed Date: 2013-02-26 09:43:50 +0000 (Tue, 26 Feb 2013)

# You don't need this, but to see who's just done what:

$ svn log -l 1
------------------------------------------------------------------------ r40413 | mattias | 2013-02-26 09:43:50 +0000 (Tue, 26 Feb 2013) | 1 line

openglcontrol: vrbosity
------------------------------------------------------------------------

# Step back one revision:

$ svn up -r 40412
U components/opengl/glgtkglxcontext.pas
Updated to revision 40412.

# Clean and build:

$ make clean bigide
Notice that the very same tutorial got me FPC 3.1.1 built from source (trunk) and done as root...

Yes, and you eventually worked out that doing everything as root wasn't needed.

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
I simply used the standard 1.4 sources. And I'm pretty sure I've already told you that.

Will Lazarus 1.4.x work with FPC 3.1.1?
Or do I have to scrap all of what I have done and start over?

Show quoted text 8 lines
>> $ svn ls http://svn.freepascal.org/svn/lazarus/tags >> .. >> lazarus_1_4/ >> lazarus_1_4_2/ >> lazarus_1_4_4/ <--- Most recent >> lazarus_1_4_RC1/ >> lazarus_1_4_RC2/ >> lazarus_1_4_RC3/

I guess I would need 1.4.4 then, or is that what you get from 1.4?

Show quoted text 8 lines
The problem with Subversion is that the revision number and tagged releases are distinct, so except in the case of trunk it's difficult to say "get 1.4.4, then step back one revision". In the case of trunk (looking at an arbitrary machine here)... $ cd /usr/local/share/lazarus-trunk $ svn info

Here is what I currently have in the lazarus dir:
pi at rpi2-jessie ~/development/lazarus $ svn info Path: .
Working Copy Root Path: /home/pi/development/lazarus URL: http://svn.freepascal.org/svn/lazarus/trunk
Relative URL: ^/trunk
Repository Root: http://svn.freepascal.org/svn/lazarus Repository UUID: 4005530d-fff6-0310-9dd1-cebe43e6787f Revision: 50059
Node Kind: directory
Schedule: normal
Last Changed Author: juha
Last Changed Rev: 50059
Last Changed Date: 2015-10-14 18:39:48 +0200 (Wed, 14 Oct 2015)

So I am on trunk...

# Step back one revision: $ svn up -r 40412

OK, that is when you use the revision number, what about the tag name?

I have googled for how to move to a particular Subversion tag (aka branch).
I found this webpabe:
http://svnbook.red-bean.com/en/1.1/ch04s05.html

When trying to understand the concept I wound up with this command:

svn switch http://svn.freepascal.org/svn/lazarus/lazarus_1_4_4

Executed inside the already checked out trunk copy, would this get me to the tag lazarus_1_4_4?

Or is it better to just delete the development/lazarus dir and then do a checkout from development? Like this:
cd /home/pi/development
rm -r lazarus
svn co http://svn.freepascal.org/svn/lazarus/lazarus_1_4_4 lazarus cd lazarus
make clean bigide

Last question:
I have seen different suggested locations for lazarus here.

Juha suggested:
~/development/lazarus

but your example shows:
/usr/local/share/lazarus-trunk

and the tutorial I started with uses:
/usr/local/lazarus

This confuses me a lot, what is the "standard" way of locating programs like Lazarus (and fpc for that matter)?

Bo Berglund Developer in Sweden

Reply by email

Juha Manninen
to Bo Berglund: I am creating this thread to move away my Lazarus build questions from the thread I was…
PM Bo Berglund wrote
5) Go to ~/development/lazarus and run: time make bigide This completes in about 17 minutes

This is quite fast. Last time it took an hour, didn't it? Looks like Raspberry Pi2 is fast enough for most personal computing tasks.

Error in EditorMacroScript

You don't need EditorMacroScript. Just ignore the error. You can even uninstall the package.
BTW, nobody has changed that package recently in trunk. The problem is in your system somehow.

Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151016/0f3b24b7/attachment.html>

Reply by email

Mark Morgan Lloyd
to Bo Berglund: On Fri, 16 Oct 2015 06:39:24 +0000, Mark Morgan Lloyd Will Lazarus 1.4.x work with FPC…
Bo Berglund wrote 8 lines
On Fri, 16 Oct 2015 06:39:24 +0000, Mark Morgan Lloyd wrote: > I simply used the standard 1.4 sources. And I'm pretty sure I've already > told you that. Will Lazarus 1.4.x work with FPC 3.1.1? Or do I have to scrap all of what I have done and start over?

Try it, I don't think there will be problems.

Different Lazarus versions generally have a compiler version they assume, but at present they're running neck-and-neck.

Show quoted text 10 lines
>>> $ svn ls http://svn.freepascal.org/svn/lazarus/tags >>> .. >>> lazarus_1_4/ >>> lazarus_1_4_2/ >>> lazarus_1_4_4/ <--- Most recent >>> lazarus_1_4_RC1/ >>> lazarus_1_4_RC2/ >>> lazarus_1_4_RC3/ I guess I would need 1.4.4 then, or is that what you get from 1.4?

Those are distinct tagged versions. Assume that 1_4 in that context is 1.4.0, that there were three release candidates for review, and that the later ones are elsewhere labelled "fixes".

Show quoted text 30 lines
> The problem with Subversion is that the revision number and tagged > releases are distinct, so except in the case of trunk it's difficult to > say "get 1.4.4, then step back one revision". > > In the case of trunk (looking at an arbitrary machine here)... > > $ cd /usr/local/share/lazarus-trunk > $ svn info Here is what I currently have in the lazarus dir: pi at rpi2-jessie ~/development/lazarus $ svn info Path: . Working Copy Root Path: /home/pi/development/lazarus URL: http://svn.freepascal.org/svn/lazarus/trunk Relative URL: ^/trunk Repository Root: http://svn.freepascal.org/svn/lazarus Repository UUID: 4005530d-fff6-0310-9dd1-cebe43e6787f Revision: 50059 Node Kind: directory Schedule: normal Last Changed Author: juha Last Changed Rev: 50059 Last Changed Date: 2015-10-14 18:39:48 +0200 (Wed, 14 Oct 2015) So I am on trunk... > # Step back one revision: > $ svn up -r 40412 OK, that is when you use the revision number, what about the tag name?

You're on trunk. There is no tag name.

I have googled for how to move to a particular Subversion tag (aka branch).

NO. THEY ARE DISTINCT. DO NOT GO THERE.

That's the standard book. Start at the beginning rather than jumping in at the middle and guessing.

Show quoted text 14 lines
When trying to understand the concept I wound up with this command: svn switch http://svn.freepascal.org/svn/lazarus/lazarus_1_4_4 Executed inside the already checked out trunk copy, would this get me to the tag lazarus_1_4_4? Or is it better to just delete the development/lazarus dir and then do a checkout from development? Like this: cd /home/pi/development rm -r lazarus svn co http://svn.freepascal.org/svn/lazarus/lazarus_1_4_4 lazarus cd lazarus make clean bigide

Stick to distinct tags or to trunk. I say again:

'The problem with Subversion is that the revision number and tagged releases are distinct, so except in the case of trunk it's difficult to say "get 1.4.4, then step back one revision".'

Show quoted text 14 lines
Last question: I have seen different suggested locations for lazarus here. Juha suggested: ~/development/lazarus but your example shows: /usr/local/share/lazarus-trunk and the tutorial I started with uses: /usr/local/lazarus This confuses me a lot, what is the "standard" way of locating programs like Lazarus (and fpc for that matter)?

There isn't one. Even considering "standard packages", different Linux distreaux and other unix implementations (Solaris etc.) have different conventions for where they install non-core stuff: /usr/local, /opt, /opt/local and so on.

/In/ /general/, you can rely on /usr/local/bin being on your path, or it's safe to add it. So basically, you can install both FPC and Lazarus wherever you want, and put symlinks in /usr/local/bin for the programs you need most.

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

Mattias Gaertner
to Bo Berglund: On Fri, 16 Oct 2015 06:39:24 +0000, Mark Morgan Lloyd Will Lazarus 1.4.x work with FPC…
On Fri, 16 Oct 2015 06:39:24 +0000, Mark Morgan Lloyd wrote: [...] Will Lazarus 1.4.x work with FPC 3.1.1?

FPC 3.1.1 is the development version.
I recommend to use Lazarus trunk 1.5 with it.

1.4.4 compiles with FPC 3.1.1, but special care must be taken with non English string constants and widestrings.

svn switch http://svn.freepascal.org/svn/lazarus/lazarus_1_4_4 Executed inside the already checked out trunk copy, would this get me to the tag lazarus_1_4_4?

Yes. Most of the time.

Show quoted text 7 lines
Or is it better to just delete the development/lazarus dir and then do a checkout from development? Like this: cd /home/pi/development rm -r lazarus svn co http://svn.freepascal.org/svn/lazarus/lazarus_1_4_4 lazarus cd lazarus make clean bigide

Yes.

and the tutorial I started with uses: /usr/local/lazarus

Bad tutorial. Where is it?
Put your things into your home.

Mattias

Reply by email

Bo Berglund
to Mattias Gaertner
Mattias Gaertner wrote
> and the tutorial I started with uses: > /usr/local/lazarus Bad tutorial. Where is it?

http://www.tweaking4all.com/hardware/raspberry-pi/install-lazarus-pascal-on-raspberry-pi-2

I am trying to get things right and tell the author about it. A complication is Jessie vs. Wheezy too...

Put your things into your home.

I have done so now with lazarus trunk.

Does this also cover the fpc compiler?

Can I create a symlink to the compiler if it resides in Pi:s home? I mean can there exist symlinks visible only to the Pi user?

Bo Berglund Developer in Sweden

Reply by email

Mark Morgan Lloyd
to Bo Berglund
Bo Berglund wrote
Can I create a symlink to the compiler if it resides in Pi:s home? I mean can there exist symlinks visible only to the Pi user?

The general answer is that you can't create a symlink (or hard link) which looks different to different people, but on a single-user system there would seem no point trying. You /can/ obviously set up the target file to only be accessible to some users, but that's not quite the same thing.

Remember that rather than having a symlink you could easily set up a shell script in e.g. /usr/local/bin which is runnable by everybody but behaves differently based on the current user. However this is probably more complex than you need, although you might find something like a script to give lazarus an appropriate -pcp option depending on compiler version useful.

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: Try it, I don't think there will be problems. Different Lazarus versions generally have a…
Mark Morgan Lloyd wrote 10 lines
There isn't one. Even considering "standard packages", different Linux distreaux and other unix implementations (Solaris etc.) have different conventions for where they install non-core stuff: /usr/local, /opt, /opt/local and so on. /In/ /general/, you can rely on /usr/local/bin being on your path, or it's safe to add it. So basically, you can install both FPC and Lazarus wherever you want, and put symlinks in /usr/local/bin for the programs you need most.

Thank you so much!
This last item clarified a lot of what has been going on in my RPi....

I went into the/usr/local/bin directory and made a ls -la to see what if any symlinks are there. Surprise! I found several dead symlinks:

lrwxrwxrwx 1 root root 24 Oct 10 14:27 lazarus-ide -> ../share/lazarus/lazarus
lrwxrwxrwx 1 root root 25 Oct 10 14:27 lazbuild -> ../share/lazarus/lazbuild
lrwxrwxrwx 1 root root 29 Oct 10 14:27 lazres -> ../share/lazarus/tools/lazres
lrwxrwxrwx 1 root root 31 Oct 10 14:27 lrstolfm -> ../share/lazarus/tools/lrstolfm
lrwxrwxrwx 1 root root 29 Oct 10 14:27 startlazarus -> ../share/lazarus/startlazarus
-lrwxrwxrwx 1 root root 36 Oct 10 14:27 updatepofiles -> ../share/lazarus/tools/updatepofiles

All of these are pointing to the erroneous root installation I did as root! They were probably put there my the make install command I issued as part of the tutorial but did not do manually after getting lazarus into the Pi home dir.....

But them being here explains how the Jessie start menu got screwed up as well, because in the menu definitions were only things like "startlazarus %f" without any path see that by installing in any place whatever and then creating a symlink like this all other functions need not know where the program resides since it will be on path. For example the menu handler is a case in point.
One can just change the symlink and keep everythying else like the Menu entries....

Bo Berglund Developer in Sweden

Reply by email

Mark Morgan Lloyd
to Bo Berglund
Bo Berglund wrote 16 lines
On Fri, 16 Oct 2015 08:57:45 +0000, Mark Morgan Lloyd wrote: > There isn't one. Even considering "standard packages", different Linux > distreaux and other unix implementations (Solaris etc.) have different > conventions for where they install non-core stuff: /usr/local, /opt, > /opt/local and so on. > > /In/ /general/, you can rely on /usr/local/bin being on your path, or > it's safe to add it. So basically, you can install both FPC and Lazarus > wherever you want, and put symlinks in /usr/local/bin for the programs > you need most. > Thank you so much! This last item clarified a lot of what has been going on in my RPi....

We're wandering away from Lazarus towards more general areas, but craving the list managers' indulgence for a few moments...

Hint: when you're setting up a symlink, the order of the parameters is as though you're doing a copy.

So a copy is like this:

$ cp actual_file copy_of_file

a hard link is like this:

$ ln actual_file hard_link

and a symlink (symbolic link) is ordered the same:

$ ln -s actual_file symbolic_link

Most operations on symbolic_link are now transparently redirected to actual_file. I know for a fact that I am not the only person who gets the order wrong on occasion, and I'd also add that you need to be careful with relative vs absolute paths: if in doubt do something like

$ ln -s /usr/local/share/lazarus-trunk/lazarus /usr/local/bin/lazarus

rather than trying to cut corners.

I went into the/usr/local/bin directory and made a ls -la to see what if any symlinks are there. Surprise! I found several dead symlinks:

..

All of these are pointing to the erroneous root installation I did as root! They were probably put there my the make install command I issued as part of the tutorial but did not do manually after getting lazarus into the Pi home dir.....

But also see warnings above. BTDT.

But them being here explains how the Jessie start menu got screwed up as well, because in the menu definitions were only things like "startlazarus %f" without any path also that whatever desktop software you're running (OpenBox, LXDE

etc.) will expand that %f to a filename, if given one as a parameter. This isn't well documented, but is completely distinct from any shell (environment) variables being expanded.

One can just change the symlink and keep everythying else like the Menu entries....

That's right, but as I said you can also go via a (shell) script if you need something fancier.

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