On Fri, 7 Dec 2001, Jim Freeze wrote:

> On Fri, 7 Dec 2001, Fabian Senftenberg wrote:
> 
> > Lars Christensen <larsch / cs.auc.dk> writes:
> >
> > > http://www.cs.auc.dk/~larsch/ruby/glruby-1.0.tar.gz
> > >
> > > It uses Yoshiyuki Kusano's OpenGL/GLUT library. Have fun :)
> >
> > Trying that on FreeBSD 4.4 with the ruby-opengl port just results in:
> >
> > % ./glruby.rb
> > /usr/libexec/ld-elf.so.1: /usr/X11R6/lib/libGL.so.1: Undefined symbol "pthread_key_create"
> >
> > Is there any magic involved with using ruby's opengl module on
> > FreeBSD?
> >
> I recently had this problem.
> What version of XFree86 do you have installed?
> On my 4.4 system I installed Mesa3 while XFree86 3.3.1 was installed.
> Then I upgraded to XFree86 4.1.0. Then I tried to install ruby-opengl
> and wala, the pthread problem.
> What I did was deinstall Mesa3 and reinstall. Also, one other
> thing I had to do. In /etc/make.conf make sure that you have
> XFREE86_VERSION=4
> before you re-install Mesa.

Jim's instructions may well be the answer to the problem. I experienced
the same problem today when I tried to build Yoshiyuki Kusano's
extension. The trick that worked for me was to tweak extconf.rb a little.

Original has a out commented line that I made executable code again (that
is, I removed the comment line). So change

   ...
   $objs = ["glu.o", "ogl.o", "rbogl.o"]
   #have_library("pthread", "pthread_create")
   (have_library(gl_libname, nil) || have_library("Mesa"+...

to

   $objs = ["glu.o", "ogl.o", "rbogl.o"]
   have_library("pthread", "pthread_create")
   (have_library(gl_libname, nil) || have_library("Mesa"+...
 
and try again.

My system is Linux 2.4.7, RH 7.2, i686 (AMD Athlon), with XFree86 4.1.0
(with patched Matrox drivers, without DRI) and Mesa 3.4.2.

    - Aleksi