On my system I built luaffi, not luaffifb, because luaffi does not use luarocks. I had to manually apply some small patches from luaffifb to luaffi, as follows. cd sudo apt-get install lua5.3 sudo apt-get install lua5.3-dev git clone https://github.com/jmckaskill/luaffi Patch the makefile to use Lua 5.3 instead of Lua 5.2: Change LUA=lua LUA_CFLAGS=`$(PKG_CONFIG) --cflags lua5.2 2>/dev/null || $(PKG_CONFIG) --cflags lua` SOCFLAGS=-fPIC SOCC=$(CC) -shared $(SOCFLAGS) CFLAGS=-fPIC -g -Wall -Werror $(LUA_CFLAGS) -fvisibility=hidden -Wno-unused-function --std=gnu99 to LUA=lua5.3 LUA_CFLAGS=`$(PKG_CONFIG) --cflags lua5.3 2>/dev/null || $(PKG_CONFIG) --cflags lua` SOCFLAGS=-fPIC SOCC=$(CC) -shared $(SOCFLAGS) CFLAGS=-fPIC -g -Wall -Werror $(LUA_CFLAGS) -fvisibility=hidden -Wno-unused-function --std=gnu99 Patch ffi.h: Because in Lua 5.3 lua_remove is a macro not a function name, change #if LUA_VERSION_NUM == 501 static void lua_callk(lua_State *L, int nargs, int nresults, int ctx, lua_CFunction k) { lua_call(L, nargs, nresults); } /* ** set functions from list 'l' into table at top - 'nup'; each ** function gets the 'nup' elements at the top as upvalues. ** Returns with only the table at the stack. */ static void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) { luaL_checkstack(L, nup, "too many upvalues"); for (; l && l->name; l++) { /* fill the table with given functions */ int i; for (i = 0; i < nup; i++) /* copy upvalues to the top */ lua_pushvalue(L, -nup); lua_pushcclosure(L, l->func, nup); /* closure with those upvalues */ lua_setfield(L, -(nup + 2), l->name); } lua_pop(L, nup); /* remove upvalues */ } #define lua_setuservalue lua_setfenv #define lua_getuservalue lua_getfenv #define lua_rawlen lua_objlen static char* luaL_prepbuffsize(luaL_Buffer* B, size_t sz) { if (sz > LUAL_BUFFERSIZE) { luaL_error(B->L, "string too long"); } return luaL_prepbuffer(B); } #endif to #if LUA_VERSION_NUM == 501 static void lua_callk(lua_State *L, int nargs, int nresults, int ctx, lua_CFunction k) { lua_call(L, nargs, nresults); } /* ** set functions from list 'l' into table at top - 'nup'; each ** function gets the 'nup' elements at the top as upvalues. ** Returns with only the table at the stack. */ static void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) { luaL_checkstack(L, nup, "too many upvalues"); for (; l && l->name; l++) { /* fill the table with given functions */ int i; for (i = 0; i < nup; i++) /* copy upvalues to the top */ lua_pushvalue(L, -nup); lua_pushcclosure(L, l->func, nup); /* closure with those upvalues */ lua_setfield(L, -(nup + 2), l->name); } lua_pop(L, nup); /* remove upvalues */ } #define lua_setuservalue lua_setfenv #define lua_getuservalue lua_getfenv #define lua_rawlen lua_objlen static char* luaL_prepbuffsize(luaL_Buffer* B, size_t sz) { if (sz > LUAL_BUFFERSIZE) { luaL_error(B->L, "string too long"); } return luaL_prepbuffer(B); } #elif LUA_VERSION_NUM == 503 static void (lua_remove)(lua_State *L, int idx) { lua_remove(L, idx); } #endif Patch test.lua: Add local cpath at top, for example: package.cpath = package.cpath .. ';/home/mkg/luaffi/?.so' print('package.cpath: ' .. package.cpath) Because in Lua 5.3 ints are not floats any more, remove the assertion at about line 20: -- return _G.assert(a == b) The test should now pass. Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here