bugGNU Octave - Bugs: bug #56176, Implementation of loadlibrary...


bug #56176: Implementation of loadlibrary function (revisited)

Submitted by:  avlas <kupiqu>
Submitted on:  Sat 20 Apr 2019 06:15:48 AM UTC  
Category:  Octave Function Severity:  1 - Wish
Priority:  3 - Low Item Group:  Feature Request
Status:  None Assigned to:  None
Originator Name:  loadlibrary Open/Closed:  Open
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Fri 12 Jul 2019 11:05:26 PM UTC, comment #2: 

Many years ago, someone made the assertion that this project would depend on improved classdef support in Octave. I've seen that repeated, but I'm not sure I fully understand. As far as I can tell, the only parts of loadlibrary in Matlab that use classes are the 'libpointer' and 'libstruct' functions for dealing with C pointers and structs. Is that right or did I miss something else?

As I understand it, this project would add ordinary functions to Octave: calllib, libfunctions, loadlibrary, and unloadlibrary. When libraries are loaded with loadlibrary, they are stored internally in the interpreter with a string name as the lookup key. I don't think there is any kind of handle class interface to deal with. It's only when more complicated pointer and struct types are needed that classes come into the picture. For a simple example

loadlibrary ("libc")
calllib ("libc", "printf", "%s, %s\n", "Hello", "world")

It seems to me that one of the harder parts of this project is preprocessing and parsing C header files to automatically build a table of function prototypes, and then building all the rules for automatically converting Octave data types into C equivalents and the reverse. The mechanics of loading a dynamic library and invoking a function pointer are relatively simple. I've gone through a lot of similar trouble with automatic argument and return value conversion in the Pythonic package.

Mike Miller <mtmiller>
Project Administrator
Sat 20 Apr 2019 01:49:44 PM UTC, comment #1: 

Sorry I misclassified the issue. Current categories make more sense.

[I will send an email to the help mailing list to see if someone knows a workaround for this in the meantime]

avlas <kupiqu>
Sat 20 Apr 2019 06:15:48 AM UTC, original submission:  

Would you please consider implementing a loadlibrary function compatible with Matlab?

I saw a couple of discussion bursts from 5-10 years ago about this. At that point the main problem seemed to be that Octave didn't support classes (https://lists.gnu.org/archive/html/octave-maintainers/2013-11/msg00406.html), but this is not the case anymore.

A bit of context and explanation of my request:

I am trying to use Transplant (https://transplant.readthedocs.io/en/latest/) to call Octave from Python. I am aware about Oct2Py, which I have also started to use, but Transplant seems more comprehensive, powerful and actively maintained. Also, Oct2Py presents some issues (https://github.com/flathub/org.octave.Octave/issues/56)

According to main Transplant Dev, using Transplant should be quite straightforward if the loadlibrary function was available in Octave (https://github.com/bastibe/transplant/issues/74)

avlas <kupiqu>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

   bug dependencies.


Carbon-Copy List
  • -email is unavailable- added by gyom
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by kupiqu (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-02-08 mtmiller Dependencies- => bugs #57770 is dependent
    2019-11-21 gyom Carbon-Copy- => Added gyom
    2019-04-20 jwe Severity3 - Normal => 1 - Wish
        Priority5 - Normal => 3 - Low
        Item GroupMatlab Compatibility => Feature Request

    Back to the top

    Powered by Savane 3.5