[lua5.1][mac os x] dylib/so support

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[lua5.1][mac os x] dylib/so support

Foster Brereton
Hi all,

I'm on MacOS X 10.4 building Lua 5.1 with Boost Build v2 (a
jam-derived build system). I'm trying to get
require('my_extension.dylib', 'init') (or require('my_extension.so',
'init')) to work from the lua interpreter, but everytime I run it I
get back an error. The problem essentially boils down to this:

> print(package.loadlib("./libluagreet.dylib", "init"))
nil     file is not a bundle    open

I'm wondering:
   - What kind of native support exists in Lua 5.1 for the loading of
dynamic lua extensions?
   - Is there a more widely accepted / generally more useful way to
load lua extensions?

I am new to the Lua development world, and I apologize if these
questions have already been anwered elsewhere. I have been Googling
for a while with little (or severely outdated) results. Any help on
the matters would be greatly appreciated.

Blessings,
Foster


--
Foster T. Brereton - Computer Scientist
Software Technology Lab, Adobe Systems Incorporated
[hidden email]   --   http://opensource.adobe.com
Reply | Threaded
Open this post in threaded view
|

Re: [lua5.1][mac os x] dylib/so support

Gorazd Krosl
Hi Foster,
I am not at my home computer now and have never used
dynamic loading from lua, but if I remember correctly
from scanning the lua code, it requres on MaxOSX that
the dynamic module be compiled as a bundle. Check the
source,  the code lives in loadlib.c if I remember
correcly, it has been a long time.

Hope that helps and have a nice weekend,


Gorazd

If all mankind minus one were of one opinion, and only one person were of the contrary opinion, mankind would be no more justified in silencing that one person, than he, if he had the power, would be justified in silencing mankind.  On Liberty, John Stuart Mill (1806 - 1873)

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
Reply | Threaded
Open this post in threaded view
|

Re: [lua5.1][mac os x] dylib/so support

Foster Brereton
Gorazd,

Thanks for the tip. I have figured out how to get Boost Build v2 to
compile lua-compatible extension modules. If anyone would like
instructions on how to do so, please let me know.

Blessings,
Foster


On 4/28/06, Gorazd Krosl <[hidden email]> wrote:

> Hi Foster,
> I am not at my home computer now and have never used
> dynamic loading from lua, but if I remember correctly
> from scanning the lua code, it requres on MaxOSX that
> the dynamic module be compiled as a bundle. Check the
> source,  the code lives in loadlib.c if I remember
> correcly, it has been a long time.
>
> Hope that helps and have a nice weekend,
>
>
> Gorazd
>
> If all mankind minus one were of one opinion, and only one person were of the contrary opinion, mankind would be no more justified in silencing that one person, than he, if he had the power, would be justified in silencing mankind.  On Liberty, John Stuart Mill (1806 - 1873)
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>


--
Foster T. Brereton - Computer Scientist
Software Technology Lab, Adobe Systems Incorporated
[hidden email]   --   http://opensource.adobe.com
Reply | Threaded
Open this post in threaded view
|

Re: [lua5.1][mac os x] dylib/so support

Diego Nehab-3
Hi,

> If anyone would like
> instructions on how to do so, please let me know.

Instructions are already on the Wiki

     http://lua-users.org/wiki/BuildingModules

Regards,
Diego.
Reply | Threaded
Open this post in threaded view
|

Re: [lua5.1][mac os x] dylib/so support

Foster Brereton
I meant specifically using the Boost Build v2 environment. Sorry if I
wasn't clear on that.

Blessings,
Foster


On 4/28/06, Diego Nehab <[hidden email]> wrote:

> Hi,
>
> > If anyone would like
> > instructions on how to do so, please let me know.
>
> Instructions are already on the Wiki
>
>      http://lua-users.org/wiki/BuildingModules
>
> Regards,
> Diego.
>


--
Foster T. Brereton - Computer Scientist
Software Technology Lab, Adobe Systems Incorporated
[hidden email]   --   http://opensource.adobe.com
Reply | Threaded
Open this post in threaded view
|

Re: [lua5.1][mac os x] dylib/so support

Diego Nehab-3
Hi,

> I meant specifically using the Boost Build v2 environment. Sorry if I
> wasn't clear on that.

I am the one that should be sorry. I didn't even know what
Boost Build v2 was.

On the other hand, why don't you go ahead and add that to
the Wiki, so next time I send a message like that I will be
right? :)

Regards,
Diego.