Compile xMat to an OCT file
First, a wrapper script is needed for compilation. The attached C++ code xmat_oct.cpp was successfully used for this. In Linux, the following commands were used within GNU Octave for compilation
mkoctfile -ffree-form -cpp -DOCTAVE_CALLING xmat.f -c;
delete *.mod;
mkoctfile -L/usr/lib64/octave/6.4.0 -o xmat_oct xmat.o xmat_oct.cpp;
Please note, that the path to the GNU Octave libraries (/usr/lib64/octave/6.4.0) needs to be adjusted according to your installation. In general, for compilation the macro OCTAVE_CALLING has be defined next to the flags for free format and preprocessing (as shown).

Linked files