Giter Site home page Giter Site logo

erlzmq2's Introduction

erlzmq2

NIF based Erlang bindings for the ZeroMQ messaging library.

Copyright (c) 2011 Yurii Rashkovskii, Evax Software and Michael Truog

Overview

The erlzmq2 application provides high-performance NIF based Erlang bindings for the ZeroMQ messaging library.

Downloading

The erlzmq2 source code can be found on GitHub

$ git clone http://github.com/zeromq/erlzmq2.git

Building

Please note that to behave properly on your system ZeroMQ might require some tuning.

Build the code

$ make

If you want to build against a specific version of ZeroMQ in the 3.1 series (not v3.1.0), use this:

$ ZEROMQ_VERSION=v<VERSION> make

Be aware that this will almost assuredly not work correctly for any versions of zeromq that are not in the 3.1 series.

Build the docs

$ make docs

Run the test suite

$ make test

Run the benchmarks (requires python and matplotlib)

$ make bench

This will run performance tests and output png graphs in the graphs directory.

Architecture

The bindings use Erlang's NIF (native implemented functions) interface to achieve the best performance. One extra OS thread and one pair of inproc sockets by context are used to simulate blocking recv calls without affecting the Erlang virtual machine's responsiveness.

License

The project is released under the MIT license.

erlzmq2's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

erlzmq2's Issues

Fails to compile on Mac os X (1.7.4)

erl -version
Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 5.9

uname -a
Darwin Daniels-MacBook.local 11.4.0 Darwin Kernel Version 11.4.0: Mon Apr 9 19:33:05 PDT 2012; root:xnu-1699.26.8~1/RELEASE_I386 i386

and now for the output of the script

==> erlzmq (compile)
Cloning into ../deps/zeromq2...
v2.1.11
Note: checking out 'v2.1.11'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 73f167e... Updated NEWS for 2.1.11
autoreconf: Entering directory `.'
autoreconf: configure.in: not using Gettext
autoreconf: running: aclocal --force -I config
autoreconf: configure.in: tracing
autoreconf: configure.in: subdirectory foreign/openpgm/build-staging/openpgm/pgm/ not present
autoreconf: running: glibtoolize --copy --force
glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'.
glibtoolize: copying file `config/ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIR, `config'.
glibtoolize: copying file `config/libtool.m4'
glibtoolize: copying file `config/ltoptions.m4'
glibtoolize: copying file `config/ltsugar.m4'
glibtoolize: copying file `config/ltversion.m4'
glibtoolize: copying file `config/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf --include=config --force
autoreconf: running: /usr/bin/autoheader --include=config --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.in:52: installing `config/config.sub'
configure.in:44: installing `config/compile'
configure.in:14: installing `config/missing'
configure.in:14: installing `config/install-sh'
configure.in:52: installing `config/config.guess'
perf/Makefile.am: installing `config/depcomp'
autoreconf: Leaving directory `.'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking for gcc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of cc... gcc3
checking for cc option to accept ISO C99... -std=gnu99
checking whether we are using the GNU C++ compiler... yes
checking whether c++ accepts -g... yes
checking dependency style of c++... gcc3
checking whether cc -std=gnu99 and cc understand -c and -o together... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for gawk... (cached) awk
checking for xmlto... no
checking for asciidoc... no
checking build system type... i386-apple-darwin11.4.0
checking host system type... i386-apple-darwin11.4.0
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by cc -std=gnu99... /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld
checking if the linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm
checking the name lister (/usr/bin/nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm output from cc -std=gnu99 object... ok
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking how to run the C preprocessor... cc -std=gnu99 -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc -std=gnu99 supports -fno-rtti -fno-exceptions... no
checking for cc -std=gnu99 option to produce PIC... -fno-common -DPIC
checking if cc -std=gnu99 PIC flag -fno-common -DPIC works... yes
checking if cc -std=gnu99 static flag -static works... no
checking if cc -std=gnu99 supports -c -o file.o... yes
checking if cc -std=gnu99 supports -c -o file.o... (cached) yes
checking whether the cc -std=gnu99 linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin11.4.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... c++ -E
checking for ld used by c++... /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld
checking if the linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) is GNU ld... no
checking whether the c++ linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) supports shared libraries... yes
checking for c++ option to produce PIC... -fno-common -DPIC
checking if c++ PIC flag -fno-common -DPIC works... yes
checking if c++ static flag -static works... no
checking if c++ supports -c -o file.o... yes
checking if c++ supports -c -o file.o... (cached) yes
checking whether the c++ linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin11.4.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether the C compiler works... yes
checking whether we are using Intel C compiler... no
checking whether we are using Sun Studio C compiler... no
checking whether we are using clang C compiler... no
checking whether we are using gcc >= 4 C compiler... yes
checking whether the C++ compiler works... yes
checking whether we are using Intel C++ compiler... no
checking whether we are using Sun Studio C++ compiler... no
checking whether we are using clang C++ compiler... no
checking whether we are using gcc >= 4 C++ compiler... yes
checking whether to enable debugging information... no
checking whether to enable code coverage... no
checking for pthread_create in -lpthread... yes
checking host system type... (cached) i386-apple-darwin11.4.0
checking whether C++ compiler supports -Wno-uninitialized... yes
checking whether C++ compiler supports -fvisibility=hidden... yes
checking whether C++ compiler supports dso visibility... yes
checking for asciidoc... no
checking for xmlto... no
configure: WARNING: You are building an unreleased version of 0MQ and asciidoc or xmlto are not installed.
configure: WARNING: Documentation will not be built and manual pages will not be installed.
checking whether to build documentation... no
checking whether to install manpages... no
checking for ANSI C header files... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netinet/tcp.h usability... yes
checking netinet/tcp.h presence... yes
checking for netinet/tcp.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking for unistd.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking ifaddrs.h usability... yes
checking ifaddrs.h presence... yes
checking for ifaddrs.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for size_t... yes
checking for ssize_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for uint32_t... yes
checking for working volatile... yes
checking how to enable additional warnings for C++ compiler... -Wall
checking return type of signal handlers... void
checking for perror... yes
checking for gettimeofday... yes
checking for clock_gettime... no
checking for memset... yes
checking for socket... yes
checking for getifaddrs... yes
checking for freeifaddrs... yes
checking alloca.h usability... yes
checking alloca.h presence... yes
checking for alloca.h... yes
checking whether SOCK_CLOEXEC is supported... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating doc/Makefile
config.status: creating perf/Makefile
config.status: creating src/libzmq.pc
config.status: creating builds/msvc/Makefile
config.status: creating tests/Makefile
config.status: creating foreign/openpgm/Makefile
config.status: creating builds/redhat/zeromq.spec
config.status: creating src/platform.hpp
config.status: executing depfiles commands
config.status: executing libtool commands
Making all in src
make  all-am
[A BUNCH OF THINGS BEING COMPILED THAT WORK FINE.....]
mv -f .deps/libzmq_la-zmq_init.Tpo .deps/libzmq_la-zmq_init.Plo
/bin/sh ../libtool --tag=CXX   --mode=compile c++ -DHAVE_CONFIG_H -I.   -Wall -Wno-uninitialized -D_DARWIN_C_SOURCE -D_REENTRANT -D_THREAD_SAFE  -fvisibility=hidden  -g -O2 -MT libzmq_la-zmq_listener.lo -MD -MP -MF .deps/libzmq_la-zmq_listener.Tpo -c -o libzmq_la-zmq_listener.lo `test -f 'zmq_listener.cpp' || echo './'`zmq_listener.cpp
libtool: compile:  c++ -DHAVE_CONFIG_H -I. -Wall -Wno-uninitialized -D_DARWIN_C_SOURCE -D_REENTRANT -D_THREAD_SAFE -fvisibility=hidden -g -O2 -MT libzmq_la-zmq_listener.lo -MD -MP -MF .deps/libzmq_la-zmq_listener.Tpo -c zmq_listener.cpp  -fno-common -DPIC -o .libs/libzmq_la-zmq_listener.o
libtool: compile:  c++ -DHAVE_CONFIG_H -I. -Wall -Wno-uninitialized -D_DARWIN_C_SOURCE -D_REENTRANT -D_THREAD_SAFE -fvisibility=hidden -g -O2 -MT libzmq_la-zmq_listener.lo -MD -MP -MF .deps/libzmq_la-zmq_listener.Tpo -c zmq_listener.cpp -o libzmq_la-zmq_listener.o >/dev/null 2>&1
mv -f .deps/libzmq_la-zmq_listener.Tpo .deps/libzmq_la-zmq_listener.Plo
/bin/sh ../libtool --tag=CXX   --mode=link c++ -fvisibility=hidden  -g -O2 -version-info 1:0:0   -o libzmq.la -rpath /usr/local/lib libzmq_la-clock.lo libzmq_la-command.lo libzmq_la-ctx.lo libzmq_la-connect_session.lo libzmq_la-decoder.lo libzmq_la-device.lo libzmq_la-devpoll.lo libzmq_la-dist.lo libzmq_la-encoder.lo libzmq_la-epoll.lo libzmq_la-err.lo libzmq_la-fq.lo libzmq_la-io_object.lo libzmq_la-io_thread.lo libzmq_la-ip.lo libzmq_la-kqueue.lo libzmq_la-lb.lo libzmq_la-mailbox.lo libzmq_la-named_session.lo libzmq_la-object.lo libzmq_la-options.lo libzmq_la-own.lo libzmq_la-pair.lo libzmq_la-pgm_receiver.lo libzmq_la-pgm_sender.lo libzmq_la-pgm_socket.lo libzmq_la-pipe.lo libzmq_la-poll.lo libzmq_la-poller_base.lo libzmq_la-pull.lo libzmq_la-push.lo libzmq_la-reaper.lo libzmq_la-pub.lo libzmq_la-rep.lo libzmq_la-req.lo libzmq_la-select.lo libzmq_la-session.lo libzmq_la-signaler.lo libzmq_la-socket_base.lo libzmq_la-sub.lo libzmq_la-swap.lo libzmq_la-tcp_connecter.lo libzmq_la-tcp_listener.lo libzmq_la-tcp_socket.lo libzmq_la-thread.lo libzmq_la-transient_session.lo libzmq_la-trie.lo libzmq_la-uuid.lo libzmq_la-xpub.lo libzmq_la-xrep.lo libzmq_la-xreq.lo libzmq_la-xsub.lo libzmq_la-zmq.lo libzmq_la-zmq_connecter.lo libzmq_la-zmq_engine.lo libzmq_la-zmq_init.lo libzmq_la-zmq_listener.lo  -lpthread 
libtool: link: c++ -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o .libs/libzmq.1.dylib  .libs/libzmq_la-clock.o .libs/libzmq_la-command.o .libs/libzmq_la-ctx.o .libs/libzmq_la-connect_session.o .libs/libzmq_la-decoder.o .libs/libzmq_la-device.o .libs/libzmq_la-devpoll.o .libs/libzmq_la-dist.o .libs/libzmq_la-encoder.o .libs/libzmq_la-epoll.o .libs/libzmq_la-err.o .libs/libzmq_la-fq.o .libs/libzmq_la-io_object.o .libs/libzmq_la-io_thread.o .libs/libzmq_la-ip.o .libs/libzmq_la-kqueue.o .libs/libzmq_la-lb.o .libs/libzmq_la-mailbox.o .libs/libzmq_la-named_session.o .libs/libzmq_la-object.o .libs/libzmq_la-options.o .libs/libzmq_la-own.o .libs/libzmq_la-pair.o .libs/libzmq_la-pgm_receiver.o .libs/libzmq_la-pgm_sender.o .libs/libzmq_la-pgm_socket.o .libs/libzmq_la-pipe.o .libs/libzmq_la-poll.o .libs/libzmq_la-poller_base.o .libs/libzmq_la-pull.o .libs/libzmq_la-push.o .libs/libzmq_la-reaper.o .libs/libzmq_la-pub.o .libs/libzmq_la-rep.o .libs/libzmq_la-req.o .libs/libzmq_la-select.o .libs/libzmq_la-session.o .libs/libzmq_la-signaler.o .libs/libzmq_la-socket_base.o .libs/libzmq_la-sub.o .libs/libzmq_la-swap.o .libs/libzmq_la-tcp_connecter.o .libs/libzmq_la-tcp_listener.o .libs/libzmq_la-tcp_socket.o .libs/libzmq_la-thread.o .libs/libzmq_la-transient_session.o .libs/libzmq_la-trie.o .libs/libzmq_la-uuid.o .libs/libzmq_la-xpub.o .libs/libzmq_la-xrep.o .libs/libzmq_la-xreq.o .libs/libzmq_la-xsub.o .libs/libzmq_la-zmq.o .libs/libzmq_la-zmq_connecter.o .libs/libzmq_la-zmq_engine.o .libs/libzmq_la-zmq_init.o .libs/libzmq_la-zmq_listener.o   -lpthread    -install_name  /usr/local/lib/libzmq.1.dylib -compatibility_version 2 -current_version 2.0 -Wl,-single_module
libtool: link: (cd ".libs" && rm -f "libzmq.dylib" && ln -s "libzmq.1.dylib" "libzmq.dylib")
libtool: link: (cd ".libs" && rm -f "libzmq.1.0.0.dylib" && ln -s "libzmq.1.dylib" "libzmq.1.0.0.dylib")
libtool: link: ar cru .libs/libzmq.a  libzmq_la-clock.o libzmq_la-command.o libzmq_la-ctx.o libzmq_la-connect_session.o libzmq_la-decoder.o libzmq_la-device.o libzmq_la-devpoll.o libzmq_la-dist.o libzmq_la-encoder.o libzmq_la-epoll.o libzmq_la-err.o libzmq_la-fq.o libzmq_la-io_object.o libzmq_la-io_thread.o libzmq_la-ip.o libzmq_la-kqueue.o libzmq_la-lb.o libzmq_la-mailbox.o libzmq_la-named_session.o libzmq_la-object.o libzmq_la-options.o libzmq_la-own.o libzmq_la-pair.o libzmq_la-pgm_receiver.o libzmq_la-pgm_sender.o libzmq_la-pgm_socket.o libzmq_la-pipe.o libzmq_la-poll.o libzmq_la-poller_base.o libzmq_la-pull.o libzmq_la-push.o libzmq_la-reaper.o libzmq_la-pub.o libzmq_la-rep.o libzmq_la-req.o libzmq_la-select.o libzmq_la-session.o libzmq_la-signaler.o libzmq_la-socket_base.o libzmq_la-sub.o libzmq_la-swap.o libzmq_la-tcp_connecter.o libzmq_la-tcp_listener.o libzmq_la-tcp_socket.o libzmq_la-thread.o libzmq_la-transient_session.o libzmq_la-trie.o libzmq_la-uuid.o libzmq_la-xpub.o libzmq_la-xrep.o libzmq_la-xreq.o libzmq_la-xsub.o libzmq_la-zmq.o libzmq_la-zmq_connecter.o libzmq_la-zmq_engine.o libzmq_la-zmq_init.o libzmq_la-zmq_listener.o
/usr/bin/ranlib: file: .libs/libzmq.a(libzmq_la-devpoll.o) has no symbols
/usr/bin/ranlib: file: .libs/libzmq.a(libzmq_la-epoll.o) has no symbols
/usr/bin/ranlib: file: .libs/libzmq.a(libzmq_la-pgm_receiver.o) has no symbols
/usr/bin/ranlib: file: .libs/libzmq.a(libzmq_la-pgm_sender.o) has no symbols
/usr/bin/ranlib: file: .libs/libzmq.a(libzmq_la-pgm_socket.o) has no symbols
libtool: link: ranlib .libs/libzmq.a
ranlib: file: .libs/libzmq.a(libzmq_la-devpoll.o) has no symbols
ranlib: file: .libs/libzmq.a(libzmq_la-epoll.o) has no symbols
ranlib: file: .libs/libzmq.a(libzmq_la-pgm_receiver.o) has no symbols
ranlib: file: .libs/libzmq.a(libzmq_la-pgm_sender.o) has no symbols
ranlib: file: .libs/libzmq.a(libzmq_la-pgm_socket.o) has no symbols
libtool: link: ( cd ".libs" && rm -f "libzmq.la" && ln -s "../libzmq.la" "libzmq.la" )
Making all in doc
make[3]: Nothing to be done for `all'.
Making all in perf
c++ -DHAVE_CONFIG_H -I. -I../src -I../include  -Wall -Wno-uninitialized -D_DARWIN_C_SOURCE -D_REENTRANT -D_THREAD_SAFE   -g -O2 -MT local_lat.o -MD -MP -MF .deps/local_lat.Tpo -c -o local_lat.o local_lat.cpp
mv -f .deps/local_lat.Tpo .deps/local_lat.Po
/bin/sh ../libtool --tag=CXX   --mode=link c++  -g -O2   -o local_lat local_lat.o ../src/libzmq.la -lpthread 
libtool: link: c++ -g -O2 -o .libs/local_lat local_lat.o -Wl,-bind_at_load  ../src/.libs/libzmq.1.0.0.dylib -lpthread
c++ -DHAVE_CONFIG_H -I. -I../src -I../include  -Wall -Wno-uninitialized -D_DARWIN_C_SOURCE -D_REENTRANT -D_THREAD_SAFE   -g -O2 -MT remote_lat.o -MD -MP -MF .deps/remote_lat.Tpo -c -o remote_lat.o remote_lat.cpp
mv -f .deps/remote_lat.Tpo .deps/remote_lat.Po
/bin/sh ../libtool --tag=CXX   --mode=link c++  -g -O2   -o remote_lat remote_lat.o ../src/libzmq.la -lpthread 
libtool: link: c++ -g -O2 -o .libs/remote_lat remote_lat.o -Wl,-bind_at_load  ../src/.libs/libzmq.1.0.0.dylib -lpthread
c++ -DHAVE_CONFIG_H -I. -I../src -I../include  -Wall -Wno-uninitialized -D_DARWIN_C_SOURCE -D_REENTRANT -D_THREAD_SAFE   -g -O2 -MT local_thr.o -MD -MP -MF .deps/local_thr.Tpo -c -o local_thr.o local_thr.cpp
mv -f .deps/local_thr.Tpo .deps/local_thr.Po
/bin/sh ../libtool --tag=CXX   --mode=link c++  -g -O2   -o local_thr local_thr.o ../src/libzmq.la -lpthread 
libtool: link: c++ -g -O2 -o .libs/local_thr local_thr.o -Wl,-bind_at_load  ../src/.libs/libzmq.1.0.0.dylib -lpthread
c++ -DHAVE_CONFIG_H -I. -I../src -I../include  -Wall -Wno-uninitialized -D_DARWIN_C_SOURCE -D_REENTRANT -D_THREAD_SAFE   -g -O2 -MT remote_thr.o -MD -MP -MF .deps/remote_thr.Tpo -c -o remote_thr.o remote_thr.cpp
mv -f .deps/remote_thr.Tpo .deps/remote_thr.Po
/bin/sh ../libtool --tag=CXX   --mode=link c++  -g -O2   -o remote_thr remote_thr.o ../src/libzmq.la -lpthread 
libtool: link: c++ -g -O2 -o .libs/remote_thr remote_thr.o -Wl,-bind_at_load  ../src/.libs/libzmq.1.0.0.dylib -lpthread
c++ -DHAVE_CONFIG_H -I. -I../src -I../include  -Wall -Wno-uninitialized -D_DARWIN_C_SOURCE -D_REENTRANT -D_THREAD_SAFE   -g -O2 -MT inproc_lat.o -MD -MP -MF .deps/inproc_lat.Tpo -c -o inproc_lat.o inproc_lat.cpp
mv -f .deps/inproc_lat.Tpo .deps/inproc_lat.Po
/bin/sh ../libtool --tag=CXX   --mode=link c++  -g -O2   -o inproc_lat inproc_lat.o ../src/libzmq.la -lpthread 
libtool: link: c++ -g -O2 -o .libs/inproc_lat inproc_lat.o -Wl,-bind_at_load  ../src/.libs/libzmq.1.0.0.dylib -lpthread
c++ -DHAVE_CONFIG_H -I. -I../src -I../include  -Wall -Wno-uninitialized -D_DARWIN_C_SOURCE -D_REENTRANT -D_THREAD_SAFE   -g -O2 -MT inproc_thr.o -MD -MP -MF .deps/inproc_thr.Tpo -c -o inproc_thr.o inproc_thr.cpp
mv -f .deps/inproc_thr.Tpo .deps/inproc_thr.Po
/bin/sh ../libtool --tag=CXX   --mode=link c++  -g -O2   -o inproc_thr inproc_thr.o ../src/libzmq.la -lpthread 
libtool: link: c++ -g -O2 -o .libs/inproc_thr inproc_thr.o -Wl,-bind_at_load  ../src/.libs/libzmq.1.0.0.dylib -lpthread
Making all in tests
c++ -DHAVE_CONFIG_H -I. -I../src -I../include  -Wall -Wno-uninitialized -D_DARWIN_C_SOURCE -D_REENTRANT -D_THREAD_SAFE   -g -O2 -MT test_pair_inproc.o -MD -MP -MF .deps/test_pair_inproc.Tpo -c -o test_pair_inproc.o test_pair_inproc.cpp
mv -f .deps/test_pair_inproc.Tpo .deps/test_pair_inproc.Po
/bin/sh ../libtool --tag=CXX   --mode=link c++  -g -O2   -o test_pair_inproc test_pair_inproc.o ../src/libzmq.la -lpthread 
libtool: link: c++ -g -O2 -o .libs/test_pair_inproc test_pair_inproc.o -Wl,-bind_at_load  ../src/.libs/libzmq.1.0.0.dylib -lpthread
c++ -DHAVE_CONFIG_H -I. -I../src -I../include  -Wall -Wno-uninitialized -D_DARWIN_C_SOURCE -D_REENTRANT -D_THREAD_SAFE   -g -O2 -MT test_pair_tcp.o -MD -MP -MF .deps/test_pair_tcp.Tpo -c -o test_pair_tcp.o test_pair_tcp.cpp
mv -f .deps/test_pair_tcp.Tpo .deps/test_pair_tcp.Po
/bin/sh ../libtool --tag=CXX   --mode=link c++  -g -O2   -o test_pair_tcp test_pair_tcp.o ../src/libzmq.la -lpthread 
libtool: link: c++ -g -O2 -o .libs/test_pair_tcp test_pair_tcp.o -Wl,-bind_at_load  ../src/.libs/libzmq.1.0.0.dylib -lpthread
c++ -DHAVE_CONFIG_H -I. -I../src -I../include  -Wall -Wno-uninitialized -D_DARWIN_C_SOURCE -D_REENTRANT -D_THREAD_SAFE   -g -O2 -MT test_reqrep_inproc.o -MD -MP -MF .deps/test_reqrep_inproc.Tpo -c -o test_reqrep_inproc.o test_reqrep_inproc.cpp
mv -f .deps/test_reqrep_inproc.Tpo .deps/test_reqrep_inproc.Po
/bin/sh ../libtool --tag=CXX   --mode=link c++  -g -O2   -o test_reqrep_inproc test_reqrep_inproc.o ../src/libzmq.la -lpthread 
libtool: link: c++ -g -O2 -o .libs/test_reqrep_inproc test_reqrep_inproc.o -Wl,-bind_at_load  ../src/.libs/libzmq.1.0.0.dylib -lpthread
c++ -DHAVE_CONFIG_H -I. -I../src -I../include  -Wall -Wno-uninitialized -D_DARWIN_C_SOURCE -D_REENTRANT -D_THREAD_SAFE   -g -O2 -MT test_reqrep_tcp.o -MD -MP -MF .deps/test_reqrep_tcp.Tpo -c -o test_reqrep_tcp.o test_reqrep_tcp.cpp
mv -f .deps/test_reqrep_tcp.Tpo .deps/test_reqrep_tcp.Po
/bin/sh ../libtool --tag=CXX   --mode=link c++  -g -O2   -o test_reqrep_tcp test_reqrep_tcp.o ../src/libzmq.la -lpthread 
libtool: link: c++ -g -O2 -o .libs/test_reqrep_tcp test_reqrep_tcp.o -Wl,-bind_at_load  ../src/.libs/libzmq.1.0.0.dylib -lpthread
c++ -DHAVE_CONFIG_H -I. -I../src -I../include  -Wall -Wno-uninitialized -D_DARWIN_C_SOURCE -D_REENTRANT -D_THREAD_SAFE   -g -O2 -MT test_hwm.o -MD -MP -MF .deps/test_hwm.Tpo -c -o test_hwm.o test_hwm.cpp
mv -f .deps/test_hwm.Tpo .deps/test_hwm.Po
/bin/sh ../libtool --tag=CXX   --mode=link c++  -g -O2   -o test_hwm test_hwm.o ../src/libzmq.la -lpthread 
libtool: link: c++ -g -O2 -o .libs/test_hwm test_hwm.o -Wl,-bind_at_load  ../src/.libs/libzmq.1.0.0.dylib -lpthread
c++ -DHAVE_CONFIG_H -I. -I../src -I../include  -Wall -Wno-uninitialized -D_DARWIN_C_SOURCE -D_REENTRANT -D_THREAD_SAFE   -g -O2 -MT test_shutdown_stress.o -MD -MP -MF .deps/test_shutdown_stress.Tpo -c -o test_shutdown_stress.o test_shutdown_stress.cpp
mv -f .deps/test_shutdown_stress.Tpo .deps/test_shutdown_stress.Po
/bin/sh ../libtool --tag=CXX   --mode=link c++  -g -O2   -o test_shutdown_stress test_shutdown_stress.o ../src/libzmq.la -lpthread 
libtool: link: c++ -g -O2 -o .libs/test_shutdown_stress test_shutdown_stress.o -Wl,-bind_at_load  ../src/.libs/libzmq.1.0.0.dylib -lpthread
c++ -DHAVE_CONFIG_H -I. -I../src -I../include  -Wall -Wno-uninitialized -D_DARWIN_C_SOURCE -D_REENTRANT -D_THREAD_SAFE   -g -O2 -MT test_pair_ipc.o -MD -MP -MF .deps/test_pair_ipc.Tpo -c -o test_pair_ipc.o test_pair_ipc.cpp
mv -f .deps/test_pair_ipc.Tpo .deps/test_pair_ipc.Po
/bin/sh ../libtool --tag=CXX   --mode=link c++  -g -O2   -o test_pair_ipc test_pair_ipc.o ../src/libzmq.la -lpthread 
libtool: link: c++ -g -O2 -o .libs/test_pair_ipc test_pair_ipc.o -Wl,-bind_at_load  ../src/.libs/libzmq.1.0.0.dylib -lpthread
c++ -DHAVE_CONFIG_H -I. -I../src -I../include  -Wall -Wno-uninitialized -D_DARWIN_C_SOURCE -D_REENTRANT -D_THREAD_SAFE   -g -O2 -MT test_reqrep_ipc.o -MD -MP -MF .deps/test_reqrep_ipc.Tpo -c -o test_reqrep_ipc.o test_reqrep_ipc.cpp
mv -f .deps/test_reqrep_ipc.Tpo .deps/test_reqrep_ipc.Po
/bin/sh ../libtool --tag=CXX   --mode=link c++  -g -O2   -o test_reqrep_ipc test_reqrep_ipc.o ../src/libzmq.la -lpthread 
libtool: link: c++ -g -O2 -o .libs/test_reqrep_ipc test_reqrep_ipc.o -Wl,-bind_at_load  ../src/.libs/libzmq.1.0.0.dylib -lpthread
make[3]: Nothing to be done for `all-am'.
Compiled src/erlzmq_nif.erl
Compiled src/erlzmq.erl
Compiling c_src/erlzmq_nif.c
c_src/erlzmq_nif.c:24:17: error: zmq.h: No such file or directory
c_src/erlzmq_nif.c:70: error: expected specifier-qualifier-list before ‘zmq_msg_t’
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_context’:
c_src/erlzmq_nif.c:140: warning: implicit declaration of function ‘zmq_init’
c_src/erlzmq_nif.c:140: warning: assignment makes pointer from integer without a cast
c_src/erlzmq_nif.c:142: warning: implicit declaration of function ‘zmq_errno’
c_src/erlzmq_nif.c:147: warning: implicit declaration of function ‘zmq_socket’
c_src/erlzmq_nif.c:147: error: ‘ZMQ_PUSH’ undeclared (first use in this function)
c_src/erlzmq_nif.c:147: error: (Each undeclared identifier is reported only once
c_src/erlzmq_nif.c:147: error: for each function it appears in.)
c_src/erlzmq_nif.c:147: warning: assignment makes pointer from integer without a cast
c_src/erlzmq_nif.c:151: warning: implicit declaration of function ‘zmq_bind’
c_src/erlzmq_nif.c:152: warning: implicit declaration of function ‘zmq_close’
c_src/erlzmq_nif.c:154: warning: implicit declaration of function ‘zmq_term’
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_socket’:
c_src/erlzmq_nif.c:201: warning: assignment makes pointer from integer without a cast
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_connect’:
c_src/erlzmq_nif.c:273: warning: implicit declaration of function ‘zmq_connect’
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_setsockopt’:
c_src/erlzmq_nif.c:312: error: ‘ZMQ_HWM’ undeclared (first use in this function)
c_src/erlzmq_nif.c:313: error: ‘ZMQ_AFFINITY’ undeclared (first use in this function)
c_src/erlzmq_nif.c:314: error: ‘ZMQ_SNDBUF’ undeclared (first use in this function)
c_src/erlzmq_nif.c:315: error: ‘ZMQ_RCVBUF’ undeclared (first use in this function)
c_src/erlzmq_nif.c:323: error: ‘ZMQ_SWAP’ undeclared (first use in this function)
c_src/erlzmq_nif.c:324: error: ‘ZMQ_RATE’ undeclared (first use in this function)
c_src/erlzmq_nif.c:325: error: ‘ZMQ_RECOVERY_IVL’ undeclared (first use in this function)
c_src/erlzmq_nif.c:326: error: ‘ZMQ_MCAST_LOOP’ undeclared (first use in this function)
c_src/erlzmq_nif.c:334: error: ‘ZMQ_IDENTITY’ undeclared (first use in this function)
c_src/erlzmq_nif.c:335: error: ‘ZMQ_SUBSCRIBE’ undeclared (first use in this function)
c_src/erlzmq_nif.c:336: error: ‘ZMQ_UNSUBSCRIBE’ undeclared (first use in this function)
c_src/erlzmq_nif.c:344: error: ‘ZMQ_LINGER’ undeclared (first use in this function)
c_src/erlzmq_nif.c:345: error: ‘ZMQ_RECONNECT_IVL’ undeclared (first use in this function)
c_src/erlzmq_nif.c:346: error: ‘ZMQ_BACKLOG’ undeclared (first use in this function)
c_src/erlzmq_nif.c:358: warning: implicit declaration of function ‘zmq_setsockopt’
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_getsockopt’:
c_src/erlzmq_nif.c:391: error: ‘ZMQ_RCVMORE’ undeclared (first use in this function)
c_src/erlzmq_nif.c:392: error: ‘ZMQ_SWAP’ undeclared (first use in this function)
c_src/erlzmq_nif.c:393: error: ‘ZMQ_RATE’ undeclared (first use in this function)
c_src/erlzmq_nif.c:394: error: ‘ZMQ_RECOVERY_IVL’ undeclared (first use in this function)
c_src/erlzmq_nif.c:395: error: ‘ZMQ_RECOVERY_IVL_MSEC’ undeclared (first use in this function)
c_src/erlzmq_nif.c:396: error: ‘ZMQ_MCAST_LOOP’ undeclared (first use in this function)
c_src/erlzmq_nif.c:399: warning: implicit declaration of function ‘zmq_getsockopt’
c_src/erlzmq_nif.c:408: error: ‘ZMQ_HWM’ undeclared (first use in this function)
c_src/erlzmq_nif.c:409: error: ‘ZMQ_AFFINITY’ undeclared (first use in this function)
c_src/erlzmq_nif.c:410: error: ‘ZMQ_SNDBUF’ undeclared (first use in this function)
c_src/erlzmq_nif.c:411: error: ‘ZMQ_RCVBUF’ undeclared (first use in this function)
c_src/erlzmq_nif.c:423: error: ‘ZMQ_IDENTITY’ undeclared (first use in this function)
c_src/erlzmq_nif.c:437: error: ‘ZMQ_TYPE’ undeclared (first use in this function)
c_src/erlzmq_nif.c:438: error: ‘ZMQ_LINGER’ undeclared (first use in this function)
c_src/erlzmq_nif.c:439: error: ‘ZMQ_RECONNECT_IVL’ undeclared (first use in this function)
c_src/erlzmq_nif.c:440: error: ‘ZMQ_RECONNECT_IVL_MAX’ undeclared (first use in this function)
c_src/erlzmq_nif.c:441: error: ‘ZMQ_BACKLOG’ undeclared (first use in this function)
c_src/erlzmq_nif.c:442: error: ‘ZMQ_FD’ undeclared (first use in this function)
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_send’:
c_src/erlzmq_nif.c:477: warning: implicit declaration of function ‘zmq_msg_init_size’
c_src/erlzmq_nif.c:477: error: ‘struct <anonymous>’ has no member named ‘msg’
c_src/erlzmq_nif.c:481: warning: implicit declaration of function ‘zmq_msg_data’
c_src/erlzmq_nif.c:481: error: ‘struct <anonymous>’ has no member named ‘msg’
c_src/erlzmq_nif.c:481: warning: passing argument 1 of ‘__builtin_object_size’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:481: error: ‘struct <anonymous>’ has no member named ‘msg’
c_src/erlzmq_nif.c:481: error: ‘struct <anonymous>’ has no member named ‘msg’
c_src/erlzmq_nif.c:481: warning: passing argument 1 of ‘__builtin_object_size’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:481: warning: passing argument 1 of ‘__builtin___memcpy_chk’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:481: error: ‘struct <anonymous>’ has no member named ‘msg’
c_src/erlzmq_nif.c:481: warning: passing argument 1 of ‘__inline_memcpy_chk’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:486: warning: implicit declaration of function ‘zmq_send’
c_src/erlzmq_nif.c:486: error: ‘struct <anonymous>’ has no member named ‘msg’
c_src/erlzmq_nif.c:487: error: ‘ZMQ_NOBLOCK’ undeclared (first use in this function)
c_src/erlzmq_nif.c:490: error: ‘EAGAIN’ undeclared (first use in this function)
c_src/erlzmq_nif.c:492: warning: implicit declaration of function ‘zmq_msg_close’
c_src/erlzmq_nif.c:492: error: ‘struct <anonymous>’ has no member named ‘msg’
c_src/erlzmq_nif.c:506: error: ‘struct <anonymous>’ has no member named ‘pid’
c_src/erlzmq_nif.c:509: error: ‘zmq_msg_t’ undeclared (first use in this function)
c_src/erlzmq_nif.c:509: error: expected ‘;’ before ‘msg’
c_src/erlzmq_nif.c:510: error: ‘msg’ undeclared (first use in this function)
c_src/erlzmq_nif.c:511: error: ‘struct <anonymous>’ has no member named ‘msg’
c_src/erlzmq_nif.c:516: warning: passing argument 1 of ‘__builtin_object_size’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:516: warning: passing argument 1 of ‘__builtin_object_size’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:516: warning: passing argument 1 of ‘__builtin___memcpy_chk’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:516: warning: passing argument 1 of ‘__inline_memcpy_chk’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:521: error: ‘ETERM’ undeclared (first use in this function)
c_src/erlzmq_nif.c:527: error: ‘struct <anonymous>’ has no member named ‘msg’
c_src/erlzmq_nif.c:542: error: ‘struct <anonymous>’ has no member named ‘msg’
c_src/erlzmq_nif.c:546: warning: control reaches end of non-void function
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_recv’:
c_src/erlzmq_nif.c:567: error: ‘zmq_msg_t’ undeclared (first use in this function)
c_src/erlzmq_nif.c:567: error: expected ‘;’ before ‘msg’
c_src/erlzmq_nif.c:568: warning: implicit declaration of function ‘zmq_msg_init’
c_src/erlzmq_nif.c:568: error: ‘msg’ undeclared (first use in this function)
c_src/erlzmq_nif.c:574: warning: implicit declaration of function ‘zmq_recv’
c_src/erlzmq_nif.c:574: error: ‘ZMQ_NOBLOCK’ undeclared (first use in this function)
c_src/erlzmq_nif.c:579: error: ‘EAGAIN’ undeclared (first use in this function)
c_src/erlzmq_nif.c:594: warning: passing argument 1 of ‘__builtin_object_size’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:594: warning: passing argument 1 of ‘__builtin_object_size’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:594: warning: passing argument 1 of ‘__builtin___memcpy_chk’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:594: warning: passing argument 1 of ‘__inline_memcpy_chk’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:599: error: ‘ETERM’ undeclared (first use in this function)
c_src/erlzmq_nif.c:622: warning: implicit declaration of function ‘zmq_msg_size’
c_src/erlzmq_nif.c:623: warning: passing argument 2 of ‘__builtin___memcpy_chk’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:623: warning: passing argument 2 of ‘__inline_memcpy_chk’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:630: warning: control reaches end of non-void function
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_close’:
c_src/erlzmq_nif.c:648: error: ‘zmq_msg_t’ undeclared (first use in this function)
c_src/erlzmq_nif.c:648: error: expected ‘;’ before ‘msg’
c_src/erlzmq_nif.c:649: error: ‘msg’ undeclared (first use in this function)
c_src/erlzmq_nif.c:654: warning: passing argument 1 of ‘__builtin_object_size’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:654: warning: passing argument 1 of ‘__builtin_object_size’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:654: warning: passing argument 1 of ‘__builtin___memcpy_chk’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:654: warning: passing argument 1 of ‘__inline_memcpy_chk’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:681: warning: control reaches end of non-void function
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_term’:
c_src/erlzmq_nif.c:698: error: ‘zmq_msg_t’ undeclared (first use in this function)
c_src/erlzmq_nif.c:698: error: expected ‘;’ before ‘msg’
c_src/erlzmq_nif.c:699: error: ‘msg’ undeclared (first use in this function)
c_src/erlzmq_nif.c:704: warning: passing argument 1 of ‘__builtin_object_size’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:704: warning: passing argument 1 of ‘__builtin_object_size’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:704: warning: passing argument 1 of ‘__builtin___memcpy_chk’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:704: warning: passing argument 1 of ‘__inline_memcpy_chk’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:720: warning: control reaches end of non-void function
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_version’:
c_src/erlzmq_nif.c:725: warning: implicit declaration of function ‘zmq_version’
c_src/erlzmq_nif.c: In function ‘polling_thread’:
c_src/erlzmq_nif.c:736: error: ‘ZMQ_PULL’ undeclared (first use in this function)
c_src/erlzmq_nif.c:736: warning: initialization makes pointer from integer without a cast
c_src/erlzmq_nif.c:742: error: ‘zmq_pollitem_t’ undeclared (first use in this function)
c_src/erlzmq_nif.c:745: error: expected ‘;’ before ‘thread_socket_poll_zmq’
c_src/erlzmq_nif.c:746: error: ‘thread_socket_poll_zmq’ undeclared (first use in this function)
c_src/erlzmq_nif.c:760: warning: implicit declaration of function ‘zmq_poll’
c_src/erlzmq_nif.c:760: error: expected expression before ‘)’ token
c_src/erlzmq_nif.c:763: error: expected expression before ‘)’ token
c_src/erlzmq_nif.c:767: error: ‘item’ undeclared (first use in this function)
c_src/erlzmq_nif.c:767: error: expected expression before ‘)’ token
c_src/erlzmq_nif.c:770: error: ‘ZMQ_POLLIN’ undeclared (first use in this function)
c_src/erlzmq_nif.c:777: error: ‘zmq_msg_t’ undeclared (first use in this function)
c_src/erlzmq_nif.c:777: error: expected ‘;’ before ‘msg’
c_src/erlzmq_nif.c:778: error: ‘msg’ undeclared (first use in this function)
c_src/erlzmq_nif.c:784: error: ‘ZMQ_RCVMORE’ undeclared (first use in this function)
c_src/erlzmq_nif.c:810: warning: passing argument 2 of ‘__builtin___memcpy_chk’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:810: warning: passing argument 2 of ‘__inline_memcpy_chk’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:852: error: ‘ZMQ_POLLOUT’ undeclared (first use in this function)
c_src/erlzmq_nif.c:858: error: ‘struct <anonymous>’ has no member named ‘msg’
c_src/erlzmq_nif.c:860: error: ‘struct <anonymous>’ has no member named ‘pid’
c_src/erlzmq_nif.c:866: error: ‘struct <anonymous>’ has no member named ‘pid’
c_src/erlzmq_nif.c:871: error: ‘struct <anonymous>’ has no member named ‘msg’
c_src/erlzmq_nif.c:883: error: expected expression before ‘)’ token
c_src/erlzmq_nif.c:884: error: expected expression before ‘)’ token
c_src/erlzmq_nif.c:885: error: expected ‘;’ before ‘msg’
c_src/erlzmq_nif.c:895: warning: cast to pointer from integer of different size
c_src/erlzmq_nif.c:897: error: expected ‘;’ before ‘item_zmq’
c_src/erlzmq_nif.c:899: error: ‘item_zmq’ undeclared (first use in this function)
c_src/erlzmq_nif.c:906: error: expected ‘;’ before ‘item_zmq’
c_src/erlzmq_nif.c:917: error: expected expression before ‘)’ token
c_src/erlzmq_nif.c:930: error: ‘struct <anonymous>’ has no member named ‘msg’
c_src/erlzmq_nif.c:973: error: ‘struct <anonymous>’ has no member named ‘msg’
c_src/erlzmq_nif.c: In function ‘add_active_req’:
c_src/erlzmq_nif.c:1019: error: ‘zmq_msg_t’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1019: error: expected ‘;’ before ‘msg’
c_src/erlzmq_nif.c:1020: error: ‘msg’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1025: warning: passing argument 1 of ‘__builtin_object_size’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:1025: warning: passing argument 1 of ‘__builtin_object_size’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:1025: warning: passing argument 1 of ‘__builtin___memcpy_chk’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:1025: warning: passing argument 1 of ‘__inline_memcpy_chk’ makes pointer from integer without a cast
c_src/erlzmq_nif.c:1038: warning: control reaches end of non-void function
c_src/erlzmq_nif.c: In function ‘return_zmq_errno’:
c_src/erlzmq_nif.c:1043: error: ‘EPERM’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1046: error: ‘ENOENT’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1049: error: ‘ESRCH’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1052: error: ‘EINTR’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1055: error: ‘EIO’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1058: error: ‘ENXIO’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1061: error: ‘ENOEXEC’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1064: error: ‘EBADF’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1067: error: ‘ECHILD’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1070: error: ‘EDEADLK’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1073: error: ‘ENOMEM’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1076: error: ‘EACCES’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1079: error: ‘EFAULT’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1082: error: ‘ENOTBLK’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1085: error: ‘EBUSY’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1088: error: ‘EEXIST’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1091: error: ‘EXDEV’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1094: error: ‘ENODEV’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1097: error: ‘ENOTDIR’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1100: error: ‘EISDIR’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1103: error: ‘EINVAL’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1106: error: ‘ENFILE’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1109: error: ‘EMFILE’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1112: error: ‘ETXTBSY’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1115: error: ‘EFBIG’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1118: error: ‘ENOSPC’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1121: error: ‘ESPIPE’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1124: error: ‘EROFS’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1127: error: ‘EMLINK’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1130: error: ‘EPIPE’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1133: error: ‘EAGAIN’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1136: error: ‘EINPROGRESS’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1139: error: ‘EALREADY’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1142: error: ‘ENOTSOCK’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1145: error: ‘EDESTADDRREQ’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1148: error: ‘EMSGSIZE’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1151: error: ‘EPROTOTYPE’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1154: error: ‘ENOPROTOOPT’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1157: error: ‘EPROTONOSUPPORT’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1160: error: ‘ESOCKTNOSUPPORT’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1163: error: ‘ENOTSUP’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1166: error: ‘EPFNOSUPPORT’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1169: error: ‘EAFNOSUPPORT’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1172: error: ‘EADDRINUSE’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1175: error: ‘EADDRNOTAVAIL’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1178: error: ‘ENETDOWN’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1181: error: ‘ENETUNREACH’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1184: error: ‘ENETRESET’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1187: error: ‘ECONNABORTED’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1190: error: ‘ECONNRESET’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1193: error: ‘ENOBUFS’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1196: error: ‘EISCONN’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1199: error: ‘ENOTCONN’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1202: error: ‘ESHUTDOWN’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1205: error: ‘ETOOMANYREFS’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1208: error: ‘ETIMEDOUT’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1211: error: ‘ECONNREFUSED’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1214: error: ‘ELOOP’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1217: error: ‘ENAMETOOLONG’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1220: error: ‘ZMQ_HAUSNUMERO’ undeclared (first use in this function)
ERROR: $CC -c $CFLAGS $DRV_CFLAGS c_src/erlzmq_nif.c -o c_src/erlzmq_nif.o failed with error: 1

active mode assumes self() should receive all responses

Active mode currently assumes that self() during the erlzmq2 function execution is what wants to receive the active mode responses, which is normal based on other Erlang "active" message handling. However, when self() should not receive the responses, it is best to have something like a controlling_process concept (e.g., Erlang sockets). For the erlzmq2 API, an option to socket/2 of "{active_pid, Pid}" makes the most sense, and would then imply "{active, true}". This should help anyone doing active mode erlzmq2 usage for message handling with short-lived processes (due to garbage collection concerns).

Compiling zeromq library fails

I got an error when trying to compile my app. When installing the erlzmq2 dependency, it failed.

Here is the error log:
==> Entering directory ../releases/20160603075854/broker/deps/erlzmq' ==> erlzmq (compile) make[1]: Entering directory../releases/20160603075854/broker/deps/erlzmq/c_src'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 414 0 414 0 0 704 0 --:--:-- --:--:-- --:--:-- 706- --:--:-- --:--:-- 0

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
make[1]: *** [../deps/zeromq3] Error 2
make[1]: Leaving directory `../releases/20160603075854/broker/deps/erlzmq/c_src'
ERROR: Command [compile] failed!
make:
*** [deps] Error 1

After checking, the Makefile was fetching zeromq from http://download.zeromq.org/zeromq-$(ZEROMQ_VERSION).tar.gz, but it seems like that URL is gone.

Even on the official site, it doesn't link to that URL anymore: https://zeromq.github.io/zeromq3-x/

Can NOT clone ..

Hey guys ..

I just wanted to clone erlzmq2, but it gives me 404 page !!

git clone git://github.com/zeromq/erlzmq2.git
Cloning into erlzmq2...
github.com[0: 207.97.227.239]: errno=Connection timed out
fatal: unable to connect a socket (Connection timed out)

Would you please check this out ??

Rename module to zmq

This is not really an "issue".

I also realize it's a big suggestion/request. But the "erl" prefix on the module name (used only within Erlang) is superfluous and, while certainly not horrible, could be dropped to make the API that much more compact.

erlzmq:connect(...) // twitch, twitch

zmq:connect(...) // ahhhh

rebar get-deps fails

[...]
Pulling ezmq2 from {git,"git://github.com/zeromq/erlzmq2"}
Cloning into 'ezmq2'...
ERROR: Dependency dir [...]/ezmq2 failed application validation with reason:
{name_mismatch,{"[...]/deps/ezmq2/src/erlzmq.app.src",
{expected,ezmq2},
{has,erlzmq}}}.

