ImageMagick and OS X Lion trouble

MacosImagemagickHomebrewOsx LionDyld

Macos Problem Overview


[edit] I was troubleshooting problems with my development environment when I noticed one of my problems was the dependency on ImageMagick, since it's a vital part of my app.


After upgrading to OS X Lion (10.7) i no longer had ImageMagick available, i then tried installing again using MacPorts without success, i then installed from source, and the install wasn't very successfully i had convert and identify but it output error messages that i unfortunately dont have anymore, i by some strange reason decided to remove all of my MacPort libraries and started using Homebrew, i tried installing ImageMagick, it installs OK but when i try to use it throws this error

dyld: Library not loaded: /opt/local/lib/libltdl.7.dylib
  Referenced from: /usr/local/bin/convert
  Reason: Incompatible library version: convert requires version 11.0.0 or later, but libltdl.7.dylib provides version 10.0.0
Trace/BPT trap: 5

I read online but i have no clue on whats going on here, i found that libltdl is called libtool, and that i obviously need to upgrade it to a newer version, but i havent found any indication of how or where to find the source, or if this should be already be handled by homebrew and why it hasn't.

I tried installing ImageMagick again from source using this installer script https://github.com/masterkain/ImageMagick-sl but when i try to use convert it throws a similar error.

$ convert gnome.jpg -resize 50% gnome_.jpg
dyld: Library not loaded: /opt/local/lib/libltdl.7.dylib
  Referenced from: /usr/local/bin/convert
  Reason: Incompatible library version: convert requires version 11.0.0 or later, but libltdl.7.dylib provides version 10.0.0
Trace/BPT trap: 5

$ which convert
/usr/local/bin/convert

What can i do to solve my problem?

Macos Solutions


Solution 1 - Macos

On 10.8 I solved this issue with:

brew install libtool --universal
brew link libtool

If you don't know what brew is, visit https://github.com/mxcl/homebrew and its wiki.

Solution 2 - Macos

brew uninstall imagemagick
brew install imagemagick --build-from-source

worked for me

Solution 3 - Macos

I too use homebrew for installing packages but imagemagick stopped working after upgrading OSX 10.8 to 10.9 (Mavericks). I had to do the following steps:

brew uninstall imagemagick
brew uninstall libtool
brew install libtool --universal
brew install imagemagick --build-from-source

Why the --build-from-source? Well for me running brew install imagemagick on its own to install the pre-built binary wasn't sufficient; it fixed the original 'dyln' error but was replaced with:

unable to load module `/usr/local/Cellar/imagemagick/6.8.7-7/lib/ImageMagick//modules-Q16/coders/png.la': file not found @ error/module.c/OpenModule/1277

Solution 4 - Macos

I also upgraded to Lion and lost ImageMagick, although i'm getting different errors.

i found a Lion distribution on imagemagick.org. not a big fan of the DYLD_LIBRARY_PATH environment variable but it works.

ok scratch that. i just downloaded the ImageMagick source and re-compiled:

cd /tmp
curl -OL ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar -xzf ImageMagick.tar.gz
cd ImageMagick-6.7.2-7/
./configure --prefix=/usr/local --disable-static --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --disable-openmp --with-gs-font-dir=/usr/local/share/ghostscript/fonts
make
sudo make install

Solution 5 - Macos

On Mountain Lion OSX,

Even with the updated brew for imagemagick(which includes libtool), this error seemed to happen to me.

so i fixed it using the following commands

brew uninstall libtool
brew install libtool --universal
brew link libtool --force

Solution 6 - Macos

For others looking and still having trouble, I used this:

https://github.com/maddox/magick-installer

Solution 7 - Macos

On 10.8, with brew, I solved this issue with:

brew install graphicsmagick

For the googlers: If you happened to have it installed with brew beforehand, you'll need to reinstall by running brew uninstall graphicsmagick before installing again. Easy.

Solution 8 - Macos

This helped me after restoring OS X 10.9.3 from time machine.

brew uninstall imagemagick
brew uninstall libtool
brew install libtool --universal
brew unlink libtool && brew link libtool
brew install imagemagick
brew install Homebrew/python/pillow
brew link --overwrite pillow

Solution 9 - Macos

The same problem might occur with OSX Mountain Lion (preview 4). I had to configure some parts separately because there are some library incompatibilities:

dyld: Library not loaded: /usr/local/lib/libjpeg.8.dylib
  Referenced from: /usr/local/bin/convert
  Reason: Incompatible library version: convert requires version 13.0.0 or later, but libjpeg.8.dylib provides version 9.0.0

I had to add --with-fontconfig=no, --with-lzma=no and use /opt/local/share/... instead of /usr/local/share/... for the ghostscript fonts:

cd /tmp
curl -OL ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar -xzf ImageMagick.tar.gz
cd ImageMagick-6.7.8-0/
./configure --prefix=/usr/local --disable-static --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --disable-openmp --with-fontconfig=no --with-gs-font-dir=/opt/local/share/ghostscript/fonts --with-lzma=no
make
sudo make install

Solution 10 - Macos

I could fix the ImageMagick problem by installing corresponding package from cactuslab site.

Then by setting the PATH variables in terminal:

export MAGICK_HOME="/usr/local/ImageMagick/"
export PATH="$MAGICK_HOME/bin:$PATH"
export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/"

Solution 11 - Macos

If you're using Homebrew, try the following command:

brew doctor

to diagnose the common problems.

One of it could be to remove DYLD_FALLBACK_LIBRARY_PATH variable from your ~/.profile if you have it.

Or you have to re-install libtool by:

brew reinstall libtool --universal && brew unlink libtool && brew link libtool

Solution 12 - Macos

I tried most of the solutions above and they didn't work. Here's how I fixed my problem:

brew install imagemagick;
brew install freetype;
cd /usr/X11/lib/;    
sudo mv libfreetype.6.dylib libfreetype.6.dylib.orig;
sudo ln -s /usr/local/opt/freetype/lib/libfreetype.6.dylib libfreetype.6.dylib

Tested on OS X 10.7.2

Solution 13 - Macos

For 10.7.8 and up, you have to install the php version and not the pecl version. Depending on your version of php you've install with Macports you can either do:

sudo port install php-imagick

sudo port install php5-imagick

sudo port install php53-imagick

sudo port install php54-imagick

Remember only to do the one of your current version of php.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionrrocheView Question on Stackoverflow
Solution 1 - MacosLevBView Answer on Stackoverflow
Solution 2 - MacosjesuisbonbonView Answer on Stackoverflow
Solution 3 - MacosarooarooView Answer on Stackoverflow
Solution 4 - MacosfirienView Answer on Stackoverflow
Solution 5 - Macosarun15thmayView Answer on Stackoverflow
Solution 6 - Macos23inhouseView Answer on Stackoverflow
Solution 7 - MacostimoxleyView Answer on Stackoverflow
Solution 8 - MacosStanislav PisockijView Answer on Stackoverflow
Solution 9 - MacosteezeeView Answer on Stackoverflow
Solution 10 - MacosRaghava KotekarView Answer on Stackoverflow
Solution 11 - MacoskenorbView Answer on Stackoverflow
Solution 12 - MacosOlivier LalondeView Answer on Stackoverflow
Solution 13 - MacosDevin DixonView Answer on Stackoverflow