Check your "lua" executable, to see what symbols it is exporting. How
did you compile it?

--
Fabio Mascarenhas


On Tue, Jun 29, 2010 at 2:16 PM, Jim Whitehead II <[email protected]> wrote:
> On Tue, Jun 29, 2010 at 6:05 PM, Jim Whitehead II <[email protected]> wrote:
>> 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 =)
>
> Lua 5.1.4 compiles to a .a by default, and luarocks compiled packages
> seem to be able to handle this just fine, so I can't imagine that's
> the issue. Even if I compile Lua and Luarocks and install them, but
> have my rocks-tree elsewhere this seems to work outside of Homebrew. I
> also don't see anything odd going on in either of those formulas that
> would cause this to be weird..
>
> - Jim
>
> _______________________________________________
> Luarocks-developers mailing list
> [email protected]
> http://lists.luaforge.net/cgi-bin/mailman/listinfo/luarocks-developers
>

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

Reply via email to