Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install zklua on macosx? #16

Open
wbdu opened this issue Aug 10, 2015 · 10 comments
Open

How to install zklua on macosx? #16

wbdu opened this issue Aug 10, 2015 · 10 comments

Comments

@wbdu
Copy link

wbdu commented Aug 10, 2015

localhost:zklua steven$ make
gcc -c pkg-config --cflags lua -fPIC -O2 zklua.c
zklua.c:28:1: error: unknown type name '_'
_
^
In file included from zklua.c:29:
In file included from ./zklua.h:24:
In file included from /usr/local/include/lua.h:12:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.1.0/include/stdarg.h:30:1: error: expected identifier or
'('
typedef __builtin_va_list va_list;
^
In file included from zklua.c:29:
./zklua.h:28:10: fatal error: 'zookeeper/zookeeper.h' file not found

include <zookeeper/zookeeper.h>

     ^

3 errors generated.
make: *** [zklua.o] Error 1

@wbdu wbdu changed the title How to install zklua on machos? How to install zklua on macosx? Aug 10, 2015
@yandd
Copy link

yandd commented Aug 10, 2015

你需要删除zklua.c中的第28行'_'。

@wbdu
Copy link
Author

wbdu commented Aug 12, 2015

Thks,删除掉后编译通过了。
再请教一个问题,我想用luajit编译,应该如何修改MakeFile呢?

@yandd
Copy link

yandd commented Aug 12, 2015

只需要修改Makefile中的LUA_INC_DIR = /usr/local/include/luajit-2.0为你自己的luajit头文件路径即可

@wbdu
Copy link
Author

wbdu commented Aug 12, 2015

:( 没找到LUA_INC_DIR,只有:
LUA_LIB_DIR = /usr/local/Cellar
LUA_VERSION = lua
LUA_VERSION_NUMBER = 5.2.4_1

@wbdu
Copy link
Author

wbdu commented Aug 12, 2015

作者是用pkg-config搞的。我不知该如何修改:(
CC = gcc
CFLAGS = pkg-config --cflags $(LUA_VERSION) -fPIC -O2 #-Wall
INSTALL_PATH = $(shell pkg-config $(LUA_VERSION) --variable=libdir)/$(LUA_VERSION)/$(LUA_VERSION_NUMBER)

@yandd
Copy link

yandd commented Aug 12, 2015

LUA_INC_DIR = /usr/local/include/luajit-2.0
CFLAGS = -I$(LUA_INC_DIR) -fPIC -O2 -Wall

我是这样修改的

@wbdu
Copy link
Author

wbdu commented Aug 12, 2015

谢谢啦,那上面那个INSTALL_PATH应该如何修改呢?
后面用到了

install: zklua.so
ifeq ($(OS_NAME), Darwin)
install zklua.so $(INSTALL_PATH)/zklua.so
else
install -D -s zklua.so $(INSTALL_PATH)/zklua.so
endif

@wbdu
Copy link
Author

wbdu commented Aug 12, 2015

我改好了,再次感谢。

@wbdu
Copy link
Author

wbdu commented Aug 12, 2015

在openresty环境下运行实例,直接导致nginx进程崩溃了。

@yandd
Copy link

yandd commented Aug 12, 2015

我也有这个问题,但是作者一直没回应,你先看下pull request把其他的BUG改掉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants