richardhundt / luv

libuv bindings for Lua
Apache License 2.0
118 stars 19 forks source link

Having some problems compiling under Debian 6.0 #16

Closed jpluscplusm closed 12 years ago

jpluscplusm commented 12 years ago

I'm probably missing something, but it appears to the untrained eye like the version of zmq that gets automatically pulled in is incompatible with luv. Or something.

What am I cocking up?

~/src/luv$ make CFLAGS="-I/usr/include/lua5.1" LIBS="-lm -llua5.1 -lzmq" git submodule update --init ./src/uv Submodule 'src/uv' (https://github.com/joyent/libuv.git) registered for path 'src/uv' Cloning into 'src/uv'... remote: Counting objects: 13299, done. remote: Compressing objects: 100% (3464/3464), done. remote: Total 13299 (delta 10426), reused 12544 (delta 9781) Receiving objects: 100% (13299/13299), 3.58 MiB | 1.91 MiB/s, done. Resolving deltas: 100% (10426/10426), done. Submodule path 'src/uv': checked out '47b2cd31c9b7372553e7687cd3c156d302695e59' git submodule update --init ./src/zmq Submodule 'src/zmq' (https://github.com/zeromq/zeromq3-x.git) registered for path 'src/zmq' Cloning into 'src/zmq'... remote: Counting objects: 12469, done. remote: Compressing objects: 100% (2831/2831), done. remote: Total 12469 (delta 9434), reused 12434 (delta 9407) Receiving objects: 100% (12469/12469), 8.90 MiB | 2.54 MiB/s, done. Resolving deltas: 100% (9434/9434), done. Submodule path 'src/zmq': checked out '7b18c36f78087739593b8662814552ea24c8f04a' make -C ./src make[1]: Entering directory /home/jcml/src/luv/src' luv_zmq.c: In function 'luvL_zmq_socket_send': luv_zmq.c:30: error: 'ZMQ_DONTWAIT' undeclared (first use in this function) luv_zmq.c:30: error: (Each undeclared identifier is reported only once luv_zmq.c:30: error: for each function it appears in.) luv_zmq.c: In function 'luvL_zmq_socket_recv': luv_zmq.c:40: error: 'ZMQ_DONTWAIT' undeclared (first use in this function) luv_zmq.c: In function 'luv_new_zmq': luv_zmq.c:127: warning: assignment makes pointer from integer without a cast luv_zmq.c:128: error: 'ZMQ_IO_THREADS' undeclared (first use in this function) luv_zmq.c: In function 'luv_zmq_socket_setsockopt': luv_zmq.c:279: error: 'ZMQ_SNDHWM' undeclared (first use in this function) luv_zmq.c:280: error: 'ZMQ_RCVHWM' undeclared (first use in this function) luv_zmq.c:289: error: 'ZMQ_MULTICAST_HOPS' undeclared (first use in this function) luv_zmq.c:292: error: 'ZMQ_ROUTER_BEHAVIOR' undeclared (first use in this function) luv_zmq.c:293: error: 'ZMQ_TCP_KEEPALIVE' undeclared (first use in this function) luv_zmq.c:294: error: 'ZMQ_TCP_KEEPALIVE_CNT' undeclared (first use in this function) luv_zmq.c:295: error: 'ZMQ_TCP_KEEPALIVE_IDLE' undeclared (first use in this function) luv_zmq.c:296: error: 'ZMQ_TCP_KEEPALIVE_INTVL' undeclared (first use in this function) luv_zmq.c:310: error: 'ZMQ_MAXMSGSIZE' undeclared (first use in this function) luv_zmq.c:317: error: 'ZMQ_IPV4ONLY' undeclared (first use in this function) luv_zmq.c:327: error: 'ZMQ_TCP_ACCEPT_FILTER' undeclared (first use in this function) luv_zmq.c:339: error: 'ZMQ_LAST_ENDPOINT' undeclared (first use in this function) luv_zmq.c: In function 'luv_zmq_socket_getsockopt': luv_zmq.c:365: error: 'ZMQ_SNDHWM' undeclared (first use in this function) luv_zmq.c:366: error: 'ZMQ_RCVHWM' undeclared (first use in this function) luv_zmq.c:375: error: 'ZMQ_MULTICAST_HOPS' undeclared (first use in this function) luv_zmq.c:378: error: 'ZMQ_ROUTER_BEHAVIOR' undeclared (first use in this function) luv_zmq.c:379: error: 'ZMQ_TCP_KEEPALIVE' undeclared (first use in this function) luv_zmq.c:380: error: 'ZMQ_TCP_KEEPALIVE_CNT' undeclared (first use in this function) luv_zmq.c:381: error: 'ZMQ_TCP_KEEPALIVE_IDLE' undeclared (first use in this function) luv_zmq.c:382: error: 'ZMQ_TCP_KEEPALIVE_INTVL' undeclared (first use in this function) luv_zmq.c:401: error: 'ZMQ_MAXMSGSIZE' undeclared (first use in this function) luv_zmq.c:410: error: 'ZMQ_IPV4ONLY' undeclared (first use in this function) luv_zmq.c:420: error: 'ZMQ_LAST_ENDPOINT' undeclared (first use in this function) luv_zmq.c:444: error: 'ZMQ_TCP_ACCEPT_FILTER' undeclared (first use in this function) make[1]: *** [luv.o] Error 1 make[1]: Leaving directory /home/jcml/src/luv/src' make: *** [all] Error 2

dvv commented 12 years ago

not confirmed Debian 6.0, luv current master

dvv@server:~/projects/luv/src$ uname -a
Linux server.domain.com 2.6.32-5-686-bigmem #1 SMP Sun Sep 23 10:27:25 UTC 2012 i686 GNU/Linux
richardhundt commented 12 years ago

On Oct 13, 2012, at 8:02 PM, Jonathan Matthews wrote:

I'm probably missing something, but it appears to the untrained eye like the version of zmq that gets automatically pulled in is incompatible with luv. Or something.

What am I cocking up?

~/src/luv$ make CFLAGS="-I/usr/include/lua5.1" LIBS="-lm -llua5.1 -lzmq"

Yep, looks like you're linking against an old version of zmq (DONTWAIT was renamed from NONBLOCK for version 3.x).

The reason is that you're overriding CFLAGS but not giving it the correct include paths. You're missing these (which are relative to the luv/src directory):

-I./uv/include -I./zmq/include

If you want to change the path to Lua, why not just do:

~/src/luv$ make LUADIR="/usr/include/lua5.1"

instead of clobbering CFLAGS?

jpluscplusm commented 12 years ago

OK, thanks chaps. I started overriding CFLAGS as I needed to solve this problem with a vanilla make on Squeeze:

user@host:~/src/luv$ make git submodule update --init ./src/uv Submodule 'src/uv' (https://github.com/joyent/libuv.git) registered for path 'src/uv' Cloning into 'src/uv'... Submodule path 'src/uv': checked out '47b2cd31c9b7372553e7687cd3c156d302695e59' git submodule update --init ./src/zmq Submodule 'src/zmq' (https://github.com/zeromq/zeromq3-x.git) registered for path 'src/zmq' Cloning into 'src/zmq'... Submodule path 'src/zmq': checked out '7b18c36f78087739593b8662814552ea24c8f04a' make -C ./src make[1]: Entering directory /home/jcml/src/luv/src' luv.c:7:17: error: lua.h: No such file or directory luv.c:8:20: error: lualib.h: No such file or directory luv.c:9:21: error: lauxlib.h: No such file or directory .... <more errors>

... which is caused by Debian, I believe, having a non-standard include path for lua5.1 and renaming(?) the lib from lua to lua5.1.

You're right, though: I had the OS package libzmq-dev (2.2) installed, which was causing the false positive of "libzmq found but not compatible". Uninstalling it, and fixing the liblua dir/naming problem via the LUADIR variable (of which I wasn't aware) seems to have worked.

user@host:~/src/luv$ make LUADIR=/usr/include/lua5.1 <a fair few warnings, etc> user@host:~/src/luv$ echo $? 0

Many thanks, both. Appreciated.