1

I am starting with zeroMQ but could get it to work. I installed zeroMQ from tarball using the following commands:

$ ./autogen.sh
$ ./configure --prefix=/usr/local/pkg-config-0.23 --datarootdir=/usr/share
$ make
$ make check
$ sudo make install

While doing make check I got a few failures:

========================================
   zeromq 4.0.4: tests/test-suite.log
========================================

# TOTAL: 43
# PASS:  40
# SKIP:  0
# XFAIL: 1
# FAIL:  2
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: test_system
=================

W: Only able to create 253 sockets on this box
I: Tune your system to increase maximum allowed file handles
I: On OS/X, run 'ulimit -n 1200' in bash

XFAIL: test_abstract_ipc
========================

Assertion failed: (rc == 0), function main, file test_abstract_ipc.cpp, line 31.

FAIL: test_shutdown_stress
==========================

Assertion failed: (s2), function main, file test_shutdown_stress.cpp, line 64.

I want to use zeroMQ with Python on OS X

UPDATE 30-June

so before you posted I tried with brew it sounded like everything went fine except brew link zmq

So tried to manually symlink

cd /usr/local/opt

ln -s /usr/local/Cellar/zeromq/4.0.3/lib/ zeromq

cd /usr/local/include/

ln -s ../Cellar/zeromq/4.0.3/include/zmq_utils.h zmq_utils.h

ln -s ../Cellar/zeromq/4.0.3/include/zmq.h zmq.h

then again i tried : sudo ARCHFLAGS="-arch x86_64" gem install zmq -- --with-zmq-dir=/usr/local/opt/zeromq

but got the following errors

checking for zmq.h... yes

checking for zmq_init() in -lzmq... yes

Cool, I found your zmq install...

creating Makefile

make "DESTDIR="

compiling rbzmq.c

rbzmq.c:968:7: error: use of undeclared identifier
'ZMQ_RECOVERY_IVL_MSEC'

        case ZMQ_RECOVERY_IVL_MSEC:

             ^

rbzmq.c:990:10: error: use of undeclared identifier 'ZMQ_HWM'

    case ZMQ_HWM:

         ^

rbzmq.c:991:10: error: use of undeclared identifier 'ZMQ_SWAP'

    case ZMQ_SWAP:

         ^

rbzmq.c:995:10: error: use of undeclared identifier 'ZMQ_MCAST_LOOP'

    case ZMQ_MCAST_LOOP:

         ^

rbzmq.c:1292:10: error: use of undeclared identifier 'ZMQ_HWM'

    case ZMQ_HWM:

         ^

rbzmq.c:1293:10: error: use of undeclared identifier 'ZMQ_SWAP'

    case ZMQ_SWAP:

         ^

rbzmq.c:1297:10: error: use of undeclared identifier 'ZMQ_MCAST_LOOP'

    case ZMQ_MCAST_LOOP:

         ^

rbzmq.c:1315:10: error: use of undeclared identifier
'ZMQ_RECOVERY_IVL_MSEC'

    case ZMQ_RECOVERY_IVL_MSEC:

         ^

rbzmq.c:1443:81: error: too few arguments to function call, expected
4, have 3

    send_args->rc = zmq_send(send_args->socket, send_args->msg, send_args->flags);

                    ~~~~~~~~                                                    ^

/usr/local/include/zmq.h:354:1: note: 'zmq_send' declared here

ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int
flags);

^

/usr/local/include/zmq.h:67:27: note: expanded from macro 'ZMQ_EXPORT'

##       define ZMQ_EXPORT __attribute__ ((visibility("default")))

                          ^

rbzmq.c:1517:38: error: too few arguments to function call, expected
4, have 3

        rc = zmq_send (s, &msg, flags);

             ~~~~~~~~                ^

/usr/local/include/zmq.h:354:1: note: 'zmq_send' declared here

ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int
flags);

^

/usr/local/include/zmq.h:67:27: note: expanded from macro 'ZMQ_EXPORT'

##       define ZMQ_EXPORT __attribute__ ((visibility("default")))

                          ^

rbzmq.c:1541:81: error: too few arguments to function call, expected
4, have 3

    recv_args->rc = zmq_recv(recv_args->socket, recv_args->msg, recv_args->flags);

                    ~~~~~~~~                                                    ^

/usr/local/include/zmq.h:356:1: note: 'zmq_recv' declared here

ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);

^

/usr/local/include/zmq.h:67:27: note: expanded from macro 'ZMQ_EXPORT'

