>
> On 26 July 2013 20:42, ??????? ???????? <wizg...@gmail.com> wrote:
> >
> > Hi all,
> >
> > I'm investigating the use of the builtin build option but I see to have
> > come to a dead end. My setup is as follows:
> >
> > 1) I want to build a module and link it with lua lanes which is listed as
> > a dependency
> > in the luarock spec file. How do I locate it to add it as an external lib
> > for linking(Is there a shortcut for this?). I can include the needed
> header
> > in my project if that's not available but I need a path for linking.
> Excuse
> > me if I have missed something obvious here
> I'm not sure if I'm understanding the issue. Do you need to locate the
> lanes.so file? Shouldn't it be possible just to do `require "lanes"`
> to load/use it? Do you want to call C functions from the lanes.so file
> directly from your C code? I guess you could access the Lanes API as
> Lua functions.
I'll certainly have to require lanes in my module's initialization to make
sure it's loaded but your understanding is correct. I need to link with
lanes.so to call C functions from it but not Lua C Api ones. Lanes provides
a mechanism for creating trans-thread data that are shared between
threads-lua states through the creation of userdata proxies on each state.
They are essentially containers of pointers to user allocated memory. Lanes
handles interstate transferm setup and reference counting but requires the
developers to provide a function pointer for handling the specifics. So my
module needs to be linked with lanes.so to use the mechanism that lanes
defines.
>
> > 2) I then want to build another module that needs the previous one as a
> > dependency(but no linking here). This should be easy but this module
> > uses(optionally but with great effect) simd intrinsincs on supported
> > platforms. I can probably resolve that in my code and default on sse2 on
> x86
> > and neon on arm but a specific cflag for each is needed by gcc to enable
> it
> > to emit the instructions.
> Unfortunately platform-overrides use only the OS detection and not the
> arch variable, so there's no fully automated way to do that. You could
> set custom CFLAGS in your configuration files but as of now there's no
> way to specify per-arch flags in a rockspec using the builtin type.
> > So far I have been building it with cmake, are these configurations
> > possible with the builtin type of luarocks? Thank you in advance
> If the builtin type proves insufficient, you can keep using cmake
> integrated with LuaRocks.
> -- Hisham
Having some capabilities probing in luarocks would be a nice touch imho.
Something like capabilities = { "sse2" = "EXTRA_DEFINES_FOR_SSE2", "neon" =
"EXTRA_DEFINES_FOR_NEON" } and all the details handled by luarocks. I
understand that these are not considered, generally, essential but can
benefit lots of number crunching setups. I think you are right though, I
should better stick with cmake for now.
--
Yannis Gravezas
Founder@Intrael <http://www.intrael.com>
Athens, Greece
+30 6947931815
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Luarocks-developers mailing list
Luarocks-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/luarocks-developers