make zeromq compilation optional

Please add a way to compile the extension against an already compiled zeromq library, I am really afraid of basing any serious work on this library currently thinking of the nightmare it would be to deploy it in production.
In my cas I will already have a compiled zeromq somewhere on the system and I would rather uses it instead of recompiling it after pulling it from github :s

(for me a production server would not have git and worse it may not even have any direct internet access)

Exception style error handling instead of tagged values

This is another thought coming out of my work on the examples. It's annoyingly an API breakage, but straight forward to implement in erlzmq.erl (I'm happy to tackle it).

Ideally, you don't want to see a lot of this in Erlang code:

{ok, Foo} = blah(),
ok = foo(),
ok = bar()

This pattern reflects Erlang's "tagged value" convention of using {ok, Good} and {error, Bad}. There are tons of core libraries that use this convention, esp the socket APIs, which 0MQ is similar to. So, the way erlzmq is designed today is perfectly consistent with lots in Erlang.

But, I think it would be better to adopt the exception handling pattern, in which values are returned untagged and exceptions are generated for errors. The idea is that, for calls that are expected to succeed, just return the value and let exceptions propagate. You get the same fail fast benefit of pattern matching without the unnecessary and distracting artifacts.

A good illustration of this distinction is dict:find/2 vs dict:fetch2, which shows there are reasonable cases to support both patterns.

But in erlzmq, nearly all of the function are of the "this should succeed, else crash" variety.

This code is much better IMO:

Context = erlzmq:context(),
Socket = erlzmq:socket(Context, sub),
erlzmq:bind(Socket, "..."),
erlzmq:send(Socket, <<"hi">>),
erlzmq:close(Socket),
erlzmq:term(Context).

Errors can still be checked elegantly using the "try of" form of exception handling, which provides the same isolation in error checking as matching tagged values in a case statement.

What's good about this:

  • Code is simpler and easier to read
  • It will catch errors in cases where the dev forgot to match on "ok" (a common source of bugs in Erlang apps)

What's bad about this:

  • API breakage
  • Inconsistent with other socket style APIs in Erlang
  • More work

Personally, I think "cleaner code" and "less bugs" win over the other points (assuming there's still some wiggle room on API changes). As far as the work, I volunteer :)

Compilation error on SunOS

Trying to run make on sunos results in the following:

Compiling c_src/erlzmq_nif.c
c_src/erlzmq_nif.c:40:3: error: expected specifier-qualifier-list before 'int64_t'
c_src/erlzmq_nif.c:51:3: error: expected specifier-qualifier-list before 'int64_t'
c_src/erlzmq_nif.c: In function 'erlzmq_nif_context':
c_src/erlzmq_nif.c:149:10: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:150:3: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:153:31: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:160:10: error: 'erlzmq_context_t' has no member named 'socket_index'
c_src/erlzmq_nif.c:163:54: error: 'erlzmq_context_t' has no member named 'polling_tid'
c_src/erlzmq_nif.c: In function 'erlzmq_nif_socket':
c_src/erlzmq_nif.c:200:9: error: 'erlzmq_socket_t' has no member named 'socket_index'
c_src/erlzmq_nif.c:200:33: error: 'erlzmq_context_t' has no member named 'socket_index'
c_src/erlzmq_nif.c:201:9: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:202:14: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:205:9: error: 'erlzmq_socket_t' has no member named 'active'
c_src/erlzmq_nif.c:206:9: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:207:3: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:209:10: error: 'erlzmq_socket_t' has no member named 'socket_index'
c_src/erlzmq_nif.c: In function 'erlzmq_nif_bind':
c_src/erlzmq_nif.c:234:25: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:235:22: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:236:29: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:241:29: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:243:15: error: 'erlzmq_socket_t' has no member named 'active'
c_src/erlzmq_nif.c: In function 'erlzmq_nif_connect':
c_src/erlzmq_nif.c:272:25: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:273:25: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:274:29: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:279:29: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:281:15: error: 'erlzmq_socket_t' has no member named 'active'
c_src/erlzmq_nif.c: In function 'erlzmq_nif_setsockopt':
c_src/erlzmq_nif.c:320:27: error: 'int64_t' undeclared (first use in this function)
c_src/erlzmq_nif.c:320:27: note: each undeclared identifier is reported only once for each function it appears in
c_src/erlzmq_nif.c:357:25: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:358:28: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:360:29: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:364:29: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c: In function 'erlzmq_nif_getsockopt':
c_src/erlzmq_nif.c:384:3: error: 'int64_t' undeclared (first use in this function)
c_src/erlzmq_nif.c:384:11: error: expected ';' before 'value_int64'
c_src/erlzmq_nif.c:385:11: error: expected ';' before 'value_uint64'
c_src/erlzmq_nif.c:397:29: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:398:32: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:399:27: error: 'value_int64' undeclared (first use in this function)
c_src/erlzmq_nif.c:400:33: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:403:31: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:411:29: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:412:32: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:413:27: error: 'value_uint64' undeclared (first use in this function)
c_src/erlzmq_nif.c:414:33: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:417:31: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:422:29: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:423:32: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:425:33: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:428:31: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:440:29: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:441:32: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:443:33: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:446:31: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c: In function 'erlzmq_nif_send':
c_src/erlzmq_nif.c:480:15: error: 'erlzmq_socket_t' has no member named 'active'
c_src/erlzmq_nif.c:481:27: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:482:24: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:484:31: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:493:31: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:514:36: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:516:40: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:520:40: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:528:40: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c: In function 'erlzmq_nif_recv':
c_src/erlzmq_nif.c:558:13: error: 'erlzmq_socket_t' has no member named 'active'
c_src/erlzmq_nif.c:569:25: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:570:22: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:571:29: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:592:36: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:594:40: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:598:40: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:605:40: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:615:29: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c: In function 'erlzmq_nif_close':
c_src/erlzmq_nif.c:652:34: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:655:27: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:657:21: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:658:29: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:659:30: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:661:38: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:665:38: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:671:38: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c: In function 'erlzmq_nif_term':
c_src/erlzmq_nif.c:702:26: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:704:30: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:710:30: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c: In function 'polling_thread':
c_src/erlzmq_nif.c:767:35: error: 'int64_t' undeclared (first use in this function)
c_src/erlzmq_nif.c:768:17: error: expected ';' before 'flag_value'
c_src/erlzmq_nif.c:775:44: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:776:41: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:778:33: error: 'erlzmq_socket_t' has no member named 'active'
c_src/erlzmq_nif.c:779:47: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:780:35: error: 'flag_value' undeclared (first use in this function)
c_src/erlzmq_nif.c:782:48: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:783:34: error: 'erlzmq_socket_t' has no member named 'active'
c_src/erlzmq_nif.c:785:15: error: 'erlzmq_socket_t' has no member named 'socket_index'
c_src/erlzmq_nif.c:801:48: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:809:32: error: 'erlzmq_socket_t' has no member named 'active'
c_src/erlzmq_nif.c:820:13: error: 'erlzmq_socket_t' has no member named 'socket_index'
c_src/erlzmq_nif.c:852:44: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:853:41: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:855:48: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:861:48: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:883:30: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:885:32: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:893:55: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:902:55: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:914:51: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:940:45: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:941:39: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:942:47: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:943:48: error: 'erlzmq_socket_t' has no member named 'mutex'
c_src/erlzmq_nif.c:954:32: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:958:34: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:966:46: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:972:46: error: 'erlzmq_socket_t' has no member named 'socket_zmq'
c_src/erlzmq_nif.c:976:32: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:979:34: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:981:32: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:982:34: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c:983:35: error: 'erlzmq_context_t' has no member named 'mutex'
c_src/erlzmq_nif.c: In function 'add_active_req':
c_src/erlzmq_nif.c:1006:9: error: 'erlzmq_socket_t' has no member named 'active'
c_src/erlzmq_nif.c: In function 'erlzmq_nif_recv':
c_src/erlzmq_nif.c:626:1: warning: control reaches end of non-void function
c_src/erlzmq_nif.c: In function 'erlzmq_nif_setsockopt':
c_src/erlzmq_nif.c:367:1: warning: control reaches end of non-void function
c_src/erlzmq_nif.c: In function 'erlzmq_nif_connect':
c_src/erlzmq_nif.c:288:1: warning: control reaches end of non-void function
c_src/erlzmq_nif.c: In function 'erlzmq_nif_bind':
c_src/erlzmq_nif.c:250:1: warning: control reaches end of non-void function
c_src/erlzmq_nif.c: In function 'erlzmq_nif_socket':
c_src/erlzmq_nif.c:212:1: warning: control reaches end of non-void function
ERROR: $CC -c $CFLAGS $DRV_CFLAGS c_src/erlzmq_nif.c -o c_src/erlzmq_nif.o failed with error: 1
make: *** [compile] Error 1

ZMQ_Version method

It would be great to have the possibility to check the version of ZMQ library. Helps when debugging in heterogeneous environments...

Error with make bench

$ make bench
==> erlzmq2 (compile)
make[1]: Nothing to be done for `all'.
Running benchmarks, this could take some time...
Traceback (most recent call last):
  File "./perf/perfgraphs.py", line 89, in <module>
    TestRun(100, 1, 100000).plot_thr()
  File "./perf/perfgraphs.py", line 54, in plot_thr
    self.msgcount, False)
  File "./perf/perfgraphs.py", line 21, in thr_run
    results.append(float(out.split('\n')[2].split(' ')[2]))
ValueError: could not convert string to float: in
make: *** [bench] Error 1

make bench never finishes

Using debian testing. Just cloned erlzmq2.
I started "make bench". Left it overnight, about 15 hours. It did not finish.
I interrupted with control-c. Got following output:

bertd@beam-dev:~/erlzmq2$ make bench
==> erlzmq2 (compile)
make[1]: Entering directory /home/bertd/erlzmq2/c_src' make[1]: Nothing to be done forall'.
make[1]: Leaving directory `/home/bertd/erlzmq2/c_src'
Running benchmarks, this could take some time...
^CTraceback (most recent call last):
File "./perf/perfgraphs.py", line 89, in
TestRun(100, 1, 100000).plot_thr()
File "./perf/perfgraphs.py", line 56, in plot_thr
self.msgcount, True)
File "./perf/perfgraphs.py", line 20, in thr_run
out = do_test(localcmd, remotecmd)[0]
File "./perf/perfgraphs.py", line 9, in do_test
local.wait()
File "/usr/lib/python2.7/subprocess.py", line 1291, in wait
pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0)
File "/usr/lib/python2.7/subprocess.py", line 478, in _eintr_retry_call
return func(args)
KeyboardInterrupt
make: *
* [bench] Error 1

Problem building on Mountain Lion

Using homebrew. I'm getting:

puzza@Pauls-MacBookPro ~/src/erlzmq2 (master) $ make
==> erlzmq2 (compile)
Cloning into '../deps/zeromq2'...
v2.1.11
Note: checking out 'v2.1.11'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b new_branch_name

HEAD is now at 73f167e... Updated NEWS for 2.1.11
autoreconf: Entering directory `.'
autoreconf: configure.in: not using Gettext
autoreconf: running: aclocal -I config --force -I config
aclocal: warning: autoconf input should be named 'configure.ac', not 'configure.in'
configure.in:13: error: 'AM_CONFIG_HEADER': this macro is obsolete.
You should use the 'AC_CONFIG_HEADERS' macro instead.
/usr/local/Cellar/automake/1.13.1/share/aclocal-1.13/obsolete-err.m4:14: AM_CONFIG_HEADER is expanded from...
configure.in:13: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: error: echo failed with exit status: 1
autoreconf: aclocal failed with exit status: 1
autogen.sh: error: autoreconf exited with status 0
make[1]: *** [../deps/zeromq2/src/.libs/libzmq.a] Error 1
ERROR: Command [compile] failed!
make: *** [compile] Error 1

Compilation Error on Ubuntu

erl -version
Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 5.7.4

uname -a
Linux Dulds 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

==> erlzmq2 (compile)
make[1]: Entering directory /home/dulds/Projects/zeromq2.1/erlzmq2/c_src' autoreconf: Entering directory.'
autoreconf: configure.in: not using Gettext
autoreconf: running: aclocal -I config --force -I config
autoreconf: configure.in: tracing
autoreconf: configure.in: subdirectory foreign/openpgm/build-staging/openpgm/pgm/ not present
autoreconf: running: libtoolize --install --copy --force
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, config'. libtoolize: copying fileconfig/config.guess'
libtoolize: copying file config/config.sub' libtoolize: copying fileconfig/install-sh'
libtoolize: copying file config/ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIR,config'.
libtoolize: copying file config/libtool.m4' libtoolize: copying fileconfig/ltoptions.m4'
libtoolize: copying file config/ltsugar.m4' libtoolize: copying fileconfig/ltversion.m4'
libtoolize: copying file config/lt~obsolete.m4' autoreconf: running: /usr/bin/autoconf --include=config --force autoreconf: running: /usr/bin/autoheader --include=config --force autoreconf: running: automake --add-missing --copy --force-missing autoreconf: Leaving directory.'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking for gcc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of cc... gcc3
checking for cc option to accept ISO C99... -std=gnu99
checking whether we are using the GNU C++ compiler... yes
checking whether c++ accepts -g... yes
checking dependency style of c++... gcc3
checking whether cc -std=gnu99 and cc understand -c and -o together... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... (cached) mawk
checking for xmlto... no
checking for asciidoc... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a sed that does not truncate output... (cached) /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by cc -std=gnu99... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 3458764513820540925
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from cc -std=gnu99 object... ok
checking how to run the C preprocessor... cc -std=gnu99 -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether c++ accepts -g... (cached) yes
checking dependency style of c++... (cached) gcc3
checking how to run the C++ preprocessor... c++ -E
checking for objdir... .libs
checking if cc -std=gnu99 supports -fno-rtti -fno-exceptions... no
checking for cc -std=gnu99 option to produce PIC... -fPIC -DPIC
checking if cc -std=gnu99 PIC flag -fPIC -DPIC works... yes
checking if cc -std=gnu99 static flag -static works... yes
checking if cc -std=gnu99 supports -c -o file.o... yes
checking if cc -std=gnu99 supports -c -o file.o... (cached) yes
checking whether the cc -std=gnu99 linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for ld used by c++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the c++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for c++ option to produce PIC... -fPIC -DPIC
checking if c++ PIC flag -fPIC -DPIC works... yes
checking if c++ static flag -static works... yes
checking if c++ supports -c -o file.o... yes
checking if c++ supports -c -o file.o... (cached) yes
checking whether the c++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether the C compiler works... yes
checking whether we are using Intel C compiler... no
checking whether we are using Sun Studio C compiler... no
checking whether we are using clang C compiler... no
checking whether we are using gcc >= 4 C compiler... yes
checking whether the C++ compiler works... yes
checking whether we are using Intel C++ compiler... no
checking whether we are using Sun Studio C++ compiler... no
checking whether we are using clang C++ compiler... no
checking whether we are using gcc >= 4 C++ compiler... yes
checking whether to enable debugging information... no
checking whether to enable code coverage... no
checking for pthread_create in -lpthread... yes
checking for sem_init in -lrt... yes
checking for uuid_generate in -luuid... yes
checking whether C++ compiler supports -fvisibility=hidden... yes
checking whether C++ compiler supports dso visibility... yes
checking for asciidoc... no
checking for xmlto... no
configure: WARNING: You are building an unreleased version of 0MQ and asciidoc or xmlto are not installed.
configure: WARNING: Documentation will not be built and manual pages will not be installed.
checking whether to build documentation... no
checking whether to install manpages... no
checking for ANSI C header files... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netinet/tcp.h usability... yes
checking netinet/tcp.h presence... yes
checking for netinet/tcp.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking ifaddrs.h usability... yes
checking ifaddrs.h presence... yes
checking for ifaddrs.h... yes
checking for stdbool.h that conforms to C99... yes
checking for Bool... no
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for size_t... yes
checking for ssize_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for uint32_t... yes
checking for working volatile... yes
checking how to enable additional warnings for C++ compiler... -Wall
checking how to turn warnings to errors in C++ compiler... -Werror
checking how to enable strict standards compliance in C++ compiler... -pedantic
checking return type of signal handlers... void
checking for perror... yes
checking for gettimeofday... yes
checking for memset... yes
checking for socket... yes
checking for getifaddrs... yes
checking for freeifaddrs... yes
checking alloca.h usability... yes
checking alloca.h presence... yes
checking for alloca.h... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating doc/Makefile
config.status: creating perf/Makefile
config.status: creating src/libzmq.pc
config.status: creating builds/msvc/Makefile
config.status: creating tests/Makefile
config.status: creating foreign/openpgm/Makefile
config.status: creating builds/redhat/zeromq.spec
config.status: creating src/platform.hpp
config.status: src/platform.hpp is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
make[2]: Entering directory /home/dulds/Projects/zeromq2.1/erlzmq2/deps/zeromq2' Making all in src make[3]: Entering directory/home/dulds/Projects/zeromq2.1/erlzmq2/deps/zeromq2/src'
make all-am
make[4]: Entering directory /home/dulds/Projects/zeromq2.1/erlzmq2/deps/zeromq2/src' CXX libzmq_la-clock.lo CXX libzmq_la-command.lo CXX libzmq_la-ctx.lo CXX libzmq_la-connect_session.lo CXX libzmq_la-decoder.lo CXX libzmq_la-device.lo CXX libzmq_la-devpoll.lo CXX libzmq_la-dist.lo CXX libzmq_la-encoder.lo CXX libzmq_la-epoll.lo CXX libzmq_la-err.lo CXX libzmq_la-fq.lo CXX libzmq_la-io_object.lo CXX libzmq_la-io_thread.lo CXX libzmq_la-ip.lo CXX libzmq_la-kqueue.lo CXX libzmq_la-lb.lo CXX libzmq_la-mailbox.lo CXX libzmq_la-named_session.lo CXX libzmq_la-object.lo CXX libzmq_la-options.lo CXX libzmq_la-own.lo CXX libzmq_la-pair.lo CXX libzmq_la-pgm_receiver.lo CXX libzmq_la-pgm_sender.lo CXX libzmq_la-pgm_socket.lo CXX libzmq_la-pipe.lo CXX libzmq_la-poll.lo CXX libzmq_la-poller_base.lo CXX libzmq_la-pull.lo CXX libzmq_la-push.lo CXX libzmq_la-reaper.lo CXX libzmq_la-pub.lo CXX libzmq_la-rep.lo CXX libzmq_la-req.lo CXX libzmq_la-select.lo CXX libzmq_la-session.lo CXX libzmq_la-signaler.lo CXX libzmq_la-socket_base.lo CXX libzmq_la-sub.lo CXX libzmq_la-swap.lo CXX libzmq_la-tcp_connecter.lo CXX libzmq_la-tcp_listener.lo CXX libzmq_la-tcp_socket.lo CXX libzmq_la-thread.lo CXX libzmq_la-transient_session.lo CXX libzmq_la-trie.lo CXX libzmq_la-uuid.lo CXX libzmq_la-xpub.lo CXX libzmq_la-xrep.lo CXX libzmq_la-xreq.lo CXX libzmq_la-xsub.lo CXX libzmq_la-zmq.lo CXX libzmq_la-zmq_connecter.lo CXX libzmq_la-zmq_engine.lo CXX libzmq_la-zmq_init.lo CXX libzmq_la-zmq_listener.lo CXXLD libzmq.la make[4]: Leaving directory/home/dulds/Projects/zeromq2.1/erlzmq2/deps/zeromq2/src'
make[3]: Leaving directory /home/dulds/Projects/zeromq2.1/erlzmq2/deps/zeromq2/src' Making all in doc make[3]: Entering directory/home/dulds/Projects/zeromq2.1/erlzmq2/deps/zeromq2/doc'
make[3]: Nothing to be done for all'. make[3]: Leaving directory/home/dulds/Projects/zeromq2.1/erlzmq2/deps/zeromq2/doc'
Making all in perf
make[3]: Entering directory /home/dulds/Projects/zeromq2.1/erlzmq2/deps/zeromq2/perf' CXX local_lat.o CXXLD local_lat CXX remote_lat.o CXXLD remote_lat CXX local_thr.o CXXLD local_thr CXX remote_thr.o CXXLD remote_thr CXX inproc_lat.o CXXLD inproc_lat CXX inproc_thr.o CXXLD inproc_thr make[3]: Leaving directory/home/dulds/Projects/zeromq2.1/erlzmq2/deps/zeromq2/perf'
Making all in tests
make[3]: Entering directory /home/dulds/Projects/zeromq2.1/erlzmq2/deps/zeromq2/tests' CXX test_pair_inproc.o CXXLD test_pair_inproc CXX test_pair_tcp.o CXXLD test_pair_tcp CXX test_reqrep_inproc.o CXXLD test_reqrep_inproc CXX test_reqrep_tcp.o CXXLD test_reqrep_tcp CXX test_hwm.o CXXLD test_hwm CXX test_shutdown_stress.o CXXLD test_shutdown_stress CXX test_pair_ipc.o CXXLD test_pair_ipc CXX test_reqrep_ipc.o CXXLD test_reqrep_ipc make[3]: Leaving directory/home/dulds/Projects/zeromq2.1/erlzmq2/deps/zeromq2/tests'
make[3]: Entering directory /home/dulds/Projects/zeromq2.1/erlzmq2/deps/zeromq2' make[3]: Nothing to be done forall-am'.
make[3]: Leaving directory /home/dulds/Projects/zeromq2.1/erlzmq2/deps/zeromq2' make[2]: Leaving directory/home/dulds/Projects/zeromq2.1/erlzmq2/deps/zeromq2'
make[1]: Leaving directory `/home/dulds/Projects/zeromq2.1/erlzmq2/c_src'
Compiled src/erlzmq_nif.erl
Compiled src/erlzmq.erl
Compiling c_src/erlzmq_nif.c
c_src/erlzmq_nif.c:33:26: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘
’ token
c_src/erlzmq_nif.c:34:26: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘_’ token
c_src/erlzmq_nif.c:41:3: error: expected specifier-qualifier-list before ‘ErlNifTid’
c_src/erlzmq_nif.c:54:3: error: expected specifier-qualifier-list before ‘ErlNifMutex’
c_src/erlzmq_nif.c:71:7: error: expected specifier-qualifier-list before ‘ErlNifPid’
c_src/erlzmq_nif.c:78:7: error: expected specifier-qualifier-list before ‘ErlNifPid’
c_src/erlzmq_nif.c:84:7: error: expected specifier-qualifier-list before ‘ErlNifPid’
c_src/erlzmq_nif.c:89:7: error: expected specifier-qualifier-list before ‘ErlNifPid’
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_context’:
c_src/erlzmq_nif.c:137:3: warning: implicit declaration of function ‘enif_alloc_resource’
c_src/erlzmq_nif.c:137:52: error: ‘erlzmq_nif_resource_context’ undeclared (first use in this function)
c_src/erlzmq_nif.c:137:52: note: each undeclared identifier is reported only once for each function it appears in
c_src/erlzmq_nif.c:149:10: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:149:3: warning: implicit declaration of function ‘enif_mutex_create’
c_src/erlzmq_nif.c:150:3: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:153:5: warning: implicit declaration of function ‘enif_mutex_destroy’
c_src/erlzmq_nif.c:153:31: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:155:5: warning: implicit declaration of function ‘enif_release_resource’
c_src/erlzmq_nif.c:162:3: warning: implicit declaration of function ‘enif_thread_create’
c_src/erlzmq_nif.c:163:54: error: ‘erlzmq_context_t’ has no member named ‘polling_tid’
c_src/erlzmq_nif.c:173:3: warning: implicit declaration of function ‘enif_make_tuple2’
c_src/erlzmq_nif.c:174:27: warning: implicit declaration of function ‘enif_make_resource’
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_socket’:
c_src/erlzmq_nif.c:183:3: warning: implicit declaration of function ‘enif_get_resource’
c_src/erlzmq_nif.c:183:41: error: ‘erlzmq_nif_resource_context’ undeclared (first use in this function)
c_src/erlzmq_nif.c:196:50: error: ‘erlzmq_nif_resource_socket’ undeclared (first use in this function)
c_src/erlzmq_nif.c:206:9: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:207:3: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:210:27: warning: implicit declaration of function ‘enif_make_uint64’
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_bind’:
c_src/erlzmq_nif.c:219:41: error: ‘erlzmq_nif_resource_socket’ undeclared (first use in this function)
c_src/erlzmq_nif.c:224:3: warning: implicit declaration of function ‘enif_get_list_length’
c_src/erlzmq_nif.c:229:3: warning: implicit declaration of function ‘enif_get_string’
c_src/erlzmq_nif.c:230:25: error: ‘ERL_NIF_LATIN1’ undeclared (first use in this function)
c_src/erlzmq_nif.c:234:3: warning: implicit declaration of function ‘enif_mutex_lock’
c_src/erlzmq_nif.c:234:25: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:236:5: warning: implicit declaration of function ‘enif_mutex_unlock’
c_src/erlzmq_nif.c:236:29: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:241:29: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_connect’:
c_src/erlzmq_nif.c:257:41: error: ‘erlzmq_nif_resource_socket’ undeclared (first use in this function)
c_src/erlzmq_nif.c:268:25: error: ‘ERL_NIF_LATIN1’ undeclared (first use in this function)
c_src/erlzmq_nif.c:272:25: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:274:29: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:279:29: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_setsockopt’:
c_src/erlzmq_nif.c:295:41: error: ‘erlzmq_nif_resource_socket’ undeclared (first use in this function)
c_src/erlzmq_nif.c:304:3: error: ‘ErlNifUInt64’ undeclared (first use in this function)
c_src/erlzmq_nif.c:304:16: error: expected ‘;’ before ‘value_uint64’
c_src/erlzmq_nif.c:305:3: error: ‘ErlNifSInt64’ undeclared (first use in this function)
c_src/erlzmq_nif.c:305:16: error: expected ‘;’ before ‘value_int64’
c_src/erlzmq_nif.c:316:7: warning: implicit declaration of function ‘enif_get_uint64’
c_src/erlzmq_nif.c:316:44: error: ‘value_uint64’ undeclared (first use in this function)
c_src/erlzmq_nif.c:327:7: warning: implicit declaration of function ‘enif_get_int64’
c_src/erlzmq_nif.c:327:43: error: ‘value_int64’ undeclared (first use in this function)
c_src/erlzmq_nif.c:337:7: warning: implicit declaration of function ‘enif_inspect_iolist_as_binary’
c_src/erlzmq_nif.c:357:25: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:360:29: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:364:29: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_getsockopt’:
c_src/erlzmq_nif.c:374:41: error: ‘erlzmq_nif_resource_socket’ undeclared (first use in this function)
c_src/erlzmq_nif.c:397:29: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:400:33: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:403:31: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:405:31: warning: implicit declaration of function ‘enif_make_int64’
c_src/erlzmq_nif.c:411:29: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:414:33: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:417:31: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:422:29: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:425:33: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:428:31: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:429:7: warning: passing argument 1 of ‘enif_alloc_binary’ makes pointer from integer without a cast
/usr/lib/erlang/erts-5.7.4/include/erl_nif_api_funcs.h:30:1: note: expected ‘struct ErlNifEnv *’ but argument is of type ‘size_t’
c_src/erlzmq_nif.c:429:7: warning: passing argument 2 of ‘enif_alloc_binary’ makes integer from pointer without a cast
/usr/lib/erlang/erts-5.7.4/include/erl_nif_api_funcs.h:30:1: note: expected ‘unsigned int’ but argument is of type ‘struct ErlNifBinary *’
c_src/erlzmq_nif.c:429:7: error: too few arguments to function ‘enif_alloc_binary’
/usr/lib/erlang/erts-5.7.4/include/erl_nif_api_funcs.h:30:1: note: declared here
c_src/erlzmq_nif.c:440:29: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:443:33: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:446:31: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_send’:
c_src/erlzmq_nif.c:460:41: error: ‘erlzmq_nif_resource_socket’ undeclared (first use in this function)
c_src/erlzmq_nif.c:481:27: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:484:31: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:493:31: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:500:5: warning: implicit declaration of function ‘enif_alloc_env’
c_src/erlzmq_nif.c:500:23: warning: assignment makes pointer from integer without a cast
c_src/erlzmq_nif.c:501:5: warning: implicit declaration of function ‘enif_make_ref’
c_src/erlzmq_nif.c:502:5: warning: implicit declaration of function ‘enif_self’
c_src/erlzmq_nif.c:502:34: error: ‘struct ’ has no member named ‘pid’
c_src/erlzmq_nif.c:508:7: warning: implicit declaration of function ‘enif_free_env’
c_src/erlzmq_nif.c:514:36: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:516:40: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:520:40: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:528:40: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:532:7: warning: implicit declaration of function ‘enif_keep_resource’
c_src/erlzmq_nif.c:534:7: warning: implicit declaration of function ‘enif_make_copy’
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_recv’:
c_src/erlzmq_nif.c:549:41: error: ‘erlzmq_nif_resource_socket’ undeclared (first use in this function)
c_src/erlzmq_nif.c:569:25: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:571:29: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:580:23: warning: assignment makes pointer from integer without a cast
c_src/erlzmq_nif.c:582:34: error: ‘struct ’ has no member named ‘pid’
c_src/erlzmq_nif.c:592:36: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:594:40: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:598:40: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:605:40: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:615:29: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:618:5: warning: passing argument 1 of ‘enif_alloc_binary’ makes pointer from integer without a cast
/usr/lib/erlang/erts-5.7.4/include/erl_nif_api_funcs.h:30:1: note: expected ‘struct ErlNifEnv *’ but argument is of type ‘size_t’
c_src/erlzmq_nif.c:618:5: warning: passing argument 2 of ‘enif_alloc_binary’ makes integer from pointer without a cast
/usr/lib/erlang/erts-5.7.4/include/erl_nif_api_funcs.h:30:1: note: expected ‘unsigned int’ but argument is of type ‘struct ErlNifBinary *’
c_src/erlzmq_nif.c:618:5: error: too few arguments to function ‘enif_alloc_binary’
/usr/lib/erlang/erts-5.7.4/include/erl_nif_api_funcs.h:30:1: note: declared here
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_close’:
c_src/erlzmq_nif.c:632:41: error: ‘erlzmq_nif_resource_socket’ undeclared (first use in this function)
c_src/erlzmq_nif.c:639:22: warning: assignment makes pointer from integer without a cast
c_src/erlzmq_nif.c:641:33: error: ‘struct ’ has no member named ‘pid’
c_src/erlzmq_nif.c:652:34: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:655:27: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:658:29: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:659:30: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:661:38: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:665:38: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:671:38: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_term’:
c_src/erlzmq_nif.c:683:40: error: ‘erlzmq_nif_resource_context’ undeclared (first use in this function)
c_src/erlzmq_nif.c:690:21: warning: assignment makes pointer from integer without a cast
c_src/erlzmq_nif.c:692:32: error: ‘struct ’ has no member named ‘pid’
c_src/erlzmq_nif.c:702:26: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:704:30: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:710:30: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_version’:
c_src/erlzmq_nif.c:722:3: warning: implicit declaration of function ‘enif_make_tuple3’
c_src/erlzmq_nif.c: In function ‘polling_thread’:
c_src/erlzmq_nif.c:775:44: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:782:48: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:784:13: warning: implicit declaration of function ‘enif_send’
c_src/erlzmq_nif.c:784:42: error: ‘struct ’ has no member named ‘pid’
c_src/erlzmq_nif.c:793:30: warning: assignment makes pointer from integer without a cast
c_src/erlzmq_nif.c:801:48: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:805:9: warning: passing argument 1 of ‘enif_alloc_binary’ makes pointer from integer without a cast
/usr/lib/erlang/erts-5.7.4/include/erl_nif_api_funcs.h:30:1: note: expected ‘struct ErlNifEnv *’ but argument is of type ‘size_t’
c_src/erlzmq_nif.c:805:9: warning: passing argument 2 of ‘enif_alloc_binary’ makes integer from pointer without a cast
/usr/lib/erlang/erts-5.7.4/include/erl_nif_api_funcs.h:30:1: note: expected ‘unsigned int’ but argument is of type ‘struct ErlNifBinary *’
c_src/erlzmq_nif.c:805:9: error: too few arguments to function ‘enif_alloc_binary’
/usr/lib/erlang/erts-5.7.4/include/erl_nif_api_funcs.h:30:1: note: declared here
c_src/erlzmq_nif.c:814:13: warning: implicit declaration of function ‘enif_make_list1’
c_src/erlzmq_nif.c:819:40: error: ‘struct ’ has no member named ‘pid’
c_src/erlzmq_nif.c:820:13: warning: implicit declaration of function ‘enif_make_tuple4’
c_src/erlzmq_nif.c:829:28: warning: assignment makes pointer from integer without a cast
c_src/erlzmq_nif.c:833:40: error: ‘struct ’ has no member named ‘pid’
c_src/erlzmq_nif.c:852:44: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:855:48: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:856:40: error: ‘struct ’ has no member named ‘pid’
c_src/erlzmq_nif.c:861:48: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:862:40: error: ‘struct ’ has no member named ‘pid’
c_src/erlzmq_nif.c:883:30: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:885:32: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:918:15: warning: implicit declaration of function ‘enif_clear_env’
c_src/erlzmq_nif.c:940:45: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:942:47: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:943:48: error: ‘erlzmq_socket_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:946:39: error: ‘struct ’ has no member named ‘pid’
c_src/erlzmq_nif.c:954:32: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:958:34: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:976:32: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:979:34: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:981:32: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:982:34: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:983:35: error: ‘erlzmq_context_t’ has no member named ‘mutex’
c_src/erlzmq_nif.c:986:38: error: ‘struct ’ has no member named ‘pid’
c_src/erlzmq_nif.c: In function ‘add_active_req’:
c_src/erlzmq_nif.c:1010:21: warning: assignment makes pointer from integer without a cast
c_src/erlzmq_nif.c:1012:32: error: ‘struct ’ has no member named ‘pid’
c_src/erlzmq_nif.c: In function ‘on_load’:
c_src/erlzmq_nif.c:1260:3: error: ‘erlzmq_nif_resource_context’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1261:5: warning: implicit declaration of function ‘enif_open_resource_type’
c_src/erlzmq_nif.c:1264:29: error: ‘ERL_NIF_RT_CREATE’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1264:49: error: ‘ERL_NIF_RT_TAKEOVER’ undeclared (first use in this function)
c_src/erlzmq_nif.c:1266:3: error: ‘erlzmq_nif_resource_socket’ undeclared (first use in this function)
ERROR: $CC -c $CFLAGS $DRV_CFLAGS c_src/erlzmq_nif.c -o c_src/erlzmq_nif.o failed with error: 1

When using a timeout when calling erlzmq:recv () can lose a message

If the messages in the queue at the time of the call is not, but it it appears after the timeout, it is lost
This occurs because the timeout is implemented using receive ... after, and the message that it is obtained when the timeout has passed, there is no one to accept the message, and it remains in the queue process

(a similar situation with erlzmq:send (), but it returns {error, eagain}, even though the message was sent)

test case:

zmq_recv_error() ->
{ok, C} = erlzmq:context(),
{ok, BS} = erlzmq:socket(C, [pull]),
ok = erlzmq:setsockopt(BS, rcvtimeo, 1000),
ok = erlzmq:bind(BS, "tcp://127.0.0.1:5555"),
spawn_link(
fun() ->
{ok, C2} = erlzmq:context(),
{ok, CS2} = erlzmq:socket(C2, [push]),
ok = erlzmq:connect(CS2, "tcp://127.0.0.1:5555"),
timer:sleep(1500),
ok = erlzmq:send(CS2, <<"some data">>),
ok = erlzmq:close(CS2),
ok = erlzmq:term(C2)
end),
case erlzmq:recv(BS) of
{error, eagain} ->
io:format("error:pn", [eagain]),
case erlzmq:recv(BS) of
{error, eagain} ->
io:format("error:pn", [eagain]),
io:format("~nERROR!n");
{ok, Data} ->
io:format("data:pn", [Data]),
io:format("nOKn")
end;
{ok, Data} ->
io:format("data:pn", [Data]),
io:format("OK
n")
end.

problem with building erlzmq2 on MacOs

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

erlzmq_nif_resource_socket - enif_release_resource

Why you have no enif_release_resource function for the erlzmq_nif_resource_socket?
ZeroMQ does not free socket descriptor on Erlang process crash and I get core dump with "Too many open files" error.

fails to clone

i m working on ubuntu linux and behind squid proxy.
im getting following error while cloning, please help

root $ git clone git://github.com/worldforge/hammer.git
Cloning into hammer...
github.com[0: 207.97.227.239]: errno=Connection timed out
fatal: unable to connect a socket (Connection timed out)

i have also tried "git clone https://github.com/worldforge/hammer.git", then it gives error

error: while accessing https://github.com/worldforge/hammer.git/info/refs
fatal: HTTP request failed

do i need to set "username:password@proxy_address" somewhere?
please help

Problem compiling in Alpine Linux

When trying to compile in Alpine Linux I am getting a compile error.

How to reproduce the issue?

Create an Alpine Linux base image for compilation, use this Dockerfile

FROM alpine:edge
ENV MIX_HOME=/opt/mix PATH=/opt/mix:${PATH}

RUN apk upgrade && apk upgrade \
  && apk --no-cache add git curl build-base \
  && apk --no-cache add zeromq-dev erlang-dev elixir erlang-crypto \
  && git clone https://github.com/zeromq/erlzmq2.git /opt/erlzmq2 \
  && mix local.rebar --force \
  && cd /opt/erlzmq2 \
  && make

Build the image with:

docker build -t test/zmq .

What I am getting

make[1]: Leaving directory '/opt/erlzmq2/c_src'
ERROR: compile failed while processing /opt/erlzmq2: {'EXIT',{undef,[{erl_syntax,type,[{attribute,2,module,erlzmq_nif}],[]},
                {rebar_erlc_compiler,parse_attrs,2,
                                     [{file,"src/rebar_erlc_compiler.erl"},
                                      {line,619}]},
                {rebar_erlc_compiler,modify_erlcinfo,4,
                                     [{file,"src/rebar_erlc_compiler.erl"},
                                      {line,451}]},
                {rebar_erlc_compiler,'-update_erlcinfo_fun/2-fun-0-',4,
                                     [{file,"src/rebar_erlc_compiler.erl"},
                                      {line,401}]},
                {lists,foldl,3,[{file,"lists.erl"},{line,1263}]},
                {rebar_erlc_compiler,init_erlcinfo,2,
                                     [{file,"src/rebar_erlc_compiler.erl"},
                                      {line,391}]},
                {rebar_erlc_compiler,doterl_compile,4,
                                     [{file,"src/rebar_erlc_compiler.erl"},
                                      {line,302}]},
                {rebar_core,run_modules,4,
                            [{file,"src/rebar_core.erl"},{line,493}]}]}}
make: *** [Makefile:6: compile] Error 1

I will expect it to compile, maybe a dependency is not present? I cannot see what library is looking for.

Unit tests crash emulator on fresh checkout

First off, thanks for writing erlzmq2. I have big plans for this app :)

