Neopallium / lua-zmq

Lua zeromq2 binding
http://github.com/Neopallium/lua-zmq
MIT License
153 stars 36 forks source link

installation error on Ubuntu14.04 LTS #54

Open yf13 opened 9 years ago

yf13 commented 9 years ago

Hi,

I have zeromq 4.1.2 installed under "/usr/local/" folder and C and Python samples already working.

Then I installed lua packages:

[u@ubuntu:~]$ dpkg -l | fgrep lua | awk '{print $1,$2}'
ii liblua5.1-0:amd64
ii liblua5.1-0-dev:amd64
ii libluajit-5.1-2:amd64
ii libluajit-5.1-common
ii libluajit-5.1-dev:amd64
ii lua5.1
ii lua5.2
ii luajit
ii luarocks

But when I follow the installation guide of this 0MQ Lua binding, I got errors like

[u@ubuntu:~]$ sudo luarocks install lua-zmq
...
gcc -O2 -fPIC -I/usr/include/lua5.1 -c src/pre_generated-zmq.nobj.c -o src/pre_generated-zmq.nobj.o -I/usr/local/include
src/pre_generated-zmq.nobj.c: In function ‘simple_zmq_send’:
src/pre_generated-zmq.nobj.c:1966:3: error: too few arguments to function ‘zmq_send’
   err = zmq_send(sock, &msg, flags);
...
In file included from src/pre_generated-zmq.nobj.c:14:0:
/usr/local/include/zmq.h:355:16: note: declared here
 ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
                ^
Error: Build error: Failed compiling object src/pre_generated-zmq.nobj.o

Is there anything wrong?

Regards, yanfeng

yf13 commented 9 years ago

I am wondering this is by design since ZeroMQ 4.x was not mentioned in this project's installation guide.... If so, I will close this ticket soon.

Regards, yanfeng

JoostvDoorn commented 8 years ago

ZeroMQ 4.x is supported as per a335ef06256146637e81e4d034be08c93b6f724b, but it doesn't work with the latest version of ZeroMQ.

LoloTheDude commented 8 years ago

I also have trouble trying building lua-zmq with ZeroMQ 4.1.4. It seems that monitor event interface changed in 4.x and that broke bindings (see this and this) In my case, first error to show-up it due to zmq_event_t that doesn't exist any more in zmq headers. So I guess it requires real work to get it ported to 4.1.x.

Regards, Laurent

arthur-s commented 7 years ago

Same error while installing on CentOS 7 ("Failed compiling object src/pre_generated-zmq.nobj.o")

senisioi commented 7 years ago

It's not compatible with the latest version. You need to:

wget https://github.com/zeromq/zeromq2-x/releases/download/v2.1.11/zeromq-2.1.11.tar.gz && \
    tar -xvf zeromq-2.1.11.tar.gz && cd zeromq-2.1.11 && \
    ./configure && make && \ 
    make install && sudo ldconfig

luarocks install lua-zmq ZEROMQ_LIBDIR=/usr/local/lib ZEROMQ_INCDIR=/usr/local/include
agladysh commented 7 years ago

Any chance for getting support of modern ZMQ?

moteus commented 7 years ago

lzmq supports ZeroMQ 4.2.x :)

agladysh commented 7 years ago

This library is not dropin replacement for lua-zmq library.

@moteus The problem is that I have a legacy Lua module that I need to install. And it depends on lua-zmq...

moteus commented 7 years ago

I think it may be quite easy to write wrapper around lzmq to provide needed API.

agladysh commented 7 years ago

@moteus I would be very happy to have such a wrapper available ;)

moteus commented 7 years ago

Wrote wrapper for lzmq to be drop-in replacement for lua-zmq. https://github.com/moteus/lua-lzmq-zmq zthreads module from original lua-zmq also should be compatiabale with this library.