gsl-shell-info
[Top][All Lists]
Advanced

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

Re: [Gsl-shell-info] Loading part of gsl lib in standard Luajit ?


From: Francesco Abbate
Subject: Re: [Gsl-shell-info] Loading part of gsl lib in standard Luajit ?
Date: Tue, 19 Nov 2013 21:48:11 +0100

Hi,

if I understand correctly your request you can do what you need quite easily.

GSL Shell use the GSL library by loading the shared library using the
FFI module.

So what you actually need is:
- a bunch of cdefs to declare at least a part of the GSL library's functions
- the ffi.load function to actually load the shared library (a DLL
file on windows)

Everything is already in the "gsl shell" package in the "gsl.lua"
file. It can be used directly in luajit with some caveats:

- at the end of the file use ffi.load('libgsl') on linux to return the
library. returning ffi.C only works with the gsl shell executable
because the gsl library is already linked.
- some C definitions of the GSL library are tweaked so you may want to
restore their original version. The modification affect the
declaration of the struct gsl_matrix and gsl_block. The definition of
gsl_matrix_view is also different from the original declaration but in
this case is probably better to keed the gsl shell's version.

I hope you can find out what you need. This is actually a recurrent
request from some users. There are actually two kinds of requests:
- how can I use just the GSL stuff I don't need all the plotting stuff
- how I can use just the plotting module, I don't need all the GSL stuff

Actually I should make the plotting module usable as a standard
stand-alone module but this require some work and is definitely not in
my list of priority. Yet I can give some directions if someone want to
volunteer for that task. The interesting thing is that it could be
used both with standard Lua and with LuaJIT so many people are
potentially interested.

Francesco


2013/11/19 J.-F. Cap <address@hidden>:
> Hello,
>
> Is there a "simple way" to load part of gsl library in a "standard" LuaJIT
> interpreter ?
> By "simple way" i mean : without the changing the source code myself.
>
> Thanks.
>
>



-- 
Francesco



reply via email to

[Prev in Thread] Current Thread [Next in Thread]