[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Tuna now in module form
- From: Matthew Wild <mwild1@...>
- Date: Tue, 14 Feb 2012 07:28:15 +0100
On 14 February 2012 06:15, curt <email@example.com> wrote:
>> 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
> 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
> 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
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: