Neopallium / lua-zmq

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

luarocks install lua-zmq 1.0-1 fails #2

Closed agladysh closed 13 years ago

agladysh commented 13 years ago
$ sudo luarocks install lua-zmq
Installing http://luarocks.org/repositories/rocks/lua-zmq-1.0-1.src.rock...
Archive:  /tmp/luarocks_luarocks-rock-lua-zmq-1.0-1-8861/lua-zmq-1.0-1.src.rock
  inflating: lua-zmq-1.0-1.rockspec  
   creating: lua-zmq/
  inflating: lua-zmq/CMakeLists.txt  
   creating: lua-zmq/cmake/
  inflating: lua-zmq/cmake/LuaNativeObjects.cmake  
   creating: lua-zmq/perf/
  inflating: lua-zmq/perf/remote_thr.lua  
  inflating: lua-zmq/perf/remote_lat.lua  
  inflating: lua-zmq/perf/local_lat.lua  
   creating: lua-zmq/perf/no_msg/
  inflating: lua-zmq/perf/no_msg/remote_thr.lua  
  inflating: lua-zmq/perf/no_msg/remote_lat.lua  
  inflating: lua-zmq/perf/no_msg/local_lat.lua  
  inflating: lua-zmq/perf/no_msg/local_thr.lua  
  inflating: lua-zmq/perf/thread_push_pull.lua  
  inflating: lua-zmq/perf/local_pull.lua  
  inflating: lua-zmq/perf/thread_lat.lua  
  inflating: lua-zmq/perf/remote_multipart.lua  
  inflating: lua-zmq/perf/local_thr.lua  
  inflating: lua-zmq/perf/local_multipart.lua  
  inflating: lua-zmq/perf/thread_thr.lua  
  inflating: lua-zmq/perf/remote_push.lua  
  inflating: lua-zmq/zmq.nobj.lua    
  inflating: lua-zmq/API.md          
   creating: lua-zmq/examples/
  inflating: lua-zmq/examples/server_multipart.lua  
  inflating: lua-zmq/examples/publiser.lua  
  inflating: lua-zmq/examples/server.lua  
  inflating: lua-zmq/examples/client.lua  
  inflating: lua-zmq/examples/client_multipart.lua  
  inflating: lua-zmq/examples/ev_subscriber.lua  
  inflating: lua-zmq/examples/subscriber.lua  
   creating: lua-zmq/rockspecs/
  inflating: lua-zmq/rockspecs/lua-zmq-scm-1.rockspec  
  inflating: lua-zmq/rockspecs/lua-zmq-threads-1.0-1.rockspec  
  inflating: lua-zmq/rockspecs/lua-zmq-threads-scm-0.rockspec  
  inflating: lua-zmq/rockspecs/lua-zmq-1.0-1.rockspec  
  inflating: lua-zmq/README.md       
   creating: lua-zmq/src/
  inflating: lua-zmq/src/ctx.nobj.lua  
  inflating: lua-zmq/src/socket.nobj.lua  
  inflating: lua-zmq/src/msg.nobj.lua  
  inflating: lua-zmq/src/error.nobj.lua  
  inflating: lua-zmq/src/pre_generated-zmq.nobj.c  
  inflating: lua-zmq/src/threads.lua  
  inflating: lua-zmq/src/poller.lua  
  inflating: lua-zmq/src/poller.nobj.lua  
gcc -O2 -fPIC -I/usr/include/lua5.1 -c src/pre_generated-zmq.nobj.c -o src/pre_generated-zmq.nobj.o -I/usr/include
src/pre_generated-zmq.nobj.c:1856: error: expected declaration specifiers or ‘...’ before ‘socket_t’
src/pre_generated-zmq.nobj.c: In function ‘poller_find_fd_item’:
src/pre_generated-zmq.nobj.c:1865: error: ‘fd’ undeclared (first use in this function)
src/pre_generated-zmq.nobj.c:1865: error: (Each undeclared identifier is reported only once
src/pre_generated-zmq.nobj.c:1865: error: for each function it appears in.)
src/pre_generated-zmq.nobj.c: In function ‘get_zmq_strerror’:
src/pre_generated-zmq.nobj.c:1995: error: ‘ETERM’ undeclared (first use in this function)
src/pre_generated-zmq.nobj.c: In function ‘ZMQ_Socket__setopt__meth’:
src/pre_generated-zmq.nobj.c:2304: error: ‘ZMQ_RCVMORE’ undeclared (first use in this function)
src/pre_generated-zmq.nobj.c: In function ‘ZMQ_Socket__getopt__meth’:
src/pre_generated-zmq.nobj.c:2374: error: ‘ZMQ_RCVMORE’ undeclared (first use in this function)
src/pre_generated-zmq.nobj.c: In function ‘ZMQ_Poller__add__meth’:
src/pre_generated-zmq.nobj.c:2590: error: ‘socket_t’ undeclared (first use in this function)
src/pre_generated-zmq.nobj.c:2590: error: expected ‘;’ before ‘fd’
src/pre_generated-zmq.nobj.c:2595: error: ‘fd’ undeclared (first use in this function)
src/pre_generated-zmq.nobj.c: In function ‘ZMQ_Poller__modify__meth’:
src/pre_generated-zmq.nobj.c:2616: error: ‘socket_t’ undeclared (first use in this function)
src/pre_generated-zmq.nobj.c:2616: error: expected ‘;’ before ‘fd’
src/pre_generated-zmq.nobj.c:2623: error: ‘fd’ undeclared (first use in this function)
src/pre_generated-zmq.nobj.c:2625: error: too many arguments to function ‘poller_find_fd_item’
src/pre_generated-zmq.nobj.c: In function ‘ZMQ_Poller__remove__meth’:
src/pre_generated-zmq.nobj.c:2651: error: ‘socket_t’ undeclared (first use in this function)
src/pre_generated-zmq.nobj.c:2651: error: expected ‘;’ before ‘fd’
src/pre_generated-zmq.nobj.c:2660: error: ‘fd’ undeclared (first use in this function)
src/pre_generated-zmq.nobj.c:2662: error: too many arguments to function ‘poller_find_fd_item’
src/pre_generated-zmq.nobj.c: In function ‘zmq__init__func’:
src/pre_generated-zmq.nobj.c:2813: error: too few arguments to function ‘zmq_init’

Error: Build error: Failed compiling object src/pre_generated-zmq.nobj.o

$ uname -a
Linux ubuntu 2.6.35-28-generic #49-Ubuntu SMP Tue Mar 1 14:40:58 UTC 2011 i686 GNU/Linux

$ gcc --version
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5

$ luarocks --version
luarocks 2.0.4.1

$ dpkg -s libzmq-dev
Package: libzmq-dev
Status: install ok installed
Priority: optional
Section: libdevel
Installed-Size: 996
Maintainer: Ubuntu Developers 
Architecture: i386
Source: zeromq
Version: 2.0.6beta.dfsg-2
Depends: libzmq0 (= 2.0.6beta.dfsg-2)
Description: Development files and static library for the ZeroMQ library
 The 0MQ lightweight messaging kernel is a library which extends the
 standard socket interfaces with features traditionally provided by
 specialised messaging middleware products. 0MQ sockets provide an
 abstraction of asynchronous message queues, multiple messaging
 patterns, message filtering (subscriptions), seamless access to
 multiple transport protocols and more.
 .
 This package contains ZeroMQ related development libraries and header files.
Original-Maintainer: Adrian von Bidder 
Homepage: http://www.zeromq.org/
Neopallium commented 13 years ago

looks like luarocks is not finding the ZeroMQ headers.

Neopallium commented 13 years ago

oops, didn't mean to close it.

Neopallium commented 13 years ago

also you should be using ZeroMQ 2.1.x, the ZeroMQ devs don't recomend 2.0.x.

agladysh commented 13 years ago

It is not Luarocks — or it would not allow build to begin.

It is gcc — and it is strange, since there is -I/usr/include in the command line, and there is zmq.h there.

Can I provide you any additional diagnostics?

agladysh commented 13 years ago

