7
votes
  1. I downloaded ImageMagick from https://www.imagemagick.org/script/download.php#macosx
  2. extracted it to ~/Documents/software
  3. my .profile looks like this:
export MAGICK_HOME="~/Documents/software/ImageMagick-7.0.7"
export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/"
export PATH="$MAGICK_HOME/bin:$PATH"
  1. when I run convert I get:

dyld: Library not loaded: /ImageMagick-7.0.7/lib/libMagickCore-7.Q16HDRI.4.dylib
Referenced from: /Users/oa/Documents/software/ImageMagick-7.0.7/bin/convert
Reason: image not found Abort trap: 6

2
Any reason not to use homebrew? It is miles easier to manage all your packages that way - i.e. brew install imagemagick and you are done.Mark Setchell
Thanks @MarkSetchell, but the reason being I want to get to the bottom of this annoying error.oabarca
First, try using $HOME instead of ~ as that works in more shells. Second, try using otool -L /Users/oa/Documents/software/ImageMagick-7.0.7/bin/convert to see what your convert binary actually needs/wants. Also, try DYLD_PRINT_LIBRARIES=1 DYLD_PRINT_LIBRARIES_POST_LAUNCH=1 convert ... to debug dynamic link libraries. Finally, resort to homebrew ;-)Mark Setchell
@MarkSetchell you just solved the error! Thank man.oabarca
Pleasure! Feel free to write up the bit that helped and put it as an answer for all to see. Good luck with your project!Mark Setchell

2 Answers

10
votes

As suggested by @Mark Setchell, the solution was to replace ~ by $HOME. Therefore, the export commands should be:

export MAGICK_HOME="$HOME/Documents/software/ImageMagick-7.0.7"
export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/"
export PATH="$MAGICK_HOME/bin:$PATH"
0
votes

For those who do not use brew, using otool -L shows the problem:

    /ImageMagick-7.0.10/lib/libMagickCore-7.Q16HDRI.8.dylib (compatibility version 9.0.0, current version 9.0.0)
    /ImageMagick-7.0.10/lib/libMagickWand-7.Q16HDRI.8.dylib (compatibility version 9.0.0, current version 9.0.0)
    /opt/X11/lib/libfreetype.6.dylib (compatibility version 19.0.0, current version 19.6.0)
    /opt/X11/lib/libpng16.16.dylib (compatibility version 43.0.0, current version 43.0.0)
    /opt/X11/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
    /opt/X11/lib/libXt.6.dylib (compatibility version 7.0.0, current version 7.0.0)
    /usr/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version 1.0.5)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0)
    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.0.0)
    /opt/X11/lib/libSM.6.dylib (compatibility version 7.0.0, current version 7.1.0)
    /opt/X11/lib/libICE.6.dylib (compatibility version 10.0.0, current version 10.0.0)
    /opt/X11/lib/libX11.6.dylib (compatibility version 10.0.0, current version 10.0.0)