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: Wed, 20 Nov 2013 21:22:24 +0100

> After some minor source modifications, essentially:
>
> * modify matrix.lua return value to ffi.load the gsl shared library.
> * removing 'register_ffi_type ...' calls.
>
> I manage to build a working (still experimental) standalone gsl module.

Sounds good.

So you are actually using the matrix functions, not just the bare
functions from the GSL Library. The matrix module provides a lot of
facilities to create matrices and define the metatable so that the
arithmetic operators are defined to perform the expected operations.
This is actually a tricky part since you can always mix scalar numbers
(complex or real) with complex or real matrices. The metamethods
automatically promote matrices to complex when needed.

> The tricky part, was to figure out how to load the 'libgsl.so' shared
> library (on ubuntu 12.04) because the provided packaged library on ubuntu is
> by default not linked with a blas library, which cause:
>
> luajit: symbol lookup error: /usr/lib/libgsl.so: undefined symbol:
> cblas_XXXX

Sorry, do not know about that.

> What i need to do now for better usability:
>
> * binding 'gsl_set_error_handler (gsl_error_handler_t * new_handler);' to
> custom error handling (prevent abort() on error).

This is one of the thing gsl shell is doing for you ;)

> * try to reorgnaize code to prevent polluting global namespace with 'matrix'
> and 'complex' variables (defined as globals in matrix.lua).

Well, I would not say "polluting" but "populating the global namespace
with two very useful modules" :-)

> Thanks for your great job on gsl-shell, this save me a lot of coding work.

Thank you to you, I'm glad that someone can use my code to do
something useful. May be you will be able to share your work on github
so that other people can use it.

Francesco



reply via email to

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