External Email - Use Caution        


The  .mexa64 file is a matlab shared library and that error is from the linker saying it is not allowed to link in that library.  Note that it did not say there was a permission denied error or that the .mexa64 file could not be found.   This Mathworks posting indicates that error can happen on systems when SElinux security is enabled,

https://www.mathworks.com/matlabcentral/answers/103108-why-do-i-get-an-error-when-running-the-mex-file-from-a-non-standard-location-on-selinux

This part of LD_LIBRARY_PATH looks like the standard setting after running fs_install_mcr script with the Matlab runtime environment installed in the freesurfer distribution.  I'm assuming accessing MALAB runtime environment this way is already known to work on your cluster and does not generate any run time linker errors.

LD_LIBRARY_PATH is .:/usr/local/freesurfer/7.1.1//MCRv84//runtime/glnxa64:/usr/local/freesurfer/7.1.1//MCRv84//bin/glnxa64:/usr/local/freesurfer/7.1.1//MCRv84//sys/os/glnxa64:/usr/local/freesurfer/7.1.1//MCRv84//sys/java/jre/glnxa64/jre/lib/amd64/native_threads:/usr/local/freesurfer/7.1.1//MCRv84//sys/java/jre/glnxa64/jre/lib/amd64/server:/usr/local/freesurfer/7.1.1//MCRv84//sys/java/jre/glnxa64/jre/lib/amd64/client:/usr/local/freesurfer/7.1.1//MCRv84//sys/java/jre/glnxa64/jre/lib/amd64:/usr/local/freesurfer/7.1.1//lib/vtk/lib
- but the path to that .mexa64 file is not part of the standard LD_LIBRARY_PATH settings and looks like it is on some temporary mount point,

/tmp/MCR_65032579/.mcrCache8.4/segmen0/autofs/space/panamint_005/users/iglesias/software/freesurfer.GEMS2.terrier/bin/kvlGEMSMatlab.mexa64': /tmp/MCR_65032579/.mcrCache8.4/segmen0/autofs/space/panamint_005/users/iglesias/software/freesurfer.GEMS2.terrier/bin/kvlGEMSMatlab.mexa64

- so I'm guessing there is some system and/or security setting that does not allow loading 3rd party libraries from paths like that.   I would ask your IT folks about it.  I could be wrong, but if kvlGEMSMatlab.mexa64 needed to be re-compiled to run on your system, then I would expect to see a different error.

-R.


On 6/27/23 22:08, Mengjie Huang (mhua0773@uni.sydney.edu.au) wrote:

Invalid MEX-file '/tmp/MCR_65032579/.mcrCache8.4/segmen0/autofs/space/panamint_005/users/iglesias/software/freesurfer.GEMS2.terrier/bin/kvlGEMSMatlab.mexa64' : failed to map segment from shared object: Operation not permitted