SqueakDBX

The relational access answer for Squeak/Pharo

SqueakDBX with MySQL in Snow Leopard 64 bits

As you may know, there are some problems with the SqueakVM on 64 bits and FFI. So, if you have a 64 architecture, the most common approach is to use a 32 bits Squeak/Pharo VM. The problem here is how to install OpenDBX and the client libraries.

In this case, we had:

  • Mac Snow Leopard 64 bits
  • SqueakVM is 32 bits.
  • MySQL

So, let’s start installing the MySQL client libraries. To do that, you should do something like:

sudo port install mysql5-devel

But...that library is compiled with 64 bits by default. Thus, when OpenDBX tries to load that library, you may get the following error:

oLoadModule(libopendbx.dylib): dlopen(libopendbx.dylib, 10): no suitable image found. Did find: libopendbx.dylib: mach-o, but wrong architecture /usr/local/lib/libopendbx.dylib: mach-o, but wrong architecture

So, we tried to do something like this:

CFLAGS="-m32" CXXFLAGS="-m32" sudo port install mysql5-devel

but we got the same results. Probably the flags are ignored :(

So, the solution we found was to download a precompiled MySQL client library for 32 bits. It is here: http://dev.mysql.com/downloads/mysql/5.1.html and download the file titled: "Mac OS X 10.5 (x86)"

Install it.

After that, you should compile OpenDBX like this:

CFLAGS="-m32" CXXFLAGS="-m32" CPPFLAGS="-I/usr/local/mysql-5.1.40-osx10.5-x86/include" LDFLAGS="-L/usr/local/mysql-5.1.40-osx10.5-x86/lib" ./configure --enable-singlelib --disable-utils --with-backends="mysql"

With this, you should have all SqueakDBX tests in green :)

Posted by SqueakDBX at 27 October 2009, 3:38 pm with tags 64bits, MacOS, OpenDBX, MySQL link