After many hours to try to install OpenDBX and SqueakDBX on my Mac Intel with a 64 bit processor, I'm very happy to propose you a little step by step tutorial.

1. Download the client libraries for MySQL and PostgreSQL. Warning ! you must get the 32 bits version. Create a temporary directory named "openDBX" where you want. For me, I have put the directory at the root of my system path.My directory contains :

> mysql
> 5.0
> include
> lib
> PostgreSQL
> 9.0
> include
> lib

2. Download openDBX and compile it in 32 bits mode (because the Smalltalk virtual machine is a 32 bits application). I have write a little shell script to produce the configuration of the compiler.Of course, you must set the directories for the include files and the librairies path.

CFLAGS="-m32" \
CXXFLAGS="-m32" \
CPPFLAGS="-m32 -I/opendbx/PostgreSQL/9.0/include -I/opendbx/mysql/5.0/include" \
LDFLAGS="-m32 -L/opendbx/PostgreSQL/9.0/lib -L/opendbx/mysql/5.0/lib" \
./configure --disable-utils --with-backends="mysql pgsql sqlite3"

Run it and do :
    make
    make install

All the files are copied in the /usr/local/lib directory and the /usr/local/lib/opendbx subdirectory.

3. Copy the MySQL and PostgreSQL clients librairies into /usr/local/bin (the include files are unused).

4. Now, you must launch Pharo to install SqueakDBX.

Gofer new squeaksource: 'MetacelloRepository';
package: 'ConfigurationOfSqueakDBX';
load.

ConfigurationOfSqueakDBX project latestVersion load.

Gofer new squeaksource: 'MetacelloRepository';
package: 'ConfigurationOfGlorpDBX';
load.

ConfigurationOfGlorpDBX project latestVersion load.

5. You could remove the temporary "openDBX" directory (step 1).

6. The installation is completed.

Olivier ;-)
www.auverlot.fr
Hi Olivier,

 IIRC, you should:
 1) fix the location problem by putting symlink in the right place.
2) ensure that your dylib is compiled for the right architecture (32bit) considering that current VMs are 32bits
 Perhaps this is your problem?
 what gives:

 $ lipo -info libopendbx.dylib

#Luc



