|
From: | Reza Housseini |
Subject: | Re: Functions from Matlab C shared library utility |
Date: | Mon, 12 Aug 2013 10:07:52 +0200 |
[3] http://www.gnu.org/software/libtool/manual/libtool.html#Using-libltdlOn Wed, Jul 31, 2013 at 4:27 PM, John W. Eaton <address@hidden> wrote:
On 07/31/2013 08:34 AM, Alexander Barth wrote:Yes, we should definitely be using libffi and not attempting to reinvent it.
For what it is worth I have attached the file testproto.m.
You might be interest in the library libffi
(http://sourceware.org/libffi/) which is also used by python.
Are there any existing free software tools that can do this job, perhaps in a python or perl module?
Parsing the header file might not be trivial. As an intermediate step,
having to hand-code the proto file would already be very useful.
jweHey everyone thanks for the replys.I checked with julia and they have a function called ccall [1] which calls c code but uses llvm in the back (but I couldn't figure out how).@Alex Thanks for the tests in Matlab, that clarifies things up. As I understand correctly there is now need to figure out header paths for a function call likeloadlibrary('/usr/lib/libnetcdf.so')there is always a user provided path to the header. Is this generated thunk library some kind of converter between Matlab and C for the specified library?For parsing the header file, I thought of using doxygen to generate xml files and read them in with pugixml [2]. Althought I'm concerned about speed so probably using eventually the parser and lexer from clang is a better option. I also found a script (which is included in the Ubuntu distribution) written in python which parses c headers but I can't find it at the moment anymore.I also think the libfii library seems an appropriate choice to do this.I'm using the libltdl [3] library from the libtool library to load, call and unload a library. It is portable to Windows and Unix Systems.Regarding the header parsing I'm glad for every input, suggestion and comment.CheersReza
[Prev in Thread] | Current Thread | [Next in Thread] |