Giter Site home page Giter Site logo

Comments (10)

yrashk avatar yrashk commented on May 25, 2024

Pull the latest verison, it has a different rebar.config

from erlzmq2.

dhammika avatar dhammika commented on May 25, 2024

Hi Roman,

Looks like a build issue, what's your platform and os version?
Try file /Users/romanshestakov/Development/betfairgateway/deps/erlzmq/priv/erlzmq_drv.so,
see if it shows your platform?
We had few other reported issues on mac, you may want to google or dig
mailing list.
Unfortunately I don't have a mac to debug, I think you'd have to
change makefiles.

Dhammika

On Wed, Oct 19, 2011 at 11:58 AM, RomanShestakov
[email protected]
wrote:

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

Reply to this email directly or view it on GitHub:
#24

from erlzmq2.

yrashk avatar yrashk commented on May 25, 2024

@dhammika, I still believe it is a problem of using an outdated version (old version required use of make, and pasted rebar.config is different from one in master).

from erlzmq2.

RomanShestakov avatar RomanShestakov commented on May 25, 2024

hi Yurii,

I am building erlzmq2 with latest master from github

the rebar.config is the one I use in my project, I added
{'erlzmq', ".*", {git, "git://github.com/zeromq/erlzmq2.git", "master"}}
as a dependency hoping that when I build it, it will pull erlzmq2 and build it. but it doesn't work very well.

  1. though, erlzmq2 gets pulled from repo it fails to build, because it erlzmq2 doesn't build zeromq2 first
  2. so , when I change to deps/erlzmq/ and run make, it does build zeromq2, and builds a driver

but make test doesn't run on mac, I use Lion , Software Mac OS X Lion 10.7.2 (11C74)

and priv/erlzmq_drv.so gets build for 64bit:

bash-3.2$ file priv/erlzmq_drv.so
priv/erlzmq_drv.so: Mach-O 64-bit bundle x86_64

when I run "make test", I am getting :
=ERROR REPORT==== 19-Oct-2011::23:54:56 ===
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'"}}
undefined
*** test module not found ***
::erlzmq_nif

but Erlang install (Erlang R14B04 (erts-5.8.5) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false])

which I built from source seems to be for 32 bit:

bash-3.2$ file /usr/local/bin/erlc
/usr/local/bin/erlc: Mach-O executable i386

so, the main question is : how to make erlzmq and zeromq2 to get build for 32bit with rebar?

Regards, Roman

from erlzmq2.

dhammika avatar dhammika commented on May 25, 2024

Hi,

I don't know how this is done in rebar.
But you have to set CFLAGS="-arch i386" in your shell or makefile.
There's also a way to build platform agnostic binaries on mac, but
that's black magic.
Let us know if this works out.

Dhammika

On Wed, Oct 19, 2011 at 3:58 PM, RomanShestakov
[email protected]
wrote:

hi Yurii,

I am building erlzmq2 with latest master from github

the rebar.config is the one I use in my project, I added
 {'erlzmq', ".*", {git, "git://github.com/zeromq/erlzmq2.git", "master"}}
as a dependency hoping that when I build it, it will pull erlzmq2 and build it. but it doesn't work very well.

  1. though, erlzmq2 gets pulled from repo it fails to build, because it erlzmq2 doesn't build zeromq2 first
  2. so , when I change to  deps/erlzmq/ and run make, it does build zeromq2, and builds a driver

but make test doesn't run on mac, I use Lion , Software  Mac OS X Lion 10.7.2 (11C74)

and priv/erlzmq_drv.so gets build for 64bit:

bash-3.2$ file priv/erlzmq_drv.so
priv/erlzmq_drv.so: Mach-O 64-bit bundle x86_64

when I run "make test", I am getting :
=ERROR REPORT==== 19-Oct-2011::23:54:56 ===
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'"}}
undefined
*** test module not found ***
::erlzmq_nif

but Erlang install (Erlang R14B04 (erts-5.8.5) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false])

which I built from source seems to be for 32 bit:

bash-3.2$ file /usr/local/bin/erlc
/usr/local/bin/erlc: Mach-O executable i386

so, the main question is : how to make erlzmq and zeromq2 to get build for 32bit with rebar?

Regards, Roman

Reply to this email directly or view it on GitHub:
#24 (comment)

from erlzmq2.

yrashk avatar yrashk commented on May 25, 2024

@RomanShestakov: is this what you have in your rebar.config: https://github.com/zeromq/erlzmq2/blob/master/rebar.config ?

from erlzmq2.

yrashk avatar yrashk commented on May 25, 2024

I apologize, I wasn't reading your issue attentively, you quoted your rebar.config

from erlzmq2.

yrashk avatar yrashk commented on May 25, 2024

My first guess is that you might have older rebar which doesn't support pre_hooks used in rebar.config of erlzmq2. Please check if that is the case.

from erlzmq2.

yrashk avatar yrashk commented on May 25, 2024

On the second problem, what's the word size of your erlang installation? 32 bit?

from erlzmq2.

RomanShestakov avatar RomanShestakov commented on May 25, 2024

thanks Yurii and Dhammika,

you were right - I had an outdated version of rebar, after update rebar was able to pull all the dependencies and build them correctly.

after that make test for erlzmq started passing as well.

many thanks for your help

Regards, Roman

from erlzmq2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.