[PATCH] Croquet.sh on Ubuntu Breezy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Croquet.sh on Ubuntu Breezy

Conrad Parker
Hi,

Croquet_SDK_1.0_beta (Hedgehog) runs fine on Ubuntu 5.10 Breezy (Badger).

There were two minor issues in getting it to run:

1. Croquet.sh does not find the installed OpenGL library.

Breezy ships with X.Org X server 6.8.2. This provides /usr/lib/libGL.so.1,
but not /usr/lib/libGL.so. Croquet.sh expects both these symlinks.

If the OpenGL system library cannot be found, starting a Croquet morph
fails with a backtrace like:

Error: Unable to find function address
  ...
  OGLUnixX11LE(Object)>>externalCallFailed
  OGLUnixX11LE(Object)>>glMatrixMode

There have been various issues reported in Ubuntu (and Debian) for
libGL.so symlinks being incorrectly created or removed by library
packages (particularly by users of nvidia-glx). Croquet only uses
a symlink to /usr/lib/libGL.so.1, so there is no need to check for
the symlink to /usr/lib/libGL.so. The patch below for Croquet.sh
simplifies the check and allows Croquet to run.

2. The OpenAL libraries are not installed by default in Ubuntu Breezy.

If the OpenAL system library cannot be found, starting a Croquet morph
fails with backtrace:

Error: Unable to find function address
  ...
  OpenALUnix(Object)>>externalCallFailed
  OpenALUnix(Object)>>alcOpenDevice

Installing libopenal-dev package fixes this problem.

cheers,

Conrad.

--- Croquet_SDK_1.0_beta/Croquet.sh 2006-04-18 10:10:42.000000000 +1000
+++ Croquet_SDK_1.0_beta-new/Croquet.sh 2006-04-24 12:25:35.000000000 +1000
@@ -9,7 +9,7 @@
 fi
 
 # make libGL.so link if necessary
-if [ ! -x /usr/lib/libGL.so -a -x /usr/lib/libGL.so.1 ] ; then
+if [ ! -x /usr/lib/libGL.so.1 ] ; then
  if [ ! -x  "$EXE/libGL.so" ] ; then
  echo Creating libGL.so symlink in $EXE
  ln -sf /usr/lib/libGL.so.1 "$EXE/libGL.so"


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Croquet.sh on Ubuntu Breezy

Lothar Kaiser-2
Hi Conrad,

thanks for your email.. now I got Croquet running under Breezy :-)

cheers,

Lothar



Am 24.04.2006 um 07:14 schrieb Conrad Parker:

> Hi,
>
> Croquet_SDK_1.0_beta (Hedgehog) runs fine on Ubuntu 5.10 Breezy  
> (Badger).
>
> There were two minor issues in getting it to run:
>
> 1. Croquet.sh does not find the installed OpenGL library.
>
> Breezy ships with X.Org X server 6.8.2. This provides /usr/lib/
> libGL.so.1,
> but not /usr/lib/libGL.so. Croquet.sh expects both these symlinks.
>
> If the OpenGL system library cannot be found, starting a Croquet morph
> fails with a backtrace like:
>
> Error: Unable to find function address
>   ...
>   OGLUnixX11LE(Object)>>externalCallFailed
>   OGLUnixX11LE(Object)>>glMatrixMode
>
> There have been various issues reported in Ubuntu (and Debian) for
> libGL.so symlinks being incorrectly created or removed by library
> packages (particularly by users of nvidia-glx). Croquet only uses
> a symlink to /usr/lib/libGL.so.1, so there is no need to check for
> the symlink to /usr/lib/libGL.so. The patch below for Croquet.sh
> simplifies the check and allows Croquet to run.
>
> 2. The OpenAL libraries are not installed by default in Ubuntu Breezy.
>
> If the OpenAL system library cannot be found, starting a Croquet morph
> fails with backtrace:
>
> Error: Unable to find function address
>   ...
>   OpenALUnix(Object)>>externalCallFailed
>   OpenALUnix(Object)>>alcOpenDevice
>
> Installing libopenal-dev package fixes this problem.
>
> cheers,
>
> Conrad.
>
> --- Croquet_SDK_1.0_beta/Croquet.sh 2006-04-18 10:10:42.000000000  
> +1000
> +++ Croquet_SDK_1.0_beta-new/Croquet.sh 2006-04-24  
> 12:25:35.000000000 +1000
> @@ -9,7 +9,7 @@
>  fi
>
>  # make libGL.so link if necessary
> -if [ ! -x /usr/lib/libGL.so -a -x /usr/lib/libGL.so.1 ] ; then
> +if [ ! -x /usr/lib/libGL.so.1 ] ; then
>   if [ ! -x  "$EXE/libGL.so" ] ; then
>   echo Creating libGL.so symlink in $EXE
>   ln -sf /usr/lib/libGL.so.1 "$EXE/libGL.so"
>
>


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Croquet.sh on Ubuntu Breezy