When I do a fresh checkout and build via 'make && make test' I get the following crash:

==> erlzmq2 (compile)
==> erlzmq2 (eunit)
Assertion failed: nbytes == sizeof (command_t) (mailbox.cpp:194)
Assertion failed: false (object.cpp:128)
make: *** [test] Abort trap

This is on a late-2009 MBP w/latest Snow Leopard. My Erlang environment is a 64 bit SMP-enabled build of R14B03. Yurii had asked me to look at my ulimit and set it to 1200. I checked and my default ulimit is 10k:

perdido:erlzmq2 ksmith$ ulimit -n
10000

I'm getting the same failure on my fork with the rebar build fixes, too, so it could be environmental or something not getting detected correctly as part of the build.

polling thread is never joined

From the Erlang documentation for erl_drv_thread_create via enif_thread_create1:

Warning

All created threads need to be joined by the driver before it is unloaded.
If the driver fails to join all threads created before it is unloaded, the
runtime system will most likely crash when the code of the driver is unloaded.

I am not entirely sure if this warning applies to enif_thread_create as well, but the documentation seems to indicate that it would. I wanted to see if you had any feedback before I try to patch the code to support joining the polling thread. I think it will be useful when adding upgrade support to the erlzmq and erlzmq_nif modules.

erlzmq bind failed

On my laptop(Ubuntu 12.04 32bit) I tried to run erlzmq. I opened the erl shell, and tried this:

{ok, Context} = erlzmq:context().

It returned

{ok,<<>>}

Something was not right here: the Context were just empty bits!
Then I continued:

{ok, Responder} = erlzmq:socket(Context, rep).
erlzmq:bind(Responder, "tcp://*5555").

here came the error when the last statement was executed:

{error, einval}

How such error happened?

erlang:halt/1 is broken

We're looking to create an Erlang crash dump, by erlang:halt("Whoops").

However, instead of creating the crash dump, the Erlang VM dies hard with the following:

Bad file descriptor (epoll.cpp:69)
Aborted

This appears to be in deps/erlzmq/deps/zeromq3/src/epoll.cpp, from zeromq-3.2.2.tar.gz.

This happens on Ubuntu and Mac OS X.

Make fails: Compiling c_src/erlzmq_nif.c

I have just cloned the repository and started make with following error (GCC version included at the bottom):

==> erlzmq2 (compile)
Compiled src/erlzmq_nif.erl
Compiled src/erlzmq.erl
Compiling c_src/erlzmq_nif.c
In file included from c_src/erlzmq_nif.c:26:
c_src/vector.h:44: error: conflicting types for ‘size_t’
/usr/lib/gcc/i686-linux-gnu/4.4.5/include/stddef.h:211: note: previous declaration of ‘size_t’ was here
c_src/erlzmq_nif.c: In function ‘erlzmq_nif_getsockopt’:
c_src/erlzmq_nif.c:393: warning: passing argument 4 of ‘zmq_getsockopt’ from incompatible pointer type
deps/zeromq2/include/zmq.h:217: note: expected ‘size_t ’ but argument is of type ‘size_t *’
c_src/erlzmq_nif.c:407: warning: passing argument 4 of ‘zmq_getsockopt’ from incompatible pointer type
deps/zeromq2/include/zmq.h:217: note: expected ‘size_t *’ but argument is of type ‘size_t *’
c_src/erlzmq_nif.c:418: warning: passing argument 4 of ‘zmq_getsockopt’ from incompatible pointer type
deps/zeromq2/include/zmq.h:217: note: expected ‘size_t *’ but argument is of type ‘size_t *’
c_src/erlzmq_nif.c:436: warning: passing argument 4 of ‘zmq_getsockopt’ from incompatible pointer type
deps/zeromq2/include/zmq.h:217: note: expected ‘size_t *’ but argument is of type ‘size_t *’
ERROR: $CC -c $CFLAGS $DRV_CFLAGS c_src/erlzmq_nif.c -o c_src/erlzmq_nif.o failed with error: 1
make: *
* [compile] Error 1
mile@mile-Mr-Gamer-HD5770-X4:/erlzmq2$ gcc
gcc: no input files
mile@mile-Mr-Gamer-HD5770-X4:
/erlzmq2$ gcc --version
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5

I Couldn't find any tags to get an older version for comparison, so I can't tell if a change in my system affected the outcome. 2 weeks ago the current version built just fine.

error on non SMP VM

On a VM with SMP disable it happens to see the following error that causes the immediate termination of the VM itself.
This happens using 2 sockets (one push one sub) belonging to 2 different contexts.

enif_send: env==NULL on non-SMP VM[1]    3494 abort

VM on which the error occurs

Erlang R14B02 (erts-5.8.3) [source] [rq:1] [async-threads:0] [hipe] [kernel-poll:false]

error seems to come from the emulator https://github.com/erlang/otp/blob/dev/erts/emulator/beam/erl_nif.c#L318

erlzmq:term/1 does not release memory

Dear all,
I encountered a problem with regarding memory handle in erlzmq2.
Please kindly see the bleow:

-module(context_openClose).
-export(ctx_oc/0).

ctx_oc()->
    {ok, Context} = erlzmq:context(),
    io:format("*** erlzmq:term/1 return ~p ***~n",[erlzmq:term(Context)]).

start erl shell and run the following command

lists:foreach(fun(I)-> context_openClose:ctx_oc(), io:format("[~3..0B] ------~n",[I]), timer:sleep(1500)            end, 
    lists:seq(1,500)
        ).
...
*** erlzmq:term/1 return ok ***
[289] ------
** exception error: no match of right hand side value {error,enomem}
     in function  context_openClose:ctx_oc/0
     in call from erl_eval:do_apply/5
     in call from erl_eval:exprs/5
     in call from lists:foreach/2
----------------------------------------------------------------

It seems that erlzmq:term/1 does not release memory.
Any suggestion will be appreciated.

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.