Sign in Join

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

Mailing lists / lazarus / 2017-10

lazopenglcontext on Raspberry Pi?

11 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

Anthony Tekatch

I cannot get the lazopenglcontext package to install on Raspbian stretch. The error is:

  lazarus.pp(1,1) Fatal: Cannot find lazopenglcontext used by Lazarus.
  Check if package LazOpenGLContext creates lazopenglcontext.ppu, check
  nothing deletes this file and check that no two packages have access to
  the unit source..

Is there a Raspberry Pi distribution that contains the lazopenglcontext package, or some method to get that package installed on the Raspberry Pi?

Thanks,
Anthony

Mattias Gaertner
to Anthony Tekatch: I cannot get the lazopenglcontext package to install on Raspbian stretch. The error is:…
Show quoted text 9 lines
I cannot get the lazopenglcontext package to install on Raspbian stretch. The error is: lazarus.pp(1,1) Fatal: Cannot find lazopenglcontext used by Lazarus. Check if package LazOpenGLContext creates lazopenglcontext.ppu, check nothing deletes this file and check that no two packages have access to the unit source.. Is there a Raspberry Pi distribution that contains the lazopenglcontext package, or some method to get that package installed on the Raspberry Pi?

It is part of the Lazarus sources.
lazarus/components/opengl/lazopenglcontext.lpk

I have not tried it on Raspbian.

Mattias

Anthony Tekatch
to leledumbo: package, or some method to get that package installed on the Raspberry Pi? Should be in…
leledumbo wrote
Should be in components folder.
Mattias Gaertner wrote
It is part of the Lazarus sources. lazarus/components/opengl/lazopenglcontext.lpk

Yes, the lazopenglcontext.lpk exists on the disk here:

$ ls -al /usr/lib/lazarus/1.6.2/components/opengl/ total 144
drwxr-xr-x 3 root root 4096 Oct 18 16:06 .
drwxr-xr-x 75 root root 4096 Oct 18 16:05 ..
drwxr-xr-x 2 root root 4096 Oct 18 16:05 example -rw-r--r-- 1 root root 10173 Aug 16 2015 glcarbonaglcontext.pas -rw-r--r-- 1 root root 15248 Nov 20 2015 glcocoanscontext.pas -rw-r--r-- 1 root root 30842 Sep 15 2015 glgtkglxcontext.pas -rw-r--r-- 1 root root 8168 Nov 21 2014 glqtcontext.pas -rw-r--r-- 1 root root 24564 Sep 27 2015 glwin32wglcontext.pas -rw-r--r-- 1 root root 2850 Apr 5 2017 lazopenglcontext.lpk -rw-r--r-- 1 root root 384 Aug 16 2015 lazopenglcontext.pas -rw-r--r-- 1 root root 20770 Sep 27 2015 openglcontext.pas -rw-r--r-- 1 root root 4200 Oct 5 2013 openglcontext.res

Also, the .ppu is being generated when I try to install the lazopenglcontext package:

$ ls -al ~/.lazarus/lib/LazOpenGLContext/lib/arm-linux/gtk2 total 552
drwxr-xr-x 2 pi pi 4096 Oct 20 14:35 .
drwxr-xr-x 3 pi pi 4096 Oct 20 14:17 ..
-rw-r--r-- 1 pi pi 240648 Oct 20 14:17 glgtkglxcontext.o -rw-r--r-- 1 pi pi 23005 Oct 20 14:17 glgtkglxcontext.ppu -rw-r--r-- 1 pi pi 523 Oct 20 14:35 LazOpenGLContext.compiled -rw-r--r-- 1 pi pi 2808 Oct 20 14:35 lazopenglcontext.o -rw-r--r-- 1 pi pi 1325 Oct 20 14:35 lazopenglcontext.ppu -rw-r--r-- 1 pi pi 234308 Oct 20 14:17 openglcontext.o -rw-r--r-- 1 pi pi 32001 Oct 20 14:17 openglcontext.ppu -rw-r--r-- 1 pi pi 4200 Oct 20 14:17 openglcontext.res

The error remains the same:

  lazarus.pp(1,1) Fatal: Cannot find lazopenglcontext used by Lazarus.
  Check if package LazOpenGLContext creates lazopenglcontext.ppu, check
  nothing deletes this file and check that no two packages have access to
  the unit source..

Thanks for any more clues,
Anthony

Mattias Gaertner
to Anthony Tekatch
[..] $ ls -al /usr/lib/lazarus/1.6.2/components/opengl/

How did you install Lazarus?

Also, the .ppu is being generated when I try to install the lazopenglcontext package: $ ls -al ~/.lazarus/lib/LazOpenGLContext/lib/arm-linux/gtk2

Good.
Is this path in ~/.lazarus/idemake.cfg ?
Note that the ~/ will be the real path in the cfg.

Mattias

