zeromq/erlzmq2 — Issue #24: problem with building erlzmq2 on MacOs
Author: RomanShestakov
Created: 2011-10-19 18:58:18+00:00
State: open

Hello,

I have a couple of problems with adding erlzmq2 as a dependency to my project with rebar and building it on Mac.

1. I have the following in my rebar.config

{deps, [
{'erlsom', ".*", {git, "git://github.com/willemdj/erlsom.git", "master"}},
{'detergent', ".*", {git, "git://github.com/devinus/detergent.git", "master"}},
{'log4erl', ".*", {git, "git://github.com/ahmednawras/log4erl.git", "master"}},
{'erlzmq', ".*", {git, "git://github.com/zeromq/erlzmq2.git", "master"}}
]}.

but during build I am getting the following err:

rebar compile
==> erlsom (compile)
==> detergent (compile)
==> mochiweb (compile)
==> log4erl (compile)
==> erlzmq (compile)
i686-apple-darwin11-llvm-gcc-4.2: deps/zeromq2/src/.libs/libzmq.a: No such file or directory
ERROR: $CC c_src/erlzmq_nif.o c_src/vector.o $LDFLAGS $DRV_LDFLAGS -o priv/erlzmq_drv.so failed with error: 1
make: *** [compile] Error 1

this seems to mean that erlzmq doesnt pull zeromq2 from github as its dependency.

if I change to erlzmq dir and execute make, the project does built but when I try to run tests with 'make test' I am getting the following error:

bash-3.2$ make test
==> erlzmq (compile)
make[1]: Nothing to be done for `all'.
==> erlzmq (eunit)
Compiled src/erlzmq_nif.erl
Compiled src/erlzmq.erl
Compiled test/erlzmq_test.erl
undefined
*** test module not found ***
::erlzmq_nif

=ERROR REPORT==== 19-Oct-2011::19:55:45 ===
The on_load function for module erlzmq_nif returned {error,
{load_failed,
"Failed to load NIF library: 'dlopen(/Users/romanshestakov/Development/betfairgateway/deps/erlzmq/priv/erlzmq_drv.so, 2): no suitable image found. Did find:\n\t/Users/romanshestakov/Development/betfairgateway/deps/erlzmq/priv/erlzmq_drv.so: mach-o, but wrong architecture'"}}
=======================================================

which seems to indicate that though erlzmq_drv.so was built, it was built for incorrect archetecture.

any ideas how to make the build work with MacOS

Regards, Roman