Bert Freudenberg-3
In reply to this post by Conrad Parker
Am 24.04.2006 um 07:14 schrieb Conrad Parker:

> Hi,
>
> Croquet_SDK_1.0_beta (Hedgehog) runs fine on Ubuntu 5.10 Breezy  
> (Badger).
>
> There were two minor issues in getting it to run:
>
> 1. Croquet.sh does not find the installed OpenGL library.
>
> Breezy ships with X.Org X server 6.8.2. This provides /usr/lib/
> libGL.so.1,
> but not /usr/lib/libGL.so. Croquet.sh expects both these symlinks.
[...]
> Croquet only uses
> a symlink to /usr/lib/libGL.so.1, so there is no need to check for
> the symlink to /usr/lib/libGL.so. The patch below for Croquet.sh
> simplifies the check and allows Croquet to run.

Actually, the Croquet SDK looks only for a library named 'GL' from  
Smalltalk, which *should* work on any Unix. The Unix VM expands this  
to 'libGL.so' which is eventually loaded. It does not try 'libGL.so.
1', however, this is what is linked into the Linux version of the  
B3DAcceleratorPlugin (do an "ldd B3DAcceleratorPlugin" to see). The  
original problem is that most Linux distributions nowadays separate  
between "developers" and "users", or "compile-time" and "run-time",  
whereas in Smalltalk there is no distinction between those,  
"authoring is always on". Consequently, the "libGL.so" symlink is  
usually only found in the "X11-dev" package, not the regular "X11"  
package.

So *if* there is a libGL.so.1 but *not* a libGL.so in /usr/lib, the  
script creates a symlink. Or did I get the precedence wrong in this  
line?

        if [ ! -x /usr/lib/libGL.so -a -x /usr/lib/libGL.so.1 ]

I thought the "!" only applied to the "-x /usr/lib/libGL.so" and not  
the whole ("-a") expression.

>
> --- Croquet_SDK_1.0_beta/Croquet.sh 2006-04-18 10:10:42.000000000  
> +1000
> +++ Croquet_SDK_1.0_beta-new/Croquet.sh 2006-04-24  
> 12:25:35.000000000 +1000
> @@ -9,7 +9,7 @@
>  fi
>
>  # make libGL.so link if necessary
> -if [ ! -x /usr/lib/libGL.so -a -x /usr/lib/libGL.so.1 ] ; then
> +if [ ! -x /usr/lib/libGL.so.1 ] ; then
>   if [ ! -x  "$EXE/libGL.so" ] ; then
>   echo Creating libGL.so symlink in $EXE
>   ln -sf /usr/lib/libGL.so.1 "$EXE/libGL.so"
>

Of course, the simpler solution is to just load libGL.so.1 from  
inside Croquet:

OGLUnix>>openGLLibraryName
        ^ SmalltalkImage current osVersion = 'linux'
                ifTrue: ['libGL.so.1']
                ifFalse: ['GL']