##       define ZMQ_EXPORT __attribute__ ((visibility("default")))

                          ^

rbzmq.c:1602:38: error: too few arguments to function call, expected
4, have 3

        rc = zmq_recv (s, &msg, flags);

             ~~~~~~~~                ^

/usr/local/include/zmq.h:356:1: note: 'zmq_recv' declared here

ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);

^

/usr/local/include/zmq.h:67:27: note: expanded from macro 'ZMQ_EXPORT'

#       define ZMQ_EXPORT __attribute__ ((visibility("default")))

                          ^

rbzmq.c:1675:50: error: use of undeclared identifier 'ZMQ_HWM'

    rb_define_const (zmq_module, "HWM", INT2NUM (ZMQ_HWM));

                                                 ^

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/ruby.h:1167:35:
note: expanded from macro 'INT2NUM'

## define INT2NUM(v) INT2FIX((int)(v))

                                  ^

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/ruby.h:241:45:
note: expanded from macro 'INT2FIX'

#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))

                                            ^

rbzmq.c:1676:51: error: use of undeclared identifier 'ZMQ_SWAP'

    rb_define_const (zmq_module, "SWAP", INT2NUM (ZMQ_SWAP));

                                                  ^

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/ruby.h:1167:35:
note: expanded from macro 'INT2NUM'

# define INT2NUM(v) INT2FIX((int)(v))

                                  ^

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/ruby.h:241:45:
note: expanded from macro 'INT2FIX'

##define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))

                                            ^

rbzmq.c:1683:57: error: use of undeclared identifier 'ZMQ_MCAST_LOOP'

    rb_define_const (zmq_module, "MCAST_LOOP", INT2NUM (ZMQ_MCAST_LOOP));

                                                        ^

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/ruby.h:1167:35:
note: expanded from macro 'INT2NUM'

## define INT2NUM(v) INT2FIX((int)(v))

                                  ^

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/ruby.h:241:45:
note: expanded from macro 'INT2FIX'

#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))

                                            ^

rbzmq.c:1698:64: error: use of undeclared identifier
'ZMQ_RECOVERY_IVL_MSEC'

    rb_define_const (zmq_module, "RECOVERY_IVL_MSEC", INT2NUM (ZMQ_RECOVERY_IVL_MSEC));

                                                               ^

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/ruby.h:1167:35:
note: expanded from macro 'INT2NUM'

# define INT2NUM(v) INT2FIX((int)(v))

                                  ^

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/ruby.h:241:45:
note: expanded from macro 'INT2FIX'

#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))

                                            ^

16 errors generated.

make: *** [rbzmq.o] Error 1



Gem files will remain installed in
/Library/Ruby/Gems/2.0.0/gems/zmq-2.1.4 for inspection.

Results logged to /Library/Ruby/Gems/2.0.0/gems/zmq-2.1.4/./gem_make.out

2 Answers 2

1

You can refer to this bugreport:

https://github.com/zeromq/zproto/issues/61

If you want to be able to build with those checks not failing, refer to that bugreport to see when a patch is made.

In the meantime, you either have to live without the functionality that fails, or fix the bug yourself.

1

Installing ZeroMQ with brew

Considering installing ZeroMQ with the brew package manager. brew should deal with the build problems for you.

To install brew, run this command in Terminal.app:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Then install ZeroMQ using:

brew install zeromq

With ZeroMQ installed, you can follow the python specific steps on the PyZMO page.

Installing from source

Alternatively, try following the non-brew based approach documented on the official ZeroMQ page, Building and Installing PyZMQ.

Log an Issue

As this problem does not appear to affect others, consider logging an issue with PyZMO directly. There you will reach the core developers and their insight will hopefully quickly produce a solution.

4
  • Hi @Graham Miln, I already tried with brew before you posted an answer, however I got brew link zmq failure so I manually linked posted in updated question above. Commented Jun 30, 2014 at 5:00
  • Given the technical nature of the problem, you should log a new issue over at GitHub to engage the ZeroMQ developers directly. Hopefully they will quickly find the underlying cause. Commented Jun 30, 2014 at 10:33
  • Do you know how to get the .so file that is needed for it to work as a PHP extension? I've checked in /usr/local/Cellar/zeromq/4.1.4/lib but no .so there.
    – kiradotee
    Commented Aug 1, 2016 at 9:22
  • Have you tried building ZeroMQ from source? ZeroMQ's make, make check, and make install work well on macOS. Otherwise, please can you ask this as a question over on StackOverflow. Commented Aug 1, 2016 at 10:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .