i attempting add load socket library in lupa runtime.
i installed socket luarocks, needed append necessary paths.
>>> import lupa >>> sys.setdlopenflags(orig_dlflags) >>> lua = lupa.luaruntime() >>> lua.execute("package.cpath = package.cpath .. ';/root/.luarocks/lib/lua/5.3/?.so;/usr/local/lib/lua/5.3/?.so;/usr/local/lib/lua/5.3/loadall.so;./?.so'") >>> lua.execute(" package.path = package.path .. ';/root/.luarocks/share/lua/5.3/?.lua;/root/.luarocks/share/lua/5.3/?/init.lua;/usr/local/share/lua/5.3/?.lua;/usr/local/share/lua/5.3/?/init.lua;/usr/local/lib/lua/5.3/?.lua;/usr/local/lib/lua/5.3/?/init.lua;./?.lua;./?/init.lua'") >>> lua.require("socket") traceback (most recent call last): file "<stdin>", line 1, in <module> file "lupa/_lupa.pyx", line 268, in lupa._lupa.luaruntime.require (lupa/_lupa.c:4683) file "lupa/_lupa.pyx", line 1245, in lupa._lupa.call_lua (lupa/_lupa.c:17287) file "lupa/_lupa.pyx", line 1254, in lupa._lupa.execute_lua_call (lupa/_lupa.c:17400) file "lupa/_lupa.pyx", line 1207, in lupa._lupa.raise_lua_error (lupa/_lupa.c:16746) lupa._lupa.luaerror: error loading module 'socket.core' file '/usr/local/lib/lua/5.3/socket/core.so': /usr/local/lib/lua/5.3/socket/core.so: undefined symbol: lua_rotate a similar issue mentioned here proposed solution not seem work me (i running ubuntu):
linker error lunatic python lua.require('socket') -> undefined symbol: lua_getmetatable
from understanding, there linking problem liblua5.3.so?
any appreciated.
thanks, alex
it turns out lupa built against lua 5.2.
i including paths 5.3 modules - appears using 5.2 , installing sockets module in 5.2 fixed problem.
Comments
Post a Comment