Dyld: Library not loaded error on OSX 10.13.4

Hello,

I just tried to update to MRtrix 3.0_RC3 and got the following error message when running mrview:

dyld: Library not loaded: /usr/local/opt/libtiff/lib/libtiff.5.dylib
Referenced from: /usr/local/Cellar/mrtrix3/bin/mrview
Reason: Incompatible library version: mrview requires version 9.0.0 or later, but libtiff.5.dylib provides version 6.0.0
Abort trap: 6

Thank you so much for any help with this.

Juan

Assuming libtiff was installed via homebrew, you have an up to date installation (brew upgrade libtiff), and that version is linked: brew switch libtiff 4.0.9_3, please check that the dylib version is what it should be:

otool -L /usr/local/opt/libtiff/lib/libtiff.5.dylib

/usr/local/opt/libtiff/lib/libtiff.5.dylib:
	/usr/local/opt/libtiff/lib/libtiff.5.dylib (compatibility version 9.0.0, current version 9.0.0)
	/usr/local/opt/xz/lib/liblzma.5.dylib (compatibility version 8.0.0, current version 8.3.0)
	/usr/local/opt/jpeg/lib/libjpeg.9.dylib (compatibility version 13.0.0, current version 13.0.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)

If this is correct, please report the output of
brew doctor

Thank you so much for your lighting fast response.

I have an up to date installation and I ran brew switch libtiff 4.0.9_3. I still got the same error message.

Running the otool command generates the following:

/usr/local/opt/libtiff/lib/libtiff.5.dylib:
/usr/local/opt/libtiff/lib/libtiff.5.dylib (compatibility version 9.0.0, current version 9.0.0)
/usr/local/opt/jpeg/lib/libjpeg.9.dylib (compatibility version 13.0.0, current version 13.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)

Here’s the output of brew doctor:

Warning: “config” scripts exist outside your system or Homebrew directories.
./configure scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following “config” scripts:
/Applications/freesurfer/fsfast/bin/fcseed-config
/Applications/freesurfer/fsfast/bin/funcroi-config

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn’t put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
/usr/local/lib/libtcl8.6.dylib
/usr/local/lib/libtk8.6.dylib

Warning: Unbrewed header files were found in /usr/local/include.
If you didn’t put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
/usr/local/include/fakemysql.h
/usr/local/include/fakepq.h
/usr/local/include/fakesql.h
/usr/local/include/itcl.h
/usr/local/include/itcl2TclOO.h
/usr/local/include/itclDecls.h
/usr/local/include/itclInt.h
/usr/local/include/itclIntDecls.h
/usr/local/include/itclMigrate2TclCore.h
/usr/local/include/itclTclIntStubsFcn.h
/usr/local/include/mysqlStubs.h
/usr/local/include/odbcStubs.h
/usr/local/include/pqStubs.h
/usr/local/include/tcl.h
/usr/local/include/tclDecls.h
/usr/local/include/tclOO.h
/usr/local/include/tclOODecls.h
/usr/local/include/tclPlatDecls.h
/usr/local/include/tclThread.h
/usr/local/include/tclTomMath.h
/usr/local/include/tclTomMathDecls.h
/usr/local/include/tdbc.h
/usr/local/include/tdbcDecls.h
/usr/local/include/tdbcInt.h
/usr/local/include/tk.h
/usr/local/include/tkDecls.h
/usr/local/include/tkPlatDecls.h

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn’t put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
/usr/local/lib/pkgconfig/tcl.pc
/usr/local/lib/pkgconfig/tk.pc

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn’t put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
/usr/local/lib/libtclstub8.6.a
/usr/local/lib/libtkstub8.6.a

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run brew link on these:
mrtrix3

Hm, not sure what is going on. Do you get any errors on brew unlink libtiff && brew link --verbose libtiff? I’d try reinstalling libtiff and then mrtrix3 but I am not sure that will help.

@maxpietsch, could this not have something to do with it…?

Not sure, but a simple check is brew unlink mrtrix3 && brew link mrtrix3. Look for errors in the output.

I don’t understand the error message, as mrview points to the correct dylib

I ran brew unlink libtiff && brew link --verbose libtiff (without error messages), which did not work. I then uninstalled and reinstalled both libtiff and mrtrix and it still does not work. However, the unlinked kegs in your Cellar for matrix3 message went away. The output from brew doctor was otherwise the same as before.

What does

locate libtiff.5.dylib

tell you? Any chance that you have anaconda with libtiff installed?

A workaround, if you do not need tiff support, would be to remove libtiff and reinstall mrtrix3. Not exactly a long term solution but I am running out of ideas…

locate revealed anaconda had libtiff installed (for a previous user of the computer):

/Applications/MATLAB/MATLAB_Compiler_Runtime/v83/bin/maci64/libtiff.5.dylib
/Applications/MATLAB_R2017b.app/bin/maci64/libtiff.5.dylib
/Users/narose/anaconda2/lib/libtiff.5.dylib
/Users/narose/anaconda2/pkgs/libtiff-4.0.6-1/lib/libtiff.5.dylib
/usr/local/Cellar/libtiff/4.0.9_3/lib/libtiff.5.dylib
/usr/local/fsl/bin/FSLeyes.app/Contents/Frameworks/libtiff.5.dylib
/usr/local/fsl/fslpython/envs/fslpython/lib/libtiff.5.dylib
/usr/local/fsl/fslpython/pkgs/libtiff-4.0.6-2/lib/libtiff.5.dylib
/usr/local/lib/libtiff.5.dylib

I uninstalled libtiff and re-installed mrtrix3. mrview now works. I don’t expect to need tiff support in mrtrix but it would be good to get mrtrix to work without this issue (particularly if removing the library is going to interfere with other applications using it, e.g., fsl).

Thanks a lot for all your help and if you have suggestions for how to get mrtrix working with tiff support, that’d be much appreciated.

Good that it works now. We issue a warning during installation of the homebrew package: warning: anaconda found in PATH. You might want to exclude those directories from you PATH. Unfortunately, there is little we can do about anaconda’s choices that mess with the include paths.