Bug in Zmat run on Octave 8.3.0, W11?

33 views
Skip to first unread message

otatuneni

unread,
Sep 13, 2023, 7:20:13 AM9/13/23
to iso2mesh-users
Hello,

I wasnt able to run Zmat on my PC (W11 Pro, GNU Octave 8.3.0) downloaded straight from https://github.com/fangq/zmat on date 13. 9. 2023.
Problem is, when i followed the tutorial on installation and just moved file zmat/octave/i686-w64-mingw32/zipmat.mex to zmat/private and i called function 
zmat, it didnt work and command window returned error 126, specified module was not found.
when i tried to compile zmat, i encountered error in file zmat/src/zmatlib.c, where for example at line 71, it wants to include file that doesnt exist in said directory and such error will be returned in command line, file blosc2.h actually exists, but in a directory  zmat/src/blosc2/include/blosc2.h, but changing the code so it points to this directory doesnt work anyway, then it just shows another error that i dont even understand(i guess it was something like it was trying to read code typed in a different language)

I tried all of the 3 methods of compiling and none of them worked.

What worker was sharing the Zmat file with colleague who i guess had older version of Zmat, where in file zmatlib.c there are no pointers to files that dont exist(examples in pics below).
All i had to do to make it work is to compile it with zmat/src/compilezmat.m

code that works (from my collague):
working Zmat.png

code that doesnt work(from site https://github.com/fangq/zmat):
not working zmatlib.c.png


Qianqian Fang

unread,
Sep 14, 2023, 11:17:57 PM9/14/23
to iso2mesh-users
thanks for reporting this - I made two updates to address the problem you reported

1. please download the github CI/CD compiled all-in-one package from http://mcx.space/nightly/github/ (the zmat package can be found at the bottom)
previously, my github action script uses octave 7.3 to build the windows mex file, now I just updated it to 8.3. the required DLL should be provided if you run it inside octave 8.x

also, you do not need to move .mex files, a simple addpath() to the root-folder of zmat should tell octave where to find the right mex file, this is handled by the PKG_ADD script: https://github.com/NeuroJSON/zmat/blob/master/PKG_ADD

2. I also updated the compilezmat.m script to build a simplified version of zmat without blosc2 and zstd support, see

by the way, the main development repo for zmat has moved to https://github.com/NeuroJSON/zmat


a longer answer to the windows octave mex issue:

it is a known issue that Windows and Mac versions of Octave can not produce portable mex files, please see a long thread on Octave's forum

on both WIndows and MacOS, mkoctfile-compiled .mex file is always linked with version-sensitive liboctinterp-xx.{dll,dylib} and liboctave-xx.{dll,dylib} and currently there is no way of removing these dependencies. This means the compiled mex file will only work for the version of octave that you build it (disappointingly!)

in comparison, Linux does not have this problem - any mex file build with Octave 5.x or newer does not link with liboctinterp or liboctave, a single copy of the linux zmat mex file can be used across multiple versions of octave, both backward and forward compatible.

I am still trying to prepare a new release, with the addition of blosc2 and zstd codec support. The source code of the new version contains a lot more units and using compilezmat.m to include all of those is a challenge. The github CI/CD build does include all compression codes including blosc2 and zstd, you can see all test results in https://github.com/NeuroJSON/zmat/actions/runs/6193286061/job/16814689385

let me know if this solves the issue you saw.

Qianqian
Reply all
Reply to author
Forward
0 new messages