8
  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

dev4life
  • 10,785
  • 6
  • 60
  • 73
  • 3
    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 Nov 24 '17 at 18:37
  • Thanks @MarkSetchell, but the reason being I want to get to the bottom of this annoying error. – dev4life Nov 24 '17 at 18:46
  • 3
    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 Nov 24 '17 at 20:38
  • 1
    @MarkSetchell you just solved the error! Thank man. – dev4life Nov 25 '17 at 00:24
  • 1
    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 Nov 25 '17 at 12:50

2 Answers2

10

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"
dev4life
  • 10,785
  • 6
  • 60
  • 73
0

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)
Konchog
  • 1,920
  • 19
  • 23