Anthony Tekatch
to Mattias Gaertner
Mattias Gaertner wrote
How did you install Lazarus?

I installed Raspbain as defined here:
https://www.raspberrypi.org/downloads/raspbian/

Then installed Lazarus for Raspbian defined here:
http://wiki.freepascal.org/Lazarus_on_Raspberry_Pi sudo apt-get update
sudo apt-get upgrade
sudo apt-get install fpc
sudo apt-get install lazarus

Then after getting lazopenglcontext failures, I tried fpcupdelux which did not help.

Show quoted text 8 lines
> Also, the .ppu is being generated when I try to install the > lazopenglcontext package: > > $ ls -al ~/.lazarus/lib/LazOpenGLContext/lib/arm-linux/gtk2 Good. Is this path in ~/.lazarus/idemake.cfg ? Note that the ~/ will be the real path in the cfg.

Yes,

idemake.cfg contains this line:
-Fu/home/pi/.lazarus/lib/LazOpenGLContext/lib/arm-linux/gtk2

The openglcontext.ppu exists in this directory:
/home/pi/.lazarus/lib/LazOpenGLContext/lib/arm-linux/gtk2

For cleanliness, I started over again by completely removing fpc, Lazarus, ~/.lazarus and did not use fpcupdelux this time.

Starting Lazarus for the first time gives this error which I am not concerned about:
The package EditorMacroScript (pascalscript macros) has detected a problem and was deactivated. The package failed its selftest with the message: "Failed getstr2 [Exp: "456" / Got: "abc"]"

package->install->lazopenglcontext->rebuild-ide gives this error:

  lazarus.pp(1,1) Fatal: Cannot find lazopenglcontext used by Lazarus.
  Check if package LazOpenGLContext creates lazopenglcontext.ppu, check
  nothing deletes this file and check that no two packages have access to
  the unit source..

no lazopenglcontext.ppu can be found in here:
/home/pi/.lazarus/units/arm-linux/gtk2

package->uninstall->lazopenglcontext->rebuild-ide is back to normal.

package->open-lpk->lazopenglcontext.lpk->compile builds ppu files in here: /home/pi/.lazarus/lib/LazOpenGLContext/lib/arm-linux/gtk2

use->install->rebuild-now compiles then closes lazarus start lazarus
compiles new program fine
lazopenglcontext appears in installed packages

Try compiling my program which includes:
openglcontext
in the uses section, get this error:

  vector.pas(14,5) Fatal: Cannot find openglcontext used by vector. Check
  if package LazOpenGLContext creates openglcontext.ppu, check nothing
  deletes this file and check that no two packages have access to the
  unit source..

idemake.cfg contains this line:
-Fu/home/pi/.lazarus/lib/LazOpenGLContext/lib/arm-linux/gtk2

The openglcontext.ppu exists in this directory:
/home/pi/.lazarus/lib/LazOpenGLContext/lib/arm-linux/gtk2

Thanks for any more clues,
Anthony

Anthony Walter
to Anthony Tekatch

I've done a bit of work on Pi and OpenGL and thought I'd give you some advice.

1) Pi only supports OpenGL ES contexts

2) Depending on your raspberry OS configuration, OpenGL ES might only be supported when X window manager is not running.

2a) Raspbian defaults to allow OpenGL in with X window manager running, but currently the actual driver does not function to the correct OpenGL ES specifications under that situation.

For me personally, I configured Raspbian to use the correct OpenGL ES specifications, and that means the driver will fail to create a GL context if X windows is running. Don't ask me what the differences are, I really don't want to bother researching it, but there are problems. I've posted about it extensively on the Pi support forums and under Pi area of the new SDL forum.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20171020/54dc11ea/attachment.html>

R0b0t1
to Anthony Walter
Anthony Walter wrote 19 lines
I've done a bit of work on Pi and OpenGL and thought I'd give you some advice. 1) Pi only supports OpenGL ES contexts 2) Depending on your raspberry OS configuration, OpenGL ES might only be supported when X window manager is not running. 2a) Raspbian defaults to allow OpenGL in with X window manager running, but currently the actual driver does not function to the correct OpenGL ES specifications under that situation. For me personally, I configured Raspbian to use the correct OpenGL ES specifications, and that means the driver will fail to create a GL context if X windows is running. Don't ask me what the differences are, I really don't want to bother researching it, but there are problems. I've posted about it extensively on the Pi support forums and under Pi area of the new SDL forum.

Hello,

I am not very smart nor clever and I did not find this documentation. Could you link to it? This is the best explanation for the weirdness I was experiencing.

I read about the OpenGL ES hack to allow X11 compositing(?) but never anything about configuration.

Respectfully,
R0b0t1

Mattias Gaertner
to Anthony Tekatch: I installed Raspbain as defined here: https://www.raspberrypi.org/downloads/raspbian/…
Show quoted text 7 lines
[...] Then installed Lazarus for Raspbian defined here: http://wiki.freepascal.org/Lazarus_on_Raspberry_Pi sudo apt-get update sudo apt-get upgrade sudo apt-get install fpc sudo apt-get install lazarus

