Concurrently providing mex files for multiple platforms

Qianqian Fang <[email protected]> Wed, 20 Apr 2022 23:26:41 -0400
Newsgroups gmane.comp.gnu.octave.general
Message-ID <[email protected]>
Dear group,

I have been writing various toolboxes for octave and matlab - both as 
part of my research and hobby. I especially care about portability of my 
toolboxes, and often times spent quite a bit effort to ensure they can 
run across matlab and octave, as well as various OSes.

One challenge I am facing is to deploy mex-based toolboxes. For example, 
when deploying my ZMat toolbox (https://github.com/fangq/zmat), I have 
provided precompiled mex files for MATLAB users so that the toolbox can 
be ready-to-use across various OSes. These precompiled files are stored 
by OS-sensitive extensions (mexext) and can be conveniently placed under 
the same folder, see

https://github.com/fangq/zmat/tree/master/private

unfortunately, I am not aware of a way to do the same for Octave, and 
had to require users to manually add path to the .mex files built for 
each platform

https://github.com/fangq/zmat/tree/master/octave

I am wondering if there is way to organize or name these files so that 
they can be easily aggregated to create easily to deploy packages?


Another issue related to deploying these precompiled binaries is the .so 
file. I recognize that the mex files created by MATLAB's mex command 
links to a libmex.so library that is not version dependent, however, the 
mex file produced by mkoctfile -mex links to specific version of 
liboctinterp.so.x. When the octave version on the user's system is 
different from the one at compile time, the mex file throws an error. 
Although I can create symbolic links to the compile-time 
liboctinterp.so.x, it requires sudo and can not be automated.

I wonder if there is any workaround to this?

thanks

Qianqian



----------
We are transitioning to a web based forum
for community help discussions at
https://octave.discourse.group/c/help