On Tue, Jun 29, 2010 at 6:01 PM, Hisham <[email protected]> wrote:
> On Tue, Jun 29, 2010 at 12:14 PM, Jim Whitehead II <[email protected]> wrote:
>> On Sat, Jun 19, 2010 at 9:21 PM, Jim Whitehead II <[email protected]> wrote:
>>> I'm trying to work with one of the homebrew developers in order to get
>>> Lua and Luarocks playing together nicely when using that package
>>> management software. Right now they both install correctly and I am
>>> able to install rocks without any issue. The problem comes in when I
>>> actually try to require one of the modules:
>>>
>>> $ luarocks install lpeg
>>> Installing http://luarocks.org/repositories/rocks/lpeg-0.9-1.src.rock...
>>> Archive:  /tmp/luarocks_luarocks-rock-lpeg-0.9-1-8069/lpeg-0.9-1.src.rock
>>>  inflating: lpeg-0.9-1.rockspec
>>>  inflating: lpeg-0.9.tar.gz
>>> Do not use 'module' as a build type. Use 'builtin' instead.
>>> export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 -I/usr/local/include -c
>>> lpeg.c -o lpeg.o
>>> export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -bundle -undefined
>>> dynamic_lookup -all_load -o lpeg.so -L/usr/local/lib lpeg.o
>>> Updating manifest for /usr/local/lib/luarocks/lib/luarocks/rocks
>>>
>>> $ lua -lluarocks.loader -llpeg
>>>  lua: /usr/local/share/lua/5.1/luarocks/loader.lua:95: error loading
>>> module 'lpeg' from file
>>> '/usr/local/lib/luarocks/lib/lua/5.1//lpeg.so':
>>>    dlopen(/usr/local/lib/luarocks/lib/lua/5.1//lpeg.so, 2): Symbol
>>> not found: _luaL_addlstring
>>>   Referenced from: /usr/local/lib/luarocks/lib/lua/5.1//lpeg.so
>>>   Expected in: dynamic lookup
>>>
>>>  stack traceback:
>>>    [C]: in function 'loader'
>>>    /usr/local/share/lua/5.1/luarocks/loader.lua:95: in function
>>> </usr/local/share/lua/5.1/luarocks/loader.lua:91>
>>>    (tail call): ?
>>>    [C]: ?
>>>    [C]: ?
>>>
>>> Anyone possibly able to help me out with why this is happening? I do
>>> have the Lua library installed at /usr/local/lib/liblua.a although it
>>> is a symbolic link. The issue is the same with any module that calls
>>> into liblua.
>>
>> Anyone who knows more about these things around to help me work this out?
>
> The .a file is the static library, so it won't help at dynamic lookup.
> I don't remember the OSX specifics, but the usual method is to compile
> the Lua executable so that it exposes its symbols to modules, so it's
> probably best to check your Lua compilation flags.

Thanks, I'll look at this and see if I can't make it work.

> This also grabbed my attention:
> "/usr/local/lib/luarocks/lib/luarocks/rocks" -- is LuaRocks being
> installed with /usr/local/lib/luarocks as a prefix? If you use
> /usr/local you shouldn't need to use -lluarocks.loader.

It's installed to a subdirectory of /usr/local. I could explain, but
it's probably best just to look at Homebrew if you're really that
interested =)

- Jim

_______________________________________________
Luarocks-developers mailing list
[email protected]
http://lists.luaforge.net/cgi-bin/mailman/listinfo/luarocks-developers

Reply via email to