FSL PALM failing at execution

I am playing around with FSL PALM and am having issues running it through Octave (v.5.2.0). I have followed the brainder.org/tag/palm blog post about installation of Octave through flatpak.

PALM opens in Octave but is failing when trying to read the input.

Reading input 1/1: int_4D_all.nii
error: multifile2mat: /home/admin/Documents/palm-alpha119/fileio/@file_array/private/file2mat.mex: failed to load: liboctinterp.so.6: cannot open shared object file: No such file or directory
error: called from
    subsref>multifile2mat at line 179 column 26
    subsref>subfun at line 99 column 7
    subsref at line 65 column 7
    subsref>rec at line 221 column 15
    subsref at line 45 column 11
    palm_ready at line 56 column 19
    palm_takeargs at line 1648 column 76
    palm_core at line 33 column 12
    palm at line 81 column 1

Someone posted a similar issue on the FSL mailing list but it shows no response to the issue.

When tracking this path /home/admin/Documents/palm-alpha119/fileio/@file_array/private/file2mat.mex the file exists. I think it is an issue of this octave dependcy liboctinterp.so.6. But I am unsure how to resolve it.

Has any one encounter this issue or know of a solution?

It was suggested elsewhere that I should reconfigure the .mex files to be compatible with my systems version of Octave and liboctinterp. To do this, I had to reconfigure the various .mex files that PALM needs to run. The reconfiguration ensured that the files were compatible with my version of Octave (not the default version upon the download of PALM). This should be done through the .c file, not directly in the .mex file.

I did this using

cd /home/admin/Documents/palm-alpha119/fileio/@file_array/private
mex file2mat.c

In my case, I had to do this for multiple files from PALM before it was able to run all the way through. However, the running of PALM (5000 permutation) took a long time (ca. 4 hours) where as it runs in 15 minutes when executing the same command with randomise.

The post and working solution can be found here.