Dyld: Library not loaded: /usr/local/lib/libgsl.0.dylib

Hello all,
I am receiving the error message below when I type mrview at the command prompt. A previous version of Mrtrix3 was previously working very well on this Mac (OS El Capitan) and I followed the macOS instructions on how to keep my installation up to date (Keeping Mrtrix3 up to date). Now I cannot open mrview.

bash-3.2$ mrview
dyld: Library not loaded: /usr/local/lib/libgsl.0.dylib
  Referenced from: /Users/helencarlson1/mrtrix3/bin/mrview
  Reason: no suitable image found.  Did find:
	/System/Library/Frameworks/JavaVM.framework/JavaVM/libgsl.0.dylib: stat() failed with errno=20
Trace/BPT trap: 5
bash-3.2$ 

I also encounter a similar error when I type mrconvert -version:

bash-3.2$ mrconvert -version
dyld: Library not loaded: /usr/local/lib/libgsl.0.dylib
  Referenced from: /Users/helencarlson1/mrtrix3/bin/mrconvert
  Reason: no suitable image found.  Did find:
	/System/Library/Frameworks/JavaVM.framework/JavaVM/libgsl.0.dylib: stat() failed with errno=20
Trace/BPT trap: 5
bash-3.2$

Thank-you in advance for any help you can give me.
Helen.

I am not sure why you get this error, I believe we’re not using GNU GSL anymore? Are you shure that this is an up to date version of MRtrix?

In any case, if you have homebrew installed, brew install gsl might fix this library problem. Also, you might want to run brew doctor to check your system configuration.

As @maxpietsch says: you shouldn’t be needing the GSL library (libgsl.0.dylib) on a recent version of MRtrix3 (as of March 2016). Can you report the output of these commands:

cd /Users/helencarlson1/mrtrix3/
git describe
cat config

That might give us an idea of what’s going on…

One more command to run while you’re at it:

otool -L /Users/helencarlson1/mrtrix3/bin/mrview

On a colleague’s macbook pro, this gives:

$ otool -L /usr/local/bin/mrview
/usr/local/bin/mrview:
       @rpath/libmrtrix-4901e0f617c4ef50cb83063962f894c93c9a1377.dylib (compatibility version 0.0.0, current version 0.0.0)
       /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8)
       /usr/local/opt/qt5/lib/QtOpenGL.framework/Versions/5/QtOpenGL (compatibility version 5.7.0, current version 5.7.0)
       /usr/local/opt/qt5/lib/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.7.0, current version 5.7.0)
       /usr/local/opt/qt5/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.7.0, current version 5.7.0)
       /usr/local/opt/qt5/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.7.0, current version 5.7.0)
       /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
       /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
       /usr/local/opt/qt5/lib/QtSvg.framework/Versions/5/QtSvg (compatibility version 5.7.0, current version 5.7.0)
       /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
       /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
       /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
       /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)

No hint of libgsl here…

Yes this does seem very strange since MRtrix no longer uses GSL. I do think it is an up to date version of MRtrix since I did git pull and ./build which I thought retrieved the latest version. We have been using this progam for a while now so maybe there is some sort of interaction between the new and very old versions.

Here is what I have tried after I read your posts:

  1. I reinstalled gsl using brew install gsl and it installed successfully, however did not fix the problem (same Dyld error).
  2. I ran brew doctor and ended up with a bunch of warnings but no errors. Among these were requests for me to update both XCode and XQuartz which I have done.
  3. brew doctor also included this warning. Can these dylibs be causing the problem and can I safely delete them? If so what is the safest way to do this?
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didnt put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
  /usr/local/lib/libmrtrix-0_2_12.dylib
  /usr/local/lib/libtcl8.6.dylib
  /usr/local/lib/libtk8.6.dylib
  1. When I run the commands you suggested, the output is below. Could it be that my Qt5 is installed in a strange place?
bash-3.2$ cd /Users/helencarlson1/mrtrix3/
bash-3.2$ git describe
0.3.15-517-g04628fb
bash-3.2$ cat config
cat: config: No such file or directory
bash-3.2$ otool -L /Users/helencarlson1/mrtrix3/bin/mrview
/Users/helencarlson1/mrtrix3/bin/mrview:
	@rpath/libmrtrix.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
	/usr/local/lib/libgsl.0.dylib (compatibility version 18.0.0, current version 18.0.0)
	/usr/local/lib/libgslcblas.0.dylib (compatibility version 1.0.0, current version 1.0.0)
	/Applications/Qt5.2.0/5.2.0/clang_64/lib/QtSvg.framework/Versions/5/QtSvg (compatibility version 5.2.0, current version 5.2.0)
	/Applications/Qt5.2.0/5.2.0/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.2.0, current version 5.2.0)
	/Applications/Qt5.2.0/5.2.0/clang_64/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.2.0, current version 5.2.0)
	/Applications/Qt5.2.0/5.2.0/clang_64/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.2.0, current version 5.2.0)
	/Applications/Qt5.2.0/5.2.0/clang_64/lib/QtOpenGL.framework/Versions/5/QtOpenGL (compatibility version 5.2.0, current version 5.2.0)
	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