Ok. These are probably the Debian packages.
Maybe they are doing something strange. I will check.

Show quoted text 6 lines
[...] idemake.cfg contains this line: -Fu/home/pi/.lazarus/lib/LazOpenGLContext/lib/arm-linux/gtk2 The openglcontext.ppu exists in this directory: /home/pi/.lazarus/lib/LazOpenGLContext/lib/arm-linux/gtk2

Good.

Show quoted text 8 lines
For cleanliness, I started over again by completely removing fpc, Lazarus, ~/.lazarus and did not use fpcupdelux this time. Starting Lazarus for the first time gives this error which I am not concerned about: The package EditorMacroScript (pascalscript macros) has detected a problem and was deactivated. The package failed its selftest with the message: "Failed getstr2 [Exp: "456" / Got: "abc"]"

Yes, that's normal. Some features are not yet supported on arm.

Show quoted text 8 lines
package->install->lazopenglcontext->rebuild-ide gives this error: lazarus.pp(1,1) Fatal: Cannot find lazopenglcontext used by Lazarus. Check if package LazOpenGLContext creates lazopenglcontext.ppu, check nothing deletes this file and check that no two packages have access to the unit source.. no lazopenglcontext.ppu can be found in here: /home/pi/.lazarus/units/arm-linux/gtk2

Good. That's the directory for the IDE itself.

package->uninstall->lazopenglcontext->rebuild-ide is back to normal. package->open-lpk->lazopenglcontext.lpk->compile builds ppu files in here: /home/pi/.lazarus/lib/LazOpenGLContext/lib/arm-linux/gtk2

Good.

Show quoted text 18 lines
use->install->rebuild-now compiles then closes lazarus start lazarus compiles new program fine lazopenglcontext appears in installed packages Try compiling my program which includes: openglcontext in the uses section, get this error: vector.pas(14,5) Fatal: Cannot find openglcontext used by vector. Check if package LazOpenGLContext creates openglcontext.ppu, check nothing deletes this file and check that no two packages have access to the unit source.. idemake.cfg contains this line: -Fu/home/pi/.lazarus/lib/LazOpenGLContext/lib/arm-linux/gtk2 The openglcontext.ppu exists in this directory: /home/pi/.lazarus/lib/LazOpenGLContext/lib/arm-linux/gtk2

Strange.

Mattias

Anthony Tekatch
to Mattias Gaertner
Mattias Gaertner wrote 13 lines
On Fri, 20 Oct 2017 20:32:49 -0400 Anthony Tekatch via Lazarus wrote: >[...] > Then installed Lazarus for Raspbian defined here: > http://wiki.freepascal.org/Lazarus_on_Raspberry_Pi > sudo apt-get update > sudo apt-get upgrade > sudo apt-get install fpc > sudo apt-get install lazarus Ok. These are probably the Debian packages. Maybe they are doing something strange. I will check.

Thank you for checking that.

For now, I just copied the compiled lazopenglcontext files from: /home/pi/.lazarus/lib/LazOpenGLContext/lib/arm-linux/gtk2 into my project directory.

My project compiles now but gives this error when running:

Project myproject raised exception class 'External: SIGSEGV'.

   In file 'glgtkglxcontext.pas' at line 660:
  FBConfig := FBConfigs[BestFBConfig];

Thanks.

Anthony Tekatch
to Anthony Walter: I've done a bit of work on Pi and OpenGL and thought I'd give you some advice. 1) Pi only…
Anthony Walter wrote 18 lines
I've done a bit of work on Pi and OpenGL and thought I'd give you some advice. 1) Pi only supports OpenGL ES contexts 2) Depending on your raspberry OS configuration, OpenGL ES might only be supported when X window manager is not running. 2a) Raspbian defaults to allow OpenGL in with X window manager running, but currently the actual driver does not function to the correct OpenGL ES specifications under that situation. For me personally, I configured Raspbian to use the correct OpenGL ES specifications, and that means the driver will fail to create a GL context if X windows is running. Don't ask me what the differences are, I really don't want to bother researching it, but there are problems. I've posted about it extensively on the Pi support forums and under Pi area of the new SDL forum.

Thank you for the notes:

My application only used OpenGL as an unnecessary side offering, so after removing all the OpenGL references, I was able to get the application to run.

I did end up with the following error after trying to compile: Error: Can't call the assembler, error -1 switching to external assembling I solved that by reading some other postings where you suggested to reduce the GPU memory which I did as follows:
Raspberry menu ->
Raspberry Pi Configuration ->
Performance ->
GPU Memory = 32 (from 64).

I'd still like to get opengl working with my application on the RPi one day, but it is not critical for me.

Thanks,
Anthony