(this is from memory - don't have a Linux machine right now).

With that you could skip my symlink nonsense in Croquet.sh alltogether.

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Croquet.sh on Ubuntu Breezy

Conrad Parker
In reply to this post by Conrad Parker
On Mon, Apr 24, 2006 at 12:05:52PM +0200, Bert Freudenberg wrote:
> Am 24.04.2006 um 07:14 schrieb Conrad Parker:
> >
> >1. Croquet.sh does not find the installed OpenGL library.
> >
>
> the "libGL.so" symlink is usually only found in the "X11-dev" package,
> not the regular "X11" package.

ok, that works. The package providing this on Ubuntu (and I think also
on Debian) is libgl1-mesa-dev.

> So *if* there is a libGL.so.1 but *not* a libGL.so in /usr/lib, the  
> script creates a symlink. Or did I get the precedence wrong in this  
> line?
>
> if [ ! -x /usr/lib/libGL.so -a -x /usr/lib/libGL.so.1 ]
>
> I thought the "!" only applied to the "-x /usr/lib/libGL.so" and not  
> the whole ("-a") expression.

ah, now I understand what that line was trying to do :) The precedence
is correct, but (for Debian-based systems) the test is not. Debian
policy specifies that:

  Shared libraries should not be installed executable, since the dynamic
  linker does not require this and trying to execute a shared library
  usually results in a core dump.
  -- http://www.debian.org/doc/debian-policy/ch-sharedlibs.html

Hence it works only if -e is used rather than -x throughout Croquet.sh.

> Of course, the simpler solution is to just load libGL.so.1 from  
> inside Croquet:
>
> OGLUnix>>openGLLibraryName
> ^ SmalltalkImage current osVersion = 'linux'
> ifTrue: ['libGL.so.1']
> ifFalse: ['GL']
>
> (this is from memory - don't have a Linux machine right now).
>
> With that you could skip my symlink nonsense in Croquet.sh alltogether.

yes, that works and is a much better solution than messing around in
shell scripts :-)

any chance that can be added to the Croquet updates?

Conrad.

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Croquet.sh on Ubuntu Breezy

Bert Freudenberg-3
In reply to this post by Conrad Parker
Am 25.04.2006 um 15:12 schrieb Conrad Parker:

> On Mon, Apr 24, 2006 at 12:05:52PM +0200, Bert Freudenberg wrote:
>> Am 24.04.2006 um 07:14 schrieb Conrad Parker:
>>>
>>> 1. Croquet.sh does not find the installed OpenGL library.
>>>
>>
>> the "libGL.so" symlink is usually only found in the "X11-dev"  
>> package,
>> not the regular "X11" package.
>
> ok, that works. The package providing this on Ubuntu (and I think also
> on Debian) is libgl1-mesa-dev.
>
>> So *if* there is a libGL.so.1 but *not* a libGL.so in /usr/lib, the
>> script creates a symlink. Or did I get the precedence wrong in this
>> line?
>>
>> if [ ! -x /usr/lib/libGL.so -a -x /usr/lib/libGL.so.1 ]
>>
>> I thought the "!" only applied to the "-x /usr/lib/libGL.so" and not
>> the whole ("-a") expression.
>
> ah, now I understand what that line was trying to do :) The precedence
> is correct, but (for Debian-based systems) the test is not. Debian
> policy specifies that:
>
>   Shared libraries should not be installed executable, since the  
> dynamic
>   linker does not require this and trying to execute a shared library
>   usually results in a core dump.
>   -- http://www.debian.org/doc/debian-policy/ch-sharedlibs.html
>
> Hence it works only if -e is used rather than -x throughout  
> Croquet.sh.

But it needs to be readable so that would be -r, right? Or, strike  
that, doesn't make too much sense anyhow ;)

>> Of course, the simpler solution is to just load libGL.so.1 from
>> inside Croquet:
>>
>> OGLUnix>>openGLLibraryName
>> ^ SmalltalkImage current osVersion = 'linux'
>> ifTrue: ['libGL.so.1']
>> ifFalse: ['GL']
>>
>> (this is from memory - don't have a Linux machine right now).
>>
>> With that you could skip my symlink nonsense in Croquet.sh  
>> alltogether.
>
> yes, that works and is a much better solution than messing around in
> shell scripts :-)
>
> any chance that can be added to the Croquet updates?

It'd be easier if you provide a changeset that works. You would have  
to remove all libGL.so symlinks, verify it does not work with the old  
code, change the code, verify it works with new one. I suspect the  
actual return value of "SmalltalkImage current osVersion" might be  
not just 'linux' - as I wrote, this is from memory only.

- Bert -