bash-3.2$ 

Thanks very much
Helen

Ok, you are running an older version, but it is more recent than the GSL removal, so that’s not the issue. One thing though is that it’s a good idea to run ./configure before ./build after a git pull, particularly if updating to a new release. But that’s not the issue here.

The fact that you don’t have a config file is probably because in this older version, it was called default.config (or was it config.default…?) - see if you can cat that.

If you can’t find either of these files, see if you have a release/ folder in there. In this case, the config file is release/config, and that will show the parameters of the build (what I’m after here). But more to the point: if you have a release/ folder, then the executables for that version would be in /Users/helencarlson1/mrtrix3/release/bin/, not in /Users/helencarlson1/mrtrix3/bin/ as your current posts suggest. So in this case, it’s likely that your PATH is still pointing at the folder containing the executables from a (possibly much) older version. This would explain why those executables are linked against the GSL libraries… and would imply that you have been using this older version all this time, rather than the version you expected.

This is unfortunately not an unexpected error… We did try to make this clear in the relevant release statement, but I’m not surprised that people would have missed it - particularly if you’d skipped that version… Recent versions now have explicit checks to avoid this issue (leftover executables from a previous installation get automatically removed if found), but not these older ones unfortunately…

So if that’s the issue, then you might as well update to the latest release (3.0_RC2)… Or better, hold on a few days for the fresh release that we are about to push out very soon, and update then.

Hello all
My MRtrix is working again now. As you mentioned, I just needed to edit my PATH to point to /mrtrix3/release/bin rather than /mrtrix3/bin. I must have missed that a while ago when doing the original update.

I do still think I am running an older version as indicated here:

bash-3.2$ cd mrtrix3
bash-3.2$ git describe
0.3.15-517-g04628fb
bash-3.2$

But when I try to update to the latest version I get several “Permission denied” errors:

bash-3.2$ git pull
error: cannot update the ref 'refs/remotes/origin/denoising_updates': unable to append to '.git/logs/refs/remotes/origin/denoising_updates': Permission denied
From https://github.com/jdtournier/mrtrix3
 ! ccffde7..403d358  denoising_updates -> origin/denoising_updates  (unable to update local ref)
error: cannot update the ref 'refs/remotes/origin/doctest': unable to append to '.git/logs/refs/remotes/origin/doctest': Permission denied
 ! fd40042...2081bbb doctest           -> origin/doctest  (unable to update local ref)
error: cannot update the ref 'refs/remotes/origin/mesh_act': unable to append to '.git/logs/refs/remotes/origin/mesh_act': Permission denied
 ! 2d26b03..bef5a9b  mesh_act          -> origin/mesh_act  (unable to update local ref)
error: cannot update the ref 'refs/remotes/origin/mrreg': unable to append to '.git/logs/refs/remotes/origin/mrreg': Permission denied
 ! dcc8381..34db780  mrreg             -> origin/mrreg  (unable to update local ref)
bash-3.2$

After doing a ./configure and a ./build that appear successful I am still running an old version:

bash-3.2$ git describe
0.3.15-517-g04628fb

Sorry for so much hassle, I can wait until the new version comes out to upgrade if that is easier.
Cheers
Helen

No problem, good to hear we’ve at least figured out the problem. Regarding your failure to update via git, the error messages clearly indicate a local permissions problem within the internal git structure (within the .git/ folder). Most likely reason might be that you tried to use git as the root user (i.e. admin, maybe using sudo?). There’s a bunch of possibilities here:

  • you own the files, but the permissions are set such that you don’t have write permissions
  • the files are owned by the root user

Simplest way to fix is probably:

sudo chown -R <your user name> .git/
chmod -R u+rw .git/

That might fix it… Otherwise, it might just be easier to delete that folder and start afresh (although you might not have permissions to delete the folder for the same reason as above…). This should be simple since you’ve already installed all the dependencies:

git clone https://github.com/mrtrix3/mrtrix3.git
cd mrtrix3
./configure
./build
./set_path

Wow, thanks so much. That worked like a dream. My version is now updated.

bash-3.2$ cd mrtrix3
bash-3.2$ git describe
3.0_RC2-102-g6f10915

I am excited to try out all the new stuff in RC2.
Cheers
Helen.