Compiling Innostore client on MacOsX

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Compiling Innostore client on MacOsX

Benjamin Nortier
Hi

I'm trying to compile the Innostore client for Riak on Snow Leopard.

When I do 'make' from the innostore directory, build_deps.sh fails in configure:

innostore $make
...
checking for deflate... no
checking for deflate in -lz... no
configure: error: Zlib is required for compression to work
ERROR: c_src/build_deps.sh failed with error: 1

I have zlib installed via macports. Changing the flags in rebar.config makes it compile:

diff -r f911e29db565 rebar.config
--- a/rebar.config Thu Mar 25 07:24:26 2010 -0600
+++ b/rebar.config Mon Mar 29 10:27:38 2010 +0200
@@ -11,7 +11,7 @@
              {"darwin9.*-64$", "LDFLAGS", "-arch x86_64"},
 
              %% OS X Snow Leopard flags for 32-bit
-             {"darwin10.*-32$", "CFLAGS", "-m32"},
+             {"darwin10.*-32$", "CFLAGS", "-m64"},
              {"darwin10.*-32$", "LDFLAGS", "-arch i386"}
             ]}.

But then I see some warnings:

ld: warning: in c_src/innostore_drv.o, file is not of required architecture
ld: warning: in c_src/innodb/lib/libinnodb.a, file is not of required architecture

and the tests fail:

======================== EUnit ========================
module 'innostore'
  innostore: startup_test...
=ERROR REPORT==== 29-Mar-2010::10:33:59 ===
Error loading driver innostore: "No driver init in dynamic library"
*failed*
::throw:{error,{no_driver_init,"No driver init in dynamic library"}}
  in function innostore:connect/0
  in call from innostore:startup_test/0

Any ideas?

Thanks
Benjamin

--
Benjamin Nortier
e: [hidden email]
c: +44 (0)778 946 1959
gtalk: [hidden email]

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: Compiling Innostore client on MacOsX

Dave Smith


On Mon, Mar 29, 2010 at 3:02 AM, Benjamin Nortier <[hidden email]> wrote:
checking for deflate... no
checking for deflate in -lz... no
configure: error: Zlib is required for compression to work
ERROR: c_src/build_deps.sh failed with error: 1

Ah, I think what's going on here is that the zlib in macports is probably ONLY 64-bit. Whereas the default zlib that ships with OSX is a Universal and thus can be used for 32 or 64 bit compiles. The second set of flags you adjusted suggests that your'e using a 32-bit Erlang VM on Snow Leopard, so you need to make sure that you have a corresponding 32-bit zlib in macports.

              %% OS X Snow Leopard flags for 32-bit
-             {"darwin10.*-32$", "CFLAGS", "-m32"},
+             {"darwin10.*-32$", "CFLAGS", "-m64"},

Hope that helps,

D.


_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: Compiling Innostore client on MacOsX

Benjamin Nortier
On Mon, Mar 29, 2010 at 2:38 PM, David Smith <[hidden email]> wrote:


On Mon, Mar 29, 2010 at 3:02 AM, Benjamin Nortier <[hidden email]> wrote:
checking for deflate... no
checking for deflate in -lz... no
configure: error: Zlib is required for compression to work
ERROR: c_src/build_deps.sh failed with error: 1

Ah, I think what's going on here is that the zlib in macports is probably ONLY 64-bit. Whereas the default zlib that ships with OSX is a Universal and thus can be used for 32 or 64 bit compiles. The second set of flags you adjusted suggests that your'e using a 32-bit Erlang VM on Snow Leopard, so you need to make sure that you have a corresponding 32-bit zlib in macports.

              %% OS X Snow Leopard flags for 32-bit
-             {"darwin10.*-32$", "CFLAGS", "-m32"},
+             {"darwin10.*-32$", "CFLAGS", "-m64"},

Hope that helps,

D.



Fantastic, works like a charm now. I did a 

$ sudo port deactivate zlib 
$ sudo port install zlib +universal
$ make

...

=======================================================
  All 7 tests passed.

Thanks!

--
Benjamin Nortier
e: [hidden email]
c: +44 (0)778 946 1959
gtalk: [hidden email]

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com