It seems the installation is complete, but you have an older version of the xz compression library installed in the /usr/local/opt/xz/ folder that isnât compatible with the version that MRtrix was compiled for, and that version happens to be the first one that the system comes across when trying to launch our commands.
To figure this out, can you tell us:
how did you install MRtrix? From source, or using one of our precompiled installers? If the latter, which one?
if from source, can you post the contents of your config file (in the MRtrix source folder)?
we need to figure out why /usr/local/opt/xz/, a non-standard location, is included in the library search path (i.e. why does it even try to load a library from there, rather than the standard system one?). Maybe you installed some other piece of software that needed it?
If you canât think of a reason, we need to figure out how to instruct the system not to look there. I suspect this will be due to having set some environment variables. Can you post the output of:
I suspect one of these will list the problematic folder. Youâd then need to figure out how to get rid of it. It will probably have been set in one of your shell startup files, e.g. ~/.profile, ~/.bashrc, ~/.zshrc, or something.
âecho $DYLD_LIBRARY_PATHâ -> /Applications/MNE-2.7.3-3268-MacOSX-i386/lib:/Applications/freesurfer/lib/gcc/lib
The âDYLD_FALLBACK_FRAMEWORK_PATHâ and âDYLD_FALLBACK_LIBRARY_PATHâ donât exist.
It seems the FreeSurfer uses the variable âDYLD_LIBRARY_PATHâ . After switching off the FreeSurfer, all the 3 environment variables donât exist. However, I am still unable to launch âmrviewâ after switching of the FreeSurfer:
dyld: Library not loaded: /usr/local/opt/xz/lib/liblzma.5.dylib
Referenced from: /usr/local/mrtrix3/lib/libmrtrix.dylib
Reason: Incompatible library version: libmrtrix.dylib requires version 8.0.0 or later, but liblzma.5.dylib provides version 6.0.0
/usr/local/bin/mrview: line 7: 10458 Abort trap: 6 "${f}"/MRView.app/Contents/MacOS/mrview "$@"
OK, a quick search throws up this similar issue. This suggests your XZ library comes from homebrew, and the suggested solution is to run brew update and brew upgrade.
Alternatively, you could simply try removing that package from your homebrew install (though only if nothing else depends on it!), or removing homebrew altogether (but only if you donât need it!).
mrview should be loading the liblzma library that comes bundled with macOS. The fact that it tries to load a version from homebrew, might be an indication that there is something unorthodox about your set up.
More generally, otool should show up only loading libraries that ship with macOS (i.e. from /usr/lib/ and /System/Library/Frameworks/) or libraries that are bundled with MRtrix (i.e. from @rpath/).
For reference, these are the libraries (and their locations!) that mrview should be loading:
Thank you. I have tried âbrew updateâ and âbrew upgradeâ but the error persisted. I also tried uninstalling the brew but didnât work either.
I checked the loading libraries and found:
âŚ
Load command 14
cmd LC_LOAD_DYLIB
cmdsize 56
name /usr/lib/liblzma.5.dylib (offset 24)
time stamp 2 Wed Dec 31 19:00:02 1969
current version 6.3.0
compatibility version 6.0.0
âŚ
The mrtrix3 indeed loaded the liblzma.5.dylib from the correct location. Itâs not clear why the error message showed something else.
Ok, then I think it is an outdated macos version. Which macos version are you running? I donât think our binaries support anything below 10.13 (High Sierra)
High Sierra should work! We just have not been able to test it ourselves⌠Probably we have to change our binary release to also include liblzma⌠If you can hold off updating, I can repackage our binary release with liblzma included.