lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 06/12/2015 09:38 PM, Brigham Toskin wrote:
Here's what I'm seeing if I install the whole thing from scratch for lua
5.3 specifically. The include directories for the lua headers are
correctly versioned to 5.3, but I'm not seeing it linked explicitly with
any particular liblua at build time, so it should use the default for
the interpreter that loads it (5.3).
Yes, the module resolves Lua-related symbols from the interpreter when 
it's loaded by it.
What I would guess is happening, based on the -L and -rpath options that
get set, is it's finding the system default /usr/lib/libreadline.dylib
before the one under /opt/local/lib, and it doesn't match what
libhistory is expecting (which isn't installed at all under /usr). But
what I don't understand is why it works under 5.2, which uses the same
-L and -rpath directives. Thoughts?
libhistory is actually provided by readline.  It's not available in 
/usr/lib because libedit packages both libraries in the same shared 
object.  Try building adding READLINE_DIR=/opt/local to the build 
command line.  You technically only specify the location of the history 
library.  That should be enough, since the readline library resides in 
the same place and it wouldn't make much sense to pass the same path 
twice to ld, but perhaps it will have some other effect.  I'm not very 
familiar with LuaRocks' build process.
You can see what libraries the module links against with:

$ ldd /usr/local/lib/lua/5.3/prompt.so

See what happens when you pass READLINE_DIR=/opt/local. If the module still gets linked against /usr/lib/* libraries, then I'm afraid LuaRocks doesn't handle the case where you have multiple libraries with the same name installed, correctly. It probably should pass the explicitly specified library paths before the default paths, but from what I see, it doesn't. I'll try to set up a similar case in my system and see what happens.
Now, regarding Lua 5.1 and LuaJIT:  I can use the same module, built 
against Lua 5.1 with both.  Your missing symbols indicate that you 
somehow try to load a module compiled for Lua 5.2.  I can see the path 
mentions 5.1 in both cases but on my system the missing symbols are only 
mentioned in the 5.2 module:
dimitris@debian:~$ nm -a /usr/local/lib/lua/5.2/prompt.so | grep 
"luaL_\(loadbuffer\|setfuncs\)"
                 U luaL_loadbufferx
                 U luaL_setfuncs
dimitris@debian:~$ nm -a /usr/local/lib/lua/5.1/prompt.so | grep "luaL_\(loadbuffer\|setfuncs\)"
                 U luaL_loadbuffer

Perhaps you haven't configured LuaRocks correctly somehow?