installing drizzle db on os x

UPDATE: these instruction might not be good to follow for now since even though it compiled and installed things are not happy at the moment.

$ /opt/local/bin/client/drizzletest
drizzletest: Could not open connection 'default' after 500 attempts: 21 drizzle_state_connect:could not connect
not ok

also there is better info here maybe … should have done more research fist before diving in head first i guess … oh well only way to learn is the hard way :-/

so i felt like installing drizzle the other day to check it out which as you might know is currently being developed by some people from mysql as a modern web savy simple open database …
here’s what i did to get it working … YMMV

looking at their page it seems deceptivly simple , but you may need a few key ingredients first.

if u don’t want the whole story, jump to the bottom for the short story , quick install …

ok so a quick search on macports turns up nothing …

$ port search drizzle

so it looks like we have to build ourselves but we can still use ports for deps

but we start first from the instructions on the site ->

$ bzr branch lp:drizzle ; cd drizzle; ./config/autorun.sh ; ./configure && make

-bash: bzr: command not found
-bash: cd: drizzle: No such file or directory
-bash: ./config/autorun.sh: No such file or directory
-bash: ./configure: No such file or directory

ok missing bzr

$ port search bzr
...
bzr @1.13.1 (devel, python)
The next-generation distributed version control system

btw, you want bzr not bazaar

$ sudo port install bzr

ok now to try their cmd again …

$ bzr branch lp:drizzle ; cd drizzle; ./config/autorun.sh ; ./configure && make
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data.  See "bzr help launchpad-login".
Branched 998 revision(s).

....

checking for libprotobuf... no
configure: error: protobuf is required for Drizzle. On Debian this can be found in libprotobuf-dev. On RedHat this can be found in protobuf-devel.

so we got a bit of a problem again … but at least we have the src downloaded
now and a clue to the build problems at hand. so again we turn to macports.

$ port search protobuf
...
protobuf-c @0.6 (devel)
Pure C code generator and runtime libraries for Protocol Buffers

now we install protobuf-c which also gets protobuf-cpp , these are google protocol buffers.

$ sudo port install protobuf-c

ok so now we should just need to run the last half of the original cmds without fetching the bzr src again.

$ ./config/autorun.sh ; ./configure && make
...
checking for libprotobuf... no
configure: error: protobuf is required for Drizzle. On Debian this can be found in libprotobuf-dev. On RedHat this can be found in protobuf-devel.

still a damn protobuf error … hmm quick google search with the handy grease monkey script and i have the answer. it doesn’t know where to look for protobuf so we just have to tell it.

$ ./config/autorun.sh ; ./configure --with-libprotbuf-prefix=/opt/local && make

didn’t quite work so we check the config help.

$ ./configure --help

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.
...

^^ thats good to know

—with-libprotobuf-prefix[=DIR] search for libprotobuf in DIR/include and DIR/lib

hmm so that should work, lets copy and paste to make sure we got it right and double check the path.

$ ./configure --with-libprotobuf-prefix=/opt/local/

ya that fixes protobuf but now we have another problem ..

checking for libdrizzle... no
configure: error: libdrizzle is required for Drizzle

WTF??? ok its got to be somewhere …

$ locate libdrizzle
$ sudo find / -iname *libdrizzle*
/Users/pjkix/src/drizzle/plugin/oldlibdrizzle
/Users/pjkix/src/drizzle/plugin/oldlibdrizzle/libdrizzle.cc
/Users/pjkix/src/drizzle/plugin/oldlibdrizzle/libdrizzle.h
/Users/pjkix/src/drizzle/plugin/oldlibdrizzle/libdrizzle_priv.cc
/Users/pjkix/src/drizzle/plugin/oldlibdrizzle/libdrizzle_priv.h
/Users/pjkix/src/drizzle/plugin/oldlibdrizzle/oldlibdrizzle.cc
/Users/pjkix/src/drizzle/plugin/oldlibdrizzle/oldlibdrizzle.h

now i’m kinda stumped … turns out libdrizzle is seperate from drizzle … kinda odd since mysql src builds lib and client at the same time
as it turns out there are quite a few drizzle related projects as well.

ok so now on to building libdrizzle. least we didn’t install bzr for nothing

$ cd ..
$ bzr branch lp:libdrizzle
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data.  See "bzr help launchpad-login".
Branched 87 revision(s).
PJKix-Laptop:src pjkix$ cd libdrizzle
PJKix-Laptop:libdrizzle pjkix$ ./config/autorun.sh

---
Configuration summary for libdrizzle version 0.2.0

   * Installation prefix:       /usr/local
   * System type:
   * Host CPU:                  i386
   * C Compiler:                i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5484)
   * Assertions enabled:        yes
   * Debug enabled:             no
   * Profiling enabled:         no
   * Coverage enabled:          no
   * Warnings as failure:       yes

---

$ make && sudo make install ;

----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

probably should have installed that in /opt oh well …
ok finally now back to install drizzle ….

PJKix-Laptop:libdrizzle pjkix$ cd ..
PJKix-Laptop:src pjkix$ cd drizzle/

PJKix-Laptop:drizzle pjkix$ ./configure --with-libprotobuf-prefix=/opt/local/ ; make && sudo make install
...
checking for libpcre... no
configure: error: libpcre is required for Drizzle. On Debian this can be found in libpcre3-dev. On RedHat this can be found in pcre-devel.
make: *** No targets specified and no makefile found.  Stop.

ungh more errors … its never simple eh? ok lets take care of pcre now.

PJKix-Laptop:drizzle pjkix$ port search pcre
...
pcre @7.8 (devel)
    Perl Compatible Regular Expressions Library
...

PJKix-Laptop:drizzle pjkix$ sudo port install pcre;

good that was easy.

PJKix-Laptop:drizzle pjkix$ ./configure --help

—with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib

just to be sure no more unfound libs we switch to lib path instead to take care of all libs

PJKix-Laptop:drizzle pjkix$ ./configure --with-lib-prefix=/opt/local --prefix=/opt/local ; make && sudo make install
...
---
Configuration summary for drizzle version 2009.04.998

   * Installation prefix:       /opt/local
   * System type:               apple-darwin9.6.0
   * Host CPU:                  i386
   * C Compiler:                i686-apple-darwin9-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5564)
   * C++ Compiler:              i686-apple-darwin9-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5564)
   * Build auth_pam:            no
   * Assertions enabled:        yes
   * Debug enabled:             no
   * Profiling enabled:         no
   * Coverage enabled:          no
   * Warnings as failure:       yes
   * Scheduling Plugins:        single_thread pool_of_threads
   * C++ cstdint location:      <stdint.h>
   * C++ hash_map location:     <ext/hash_map>
   * C++ hash namespace:        __gnu_cxx
   * C++ shared_ptr namespace:  std::tr1

---
...
----------------------------------------------------------------------
Libraries have been installed in:
   /opt/local/lib/drizzle/plugin

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

so after much bubbling & churning we have …
the last piece of the puzzle … SUCCESS!

$ drizzled
drizzled         drizzled_safe    drizzledumpslow
PJKix-Laptop:drizzle pjkix$ drizzled --version
drizzled  Ver 2009.04.998 for apple-darwin9.6.0 on i386 (Source distribution)

Quick Intstall

easy way would probably be to follow these steps. hopefully you are already using the awesome macports and have xcode tools installed.

$ sudo port install bzr protobuf-c pcre
$ cd src
$ bzr branch lp:libdrizzle
$ cd libdrizzle
$ ./configure --prefix=/opt/local && make && sudo make install
$ cd ..
$ bzr branch lp:drizzle
$ cd drizzle
$ ./config/autorun.sh
$ ./configure --with-lib-prefix=/opt/local --prefix=/opt/local &&  make && sudo make install

have fun playing with drizzle :)

LOL :) —disable-fail Turn warnings into failures [default=on]

One Comment

  1. Posted March 21, 2010 at 8:22 pm | Permalink

    Installing it natively went fine for me on 10.6.2, both the current version (as of today, drizzle-2010-03-15 with libdrizzle v0.8 — as well as the previous version). Just make sure you install the prereqs as described in the page referenced: http://drizzle.org/wiki/Compiling/MacOS_X#Package_Dependencies — then download the latest tar files from:
    https://launchpad.net/drizzle
    and
    https://launchpad.net/libdrizzle/

    Out of curiosity, I did try the bzr version and had some problems with that, possibly related to the Boost libs or some other dynamic linking issue. Would be interested to know if anyone was able to get the bzr version to work on OS X.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*