Ah, one more Ubuntu packet to install manually... :-(

Neopallium commented 13 years ago

oh, I think I know what the problem is.

Neopallium commented 13 years ago

ZeroMQ 2.0 doesn't define socket_t

agladysh commented 13 years ago

Is this hard to fix?

Neopallium commented 13 years ago

should be fixed now, install from: https://github.com/Neopallium/lua-zmq/raw/master/rockspecs/lua-zmq-scm-1.rockspec

agladysh commented 13 years ago

Halfway there:

$ sudo luarocks install https://github.com/Neopallium/lua-zmq/raw/master/rockspecs/lua-zmq-scm-1.rockspec
Cloning into lua-zmq...
remote: Counting objects: 106, done.
remote: Compressing objects: 100% (104/104), done.
remote: Total 106 (delta 61), reused 3 (delta 0)
Receiving objects: 100% (106/106), 58.69 KiB, done.
Resolving deltas: 100% (61/61), done.
gcc -O2 -fPIC -I/usr/include/lua5.1 -c src/pre_generated-zmq.nobj.c -o src/pre_generated-zmq.nobj.o
src/pre_generated-zmq.nobj.c: In function ‘get_zmq_strerror’:
src/pre_generated-zmq.nobj.c:1993: error: ‘ETERM’ undeclared (first use in this function)
src/pre_generated-zmq.nobj.c:1993: error: (Each undeclared identifier is reported only once
src/pre_generated-zmq.nobj.c:1993: error: for each function it appears in.)
src/pre_generated-zmq.nobj.c: In function ‘ZMQ_Socket__setopt__meth’:
src/pre_generated-zmq.nobj.c:2302: error: ‘ZMQ_RCVMORE’ undeclared (first use in this function)
src/pre_generated-zmq.nobj.c: In function ‘ZMQ_Socket__getopt__meth’:
src/pre_generated-zmq.nobj.c:2372: error: ‘ZMQ_RCVMORE’ undeclared (first use in this function)
src/pre_generated-zmq.nobj.c: In function ‘zmq__init__func’:
src/pre_generated-zmq.nobj.c:2811: error: too few arguments to function ‘zmq_init’

Error: Build error: Failed compiling object src/pre_generated-zmq.nobj.o
Neopallium commented 13 years ago

hmm, I think your version of 2.0.6beta is too old. ZMQ_RCVMORE is needed, and I don't know what the replacement is for 2.0.6.

The latest 2.0 is 2.0.11.

Neopallium commented 13 years ago

same, with ETERM. You might have a beta release from the 2.0.x series.

agladysh commented 13 years ago

That is what Ubuntu 10.10 has packed in.

Since this is a common configuration, I suggest you to detect it in source and emit an #error.

agladysh commented 13 years ago

I will try with more recent 2.1 as soon as I find suitable .deb for it.

Neopallium commented 13 years ago

See here for how to get a newer version of zmq on ubuntu http://fanf42.blogspot.com/2011/02/installing-zeromq-and-java-bindings-on.html

I will see about adding a version check to the code.

Neopallium commented 13 years ago

ok, can you test my old version detection code? It should now raise a compile error saying that the ZeroMQ version is too old. The 2.0.x series doesn't have ZMQ_VERSION, so I had to just add a test for ZMQ_RCVMORE.

agladysh commented 13 years ago
gcc -O2 -fPIC -I/usr/include/lua5.1 -c src/pre_generated-zmq.nobj.c -o src/pre_generated-zmq.nobj.o
src/pre_generated-zmq.nobj.c:1745: error: #error "Your version of ZeroMQ is too, old."

I do not think that you need a comma there.

Also, consider listing minimal required version and where to get it.

Neopallium commented 13 years ago

One problem with listing minimal version is that I don't know which of the 2.0.x will work with the bindings. I will try to add some kind of version note to the readme.

Anyways thanks for testing that.

agladysh commented 13 years ago

Fix confirmed, with libzmq 2.1.x rock installs fine (libzmq-dev_2.1.4-1chl1~maverick1_i386.deb).

Can you please release a stable version with this fix?

agladysh commented 13 years ago

BTW, Thank you very much for the support!

Neopallium commented 13 years ago

I will maybe do a new point release next week, this week-end is going to be busy for me.

re-opening as a reminder.

agladysh commented 13 years ago

About the minimal version in the error message: you can specify recommended instead.

agladysh commented 13 years ago

OK, thank you!