External Email - Use Caution        

Below, an issue, and solution to matlab runtime libraries with freesurfer8 on Ubuntu 24.

I was trying to use the AANSegment tool: https://surfer.nmr.mgh.harvard.edu/fswiki/AANSegment

And came across some problems (now solved).

1) The utility uses the Matlab runtime. I have freesurfer 8 installed, but the instructions on that page (and also the
MatlabRuntime page) only refer to version 6 and 7. Could this be updated?

2) Having got the right matlab version, I ran into problems with missing libraries.
Discussing this with our IT team, they said:

"The problem is that the MCR runtime is supplying its own version of libstdc++ (the GLIBC C++ standard library) which is conflicting with other software/libraries which are loaded at the same time, namely /lib/x86_64-linux-gnu/libitkvnl_algo-5.3.so.1 (probably some other code/application which is part of freesurfer is wanting that library).

So the MCR runtime is adjusting the library path to load its own libstdc++ library (an older version), but other code which is running wants libitkvnl_algo-5.3.so.1 which in turn wants the (later) version of libstdc++ which is included as part of the Ubuntu 24 OS."

Their solution was to replace the library in the MCR directory with a symbolic link to the ubuntu system one.
ie that
/usr/local/freesurfer/8.2.0/MCRv97/sys/os/glnxa64/libstdc++.so.6
is now a symbolic link to
/lib/x86_64-linux-gnu/libstdc++.so.6

which seemed to solve the problem.

Best wishes

Michael

Michael Firbank       #mynameis   [my-kel fur-bank]                                                                 
Newcastle University
Health Innovation Neighbourhood (formerly Campus for Ageing and Vitality)
Newcastle upon Tyne, NE4 5PL