[squeak-dev] OGLUnixX11LE >> glPixelStorei: with:

Vanessa Freudenberg vanessa at codefrau.net
Sun May 10 23:50:58 UTC 2020


Hi Tom,

the OGLUnix class is used for all Unixen, and  'GL' is a good default for
that. We simply special-case Linux.

This could be highlighted by rewriting it as

    openGLLibraryName
        Smalltalk osVersion = 'linux' ifTrue: [^'libGL.so.1'].
        ^'GL'

If someone knows the specific conventions on the BSDs or Solaris or
whatever, we can add special-cases for them, too, if needed.

- Vanessa -

On Sat, May 9, 2020 at 11:17 PM Beckmann, Tom <
Tom.Beckmann at student.hpi.uni-potsdam.de> wrote:

> Hi Vanessa,
>
> thank you for clarifying! Do you know if there's any reason to keep the
> conditional asking for the osVersion to either return 'GL' or 'libgl.so.1'?
> In its current state it is broken on most linux systems I tested on (mainly
> Ubuntu-based), but I was wondering whether the correct fix would be to
> adapt it to the correct matching string 'linux-gnu' or just have it return
> 'libgl.so.1' always.
>
> Best,
> Tom
> ________________________________________
> From: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> on
> behalf of Vanessa Freudenberg <vanessa at codefrau.net>
> Sent: Sunday, May 10, 2020 3:19:00 AM
> To: The general-purpose Squeak developers list
> Subject: Re: [squeak-dev] OGLUnixX11LE >> glPixelStorei: with:
>
> On Sat, May 9, 2020 at 12:05 AM Beckmann, Tom <
> Tom.Beckmann at student.hpi.uni-potsdam.de<mailto:
> Tom.Beckmann at student.hpi.uni-potsdam.de>> wrote:
> Hi there!
>
> Replacing the whole #openGLLibraryName method with a simple
> ^ 'GL'
> should work, as long as you adapt your LD_LIBRARY_PATH to include the arch
> specific libraries. For example adding
> export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/"
> in your squeak.sh before the vm gets started should make sure that the
> image finds libgl*. Of course, if your libgl.so.1 is not found under that
> path, adjust accordingly.
>
> Alternatively, you can also specify the absolute path to the library, e.g.
> ^ '/usr/lib/x86_64-linux-gnu/libGL.so'
> which may be a safer option to start from if you're having troubles
> getting it to run.
>
> 'libGL.so' typically is installed by the opengl dev package as a symlink
> to 'libGL.so.1'. The user package installs 'libGL.so.1' and will *not* be
> found by the VM if you just specify 'GL' because the VM will only
> automatically try the '.so' suffix but not '.so.1'.
>
> That is why 'libGL.so.1' is indeed the correct value to be returned from
> openGLLibraryName on Linux.
>
> For the apicall:'s, if you inspect the byte codes of the method, you will
> in fact notice that is has already been replaced for you. This happens in
> OpenGL>>#privateInstallLibrary:, but only updates the method's bytecode,
> not its source code (which is good, because otherwise this would end up in
> commits or your changes file).
>
> Yep. As Levente mentioned, you need to switch your browser to show
> decompiled code to see the actual methods being executed.
>
> You will also see that apicall has been replaced by cdecl which is the
> right calling convention on Linux.
>
> - Vanessa -
>
>
> Best,
> Tom
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200510/9cfb8485/attachment.html>


More information about the Squeak-dev mailing list