2011/5/17 Olivier Auverlot <[email protected] <mailto:[email protected]>>

    Hi,

    I try to use SqueakDBX on Mac OS X 10.6. I have downloaded and
    compiled the libraries for PostgreSQL, MySQL and finaly compiled
    and installed openDBX.

    CPPFLAGS="-I/opendbx/PostgreSQL/9.0/include
    -I/opendbx/mysql/5.0/include"
    LDFLAGS="-L/opendbx/PostgreSQL/9.0/lib -L/opendbx/mysql/5.0/lib"
    ./configure --disable-utils --with-backends="pgsql mysql sqlite3"

    Now, I have in /usr/local/lib:

    -rwxr-xr-x  1 root  wheel   17040 17 mai 09:10 libopendbx.1.dylib
    -rw-r--r--  1 root  wheel   32584 17 mai 09:10 libopendbx.a
    lrwxr-xr-x  1 root  wheel      18 17 mai 09:10 libopendbx.dylib ->
    libopendbx.1.dylib
    -rwxr-xr-x  1 root  wheel    1001 17 mai 09:10 libopendbx.la
    <http://libopendbx.la>
    -rwxr-xr-x  1 root  wheel   74624 17 mai 09:10 libopendbxplus.1.dylib
    -rw-r--r--  1 root  wheel  385056 17 mai 09:10 libopendbxplus.a
    lrwxr-xr-x  1 root  wheel      22 17 mai 09:10
    libopendbxplus.dylib -> libopendbxplus.1.dylib
    -rwxr-xr-x  1 root  wheel    1054 17 mai 09:10 libopendbxplus.la
    <http://libopendbxplus.la>

    and in /usr/local/opendbx :
    -rwxr-xr-x  1 root  wheel  17232 17 mai 09:10 libmysqlbackend.1.so
    <http://libmysqlbackend.1.so>
    -rw-r--r--  1 root  wheel  38960 17 mai 09:10 libmysqlbackend.a
    -rwxr-xr-x  1 root  wheel   1051 17 mai 09:10 libmysqlbackend.la
    <http://libmysqlbackend.la>
    lrwxr-xr-x  1 root  wheel     20 17 mai 09:10 libmysqlbackend.so
    -> libmysqlbackend.1.so <http://libmysqlbackend.1.so>
    -rwxr-xr-x  1 root  wheel  16904 17 mai 09:10 libpgsqlbackend.1.so
    <http://libpgsqlbackend.1.so>
    -rw-r--r--  1 root  wheel  28624 17 mai 09:10 libpgsqlbackend.a
    -rwxr-xr-x  1 root  wheel   1036 17 mai 09:10 libpgsqlbackend.la
    <http://libpgsqlbackend.la>
    lrwxr-xr-x  1 root  wheel     20 17 mai 09:10 libpgsqlbackend.so
    -> libpgsqlbackend.1.so <http://libpgsqlbackend.1.so>
    -rwxr-xr-x  1 root  wheel  16856 17 mai 09:10
    libsqlite3backend.1.so <http://libsqlite3backend.1.so>
    -rw-r--r--  1 root  wheel  25936 17 mai 09:10 libsqlite3backend.a
    -rwxr-xr-x  1 root  wheel   1053 17 mai 09:10 libsqlite3backend.la
    <http://libsqlite3backend.la>
    lrwxr-xr-x  1 root  wheel     22 17 mai 09:10 libsqlite3backend.so
    -> libsqlite3backend.1.so <http://libsqlite3backend.1.so>

    ok...

    I have downloaded the OneClick distribution of Pharo 1.2.1 and
    installed SqueakDBX and GlorpDBX.

    Gofer new squeaksource: 'MetacelloRepository';
    package: 'ConfigurationOfSqueakDBX';
    load.

    ConfigurationOfSqueakDBX project latestVersion load.

    Gofer new squeaksource: 'MetacelloRepository';
    package: 'ConfigurationOfGlorpDBX';
    load.

    ConfigurationOfGlorpDBX project latestVersion load.

    Now, I try to do a SQL request to MySQL:

    connect
         | conn connectionSettings result |

        connectionSettings := DBXConnectionSettings
            host: 'mysql.domaine.fr <http://mysql.domaine.fr>'
            port: '3306'
            database: 'test'
            userName: 'username'
            userPassword: 'hello'.

        conn := DBXConnection
            platform: DBXMySQLPlatform new
            settings: connectionSettings.

        conn connect.

        conn open.
        result := conn execute: 'SELECT * from data'.

        DBXTranscript show: result.

        conn close.

    But I get an error :  'Unable to find function address'

    SqueakDBX didn't found the libraries ? I have try to copy the
    librairies in /usr/lib and /usr/lib/opendbx but with no results.
    In the Resources subdirectory, I have created a symbolic link to
    /usr/local/lib/libopendbx.dylib but without progress.

    ln -s /usr/local/lib/libopendbx.dylib opendbx

     I get the same error :-(

    If i modify the info.plist file to set the SqueakDebug key at 1
    and the SqueakPluginsBuiltInOrLocalOnly key at false, I can see
    the search of librairies by the SqueakVM. The SqueakVM doesn't
    seem to try to load the openddbx libraries.

    You can download the log file at
    http://www.auverlot.fr/squeakdbx/squeakdbx.txt

    My previous tests under Linux have worked fine but i didn't find a
    solution with Mac OS X. Someone has an idea for help me ???

    Thanks for your help.

    Best regards
    Olivier
    www.auverlot.fr <http://www.auverlot.fr>




Reply via email to