help-octave
[Top][All Lists]
Advanced

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

fortran mex interface shim generator


From: Michael Tesch
Subject: fortran mex interface shim generator
Date: Wed, 22 May 2019 18:18:28 +0200

Hello,

I wrote a little script to generate fortran (77) wrappers around the octfile (mex) functions.  Just wanted to share what I've got so far, hopefully it will help someone.  Maybe someone would like to contribute modern fortran module support.

it's here: https://gitlab.com/tesch1/mkoctfort

It just takes the mexproto.h and munges it up a bit and spits out a corresponding fort.cc which wraps the functions defined therein, and can be linked against a .F.  I'm sure there's a better way of doing this, but this is a pretty flexible approach and can be adjusted to suit whatever fortran compiler you're targeting and its abi.)

Obviously it only covers the mex functions callable from fortran - f77 dont do no varargs.  Also no constants are provided, it's really just a WIP that does maybe 80% of what it should.

I tried it on the recently mentioned Glmnet (http://lists.gnu.org/archive/html/help-octave/2019-04/msg00029.html) and it seems to work ok.

(related to messages: http://lists.gnu.org/archive/html/help-octave/2011-01/msg00320.html, http://lists.gnu.org/archive/html/help-octave/2011-01/msg00320.html, http://lists.gnu.org/archive/html/help-octave/2017-02/msg00059.html)

It seems to be a rarely-requested item, but I'd be fine with it if someone wanted to clean it up and include it in octave proper.

Michael


ps. thank you all for all your work on octave!



reply via email to

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