lua-users home
lua-l archive

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


On 10 February 2018 at 00:34, Sean Conner <sean@conman.org> wrote:
> It was thus said that the Great Dibyendu Majumdar once stated:
>> On 9 February 2018 at 08:08, Sean Conner <sean@conman.org> wrote:
>> > It was thus said that the Great Dibyendu Majumdar once stated:
>> >>
>> >> My knowledge is not perfect of course but I also did not explain the
>> >> problem fully.
>> >>
>> >> In order for Ravi to find the libraries on Mac OSX I need to set something like:
>> >>
>> >> export LUA_CPATH="$RAVI_HOME/lib/?.dylib;$RAVI_HOME/lib/lib?.dylib"
>> >>
>> >> Now in my CMake build by default the library gets created as:
>> >>
>> >> $HOME/ravi/lib/ravi/libffi.dylib
>> >>
>> >> It appears that Lua searches for:
>> >>
>> >> $HOME/ravi/lib/ravi/ffi.dylib as it substitutes 'ravi/ffi' in place of
>> >> '?'. So it cannot handle the 'lib' prefix.
>> >>
>> >> I have amended the CMake script to omit the 'lib' prefix and now it
>> >> works fine, but this is not standard naming on Mac OSX I think.
>> >
>> >   At work we develop on Mac OS-X, and while normally I package everything
>> > into a single executable, I do have the ability to install individual
>> > modules [1] and they all have a .so extension (just like they do on Linux
>> > and Solaris) and Mac OS-X can load them (the Lua modules written in C) just
>> > fine.  I did check other, standard shared libraries on the Mac, and yes,
>> > they have the .dylib extension [2].  So for Lua modules I don't think it
>> > matters all that much what the extension is.
>> >
>>
>> Sure but that was not the issue I was high lighting. Do you have a
>> solution for the problem I described above?
>
>   It could be that I don't have a full grasp of your problem.  I've read
> over your message, and as best as I could tell:
>

Above the problem I was describing is that Lua's shared library
resolution does not work if the library has a 'lib' prefix, and the
resolution has a path component in it. That is:

Lua looks for '$HOME/ravi/lib/ravi/ffi.dylib' or
'$HOME/ravi/lib/ravi/ffi.so' - depending on CPATH setting - and this
doesn't support the 'lib' prefix. Is this any clearer?

Anyway I thought there was a view that there isn't a problem - so I
thought I was missing something, and I was looking to confirm whether
my finding is correct or not.

Regards
Dibyendu