lua-users home
lua-l archive

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


On 14 February 2012 06:15, curt <curt@northarc.com> wrote:
> re:
>>
>>
>> You say there is a 'lua-lanes'-like mode of operation, does it mean
>> that I can something like this?
>>
>> local tuna = require 'tuna'
>> local thread = tuna.startThread('*')
>> local task = thread:startTaskFromBuffer(.....)
>

> So expect tuna 0.4.2 with "tuna.so" available to run all of Tuna's
> functionality entirely from lua. I can release it now [privately] to anyone
> who wants to test it but it won't be up on the site until it's quite a bit
> more polished, with some examples/docs, and working for Win32/64 as well.

I'm quite interested for testing. I have little time right now though,
so can't make any promises - but I'd love to poke when I have a spare
minute.

> I do need some advice though: I have *NEVER* tried to publish a shared
> library, particularly for *nix. Right now it just builds/links tuna.so very
> naively:
>
> tuna.so: $(LOBJS)s
>    g++ -shared -Wl,-soname,libtuna.so.1 -o tuna.so -lc $(LOBJS) -lpthread
> -lrt -llua
>
> and that works fine if you run lua from the same directory, but I don't know
> what the standards are for locating/naming it on a standard system. Any
> help/guidance would be much appreciated. like shouldn't I call it
> libtuna.so.0.4.2 or something? and put it into /usr/lib or /usr/lib64 with
> an install script?
>
> Just a pointer to a tutorial or FAQ-for-dummies would be fine, I've been
> googling for the last 20 minutes and have nothing but a headache to show for
> it.

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

For installing... that's platform specific. Different Linux
distributions are different, and some people like to install into
/usr/local and some people like to install into /opt/. Most binary
modules for Lua expect you to edit the paths in a config or makefile
before you run make. I suggest you take a look at a makefile of an
existing module with the same licence and borrow from that. I think
installing the .so to '/usr/local/lib/lua/5.1/tuna.so' by default
would be sensible (it may need to create the directory).

Also sensible would be to make a rockspec for luarocks. Well worth the
time (which, depending on the complexity of building the module, isn't
usually very long). See the 'Tutorials' section here for examples:
http://luarocks.org/en/Documentation

Regards,
Matthew