Amalgalite Pthread Error

If you happen to get an error like the following when running amalgalite, it was a bug in how amalgalite was built. I wasn't matching the thread support in amalgalite with the threadsupport of the installed ruby.

amalgalite-0.2.0/ext/ undefined symbol: pthread_mutexattr_init

For future reference this is how you can see how ruby was compiled on my iMac

1.8.6 114 (2008-03-03) i686-darwin9.2.2
>> require 'rbconfig'
>> puts Config::CONFIG['configure_args']
 '--prefix=/opt/local' '--enable-shared' '--mandir=/opt/local/share/man'
 '--enable-pthread' '--without-tk' 'CC=/usr/bin/gcc-4.0' 'CFLAGS=-O2'
 'LDFLAGS=-L/opt/local/lib' 'CPPFLAGS=-I/opt/local/include'

versus my OpenBSD server:

1.8.6 110 (2007-09-23) x86_64-openbsd4.2
>> require 'rbconfig'
>>puts Config::CONFIG['configure_args']
 '--enable-shared' '--enable-ipv6' '--with-dbm-type=bogus'
 '--with-opt-dir=/usr/local' '--with-tcl-include=/usr/local/include/tcl8.4'
 '--with-tk-include=/usr/local/include/tk8.4' '--with-X11-dir=/usr/X11R6'
 '--prefix=/usr/local' '--sysconfdir=/etc' '--mandir=/usr/local/man'
 '--infodir=/usr/local/info' 'CC=cc' 'CFLAGS=-O2 -pipe'

You can see that on my iMac ruby was compiled with @--enable-pthread@ but on my OpenBSD machine that configuration option is missing. I didn't take this into account when building Amalgalite.

Version 0.2.1 was just released which fixes this bug.

gem install amalgalite

Comments (View)

blog comments powered by Disqus