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

Latest commits break torch luajit 2.1 builds #40

Closed
ngimel opened this issue Apr 26, 2017 · 3 comments
Closed

Latest commits break torch luajit 2.1 builds #40

ngimel opened this issue Apr 26, 2017 · 3 comments

Comments

@ngimel
Copy link

ngimel commented Apr 26, 2017

With the latest luajit-rocks, torch builds fail with

gcc -O2 -fPIC -I/opt/torch/install/include -c src/lfs.c -o src/lfs.o
src/lfs.c:84:0: warning: "luaL_newlib" redefined
 #  define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l))
 ^
In file included from src/lfs.c:67:0:
/opt/torch/install/include/lauxlib.h:125:0: note: this is the location of the previous definition
 #define luaL_newlib(L, l) (luaL_newlibtable(L, l), luaL_setfuncs(L, l, 0))
 ^
gcc -shared -o lfs.so -L/opt/torch/install/lib src/lfs.o
Updating manifest for /opt/torch/install/lib/luarocks/rocks
No existing manifest. Attempting to rebuild...
luafilesystem 1.6.3-1 is now built and installed in /opt/torch/install/ (license: MIT/X11)

Updating manifest for /opt/torch/install/lib/luarocks/rocks
penlight scm-1 is now built and installed in /opt/torch/install/ (license: MIT/X11)

gcc -O2 -fPIC -I/opt/torch/install/include -c lua_cjson.c -o lua_cjson.o
lua_cjson.c:1312:13: error: static declaration of 'luaL_setfuncs' follows non-static declaration
 static void luaL_setfuncs (lua_State *l, const luaL_Reg *reg, int nup)
             ^
In file included from lua_cjson.c:44:0:
/opt/torch/install/include/lauxlib.h:88:18: note: previous declaration of 'luaL_setfuncs' was here
 LUALIB_API void (luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup);
                  ^

Error: Build error: Failed compiling object lua_cjson.o

Looks like it is caused by the following line that was added in one of the latest commits:
https://github.com/torch/luajit-rocks/blob/master/luajit-2.1/src/lauxlib.h#L125

@soumith
Copy link
Member

soumith commented Apr 26, 2017

yes it's an upstream luajit issue. until that is fixed i might have to freeze luajit-rocks commit

@GitBubble
Copy link

@soumith
i had it fixed and tested, just some re-declaration error.

@MalKeshar
Copy link

Any updates on this? Can you please recommend some workaround for it? I mean workaround for building torch with luajit-2.1.0-beta3? Or just stay away from beta3 for now?

@ngimel ngimel closed this as completed Mar 23, 2023
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

4 participants