From owner-help-octave at bevo dot che dot wisc dot edu Mon Oct 28 12:37:04 1996 Subject: MEX-functions, extending octave From: "John W. Eaton" To: archibal at dirac dot ccrs dot emr dot ca (Andrew Archibald) Cc: help-octave at bevo dot che dot wisc dot edu Date: Mon, 28 Oct 1996 12:35:52 -0600 On 24-Oct-1996, Andrew Archibald wrote: : I've managed to install octave here, as an alternative to MATLAB. : Unfortunately, we have a lot of existing code written for MATLAB. The : M-files should be fine, but we have written a lot of MEX C functions : which perform various functions. : : Firstly, is it possible to recompile these so octave can use them --- : either dynamically loaded, or by recompiling octave? : : Is there an interface by which similar things can be written? It has always been possible to add new functions written in C++, C, or Fortran by recompiling Octave. With version 1.1.1, dynamic linking was possible on some systems using GNU dld (this is described briefly in the manual, section Dynamically Linked Functions). In the next release, support for dld has been dropped and dynamic linking will work on many more systems using either dlopen() (most Unix-like systems) or sh_load() (HP/UX systems). The interface for dynamically-linked functions has also been simplified (conversion from the old to the new interface is very simple). The interface is not the same as the Matlab MEX file interface, but I suppose it might be possible to write a library of compatibility functions so that your MEX files would work without modification. Also in the next release, you will be able to define your own data types (for example, sparse or banded matrix types) and use them pretty much like you would the built-in types. jwe