71

[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?

Blazej SLEBODA
  • 8,936
  • 7
  • 53
  • 93
rroche
  • 1,262
  • 1
  • 13
  • 29
  • This is clearly not too general. This is about a missing library: /opt/local/lib/libltdl.7.dylib. It should not have been closed. – superluminary Oct 25 '13 at 14:41
  • 1
    If you upgraded XCode, be sure to reinstall the Command Line Tools as recommended here: http://stackoverflow.com/a/6784216/102401. Also, I agree this should be reopened. I'm trying to tackle a specific programming issue where a script started reporting problems with ImageMagick and this is the first thing that came up when searching. None of the answers below worked, but I can't what did because the question is closed. – Alan W. Smith Oct 31 '13 at 15:45
  • Agreed, I might be able to reword the question as a programming question see if it gets reopen – rroche Oct 31 '13 at 16:50

13 Answers13

172

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.

Community
  • 1
  • 1
LevB
  • 2,326
  • 3
  • 16
  • 14
  • 10
    Don't forget to install http://xquartz.macosforge.org/landing/ as well. And you're good to go –  Jul 27 '12 at 09:14
  • Worked for me without linking. – Simon Perepelitsa Feb 05 '13 at 22:01
  • @user192411, because ImageMagick require libtool to be compiled. – LevB Feb 07 '13 at 19:00
  • 2
    Just `brew install libtool` appears to works just as well... Why the `--universal` and manual `link` call afterwards? – lhunath Feb 09 '13 at 14:47
  • 5
    This worked for me, though I had to do a `brew link libtool --force` since it was bitching about Keg-only installations. `brew doctor` also bitches about libtool. What's that about? – Drew Feb 17 '13 at 12:25
  • To reinstall: ```brew reinstall libtool --universal && brew unlink libtool && brew link libtool``` – kenorb Jul 20 '13 at 09:48
  • see kenorb's answer: After mavericks upgrade you have to uninstall/reinstall libtool, even if the latest version is already installed. – thewoolleyman Apr 16 '14 at 03:39
  • I had to uninstall both imagemagick and libtool and reinstall libtool with the --universal flag then install imagemagick again. – sholsinger Nov 21 '14 at 20:11
66
brew uninstall imagemagick
brew install imagemagick --build-from-source

worked for me

jesuisbonbon
  • 992
  • 8
  • 15
  • this is not necessary just do a `brew install libtool` (since the precompiled imagemagick misses to download this dependency) – bernstein Feb 10 '13 at 00:58
  • 3
    This worked for me too, thanks. even the brew install libtool was not working. – SJP Mar 04 '13 at 20:58
  • Saved my build of octave. I also had to do `brew unlink libtool && brew link libtool`, `brew uninstall imagemagick`, brew install imagemagick --build-from-source`, then `brew link --overwrite imagemagick` – Alan Thompson Jun 12 '14 at 22:52
  • reinstalling libtool did not help me, but this worked. – Meekohi Jun 30 '14 at 20:36
  • Worked for me on Mavericks (10.9.3). – Jonik Aug 21 '14 at 14:15
  • I had ```DYLD_LIBRARY_PATH``` exported from a previous manual installation which confused the brew installation. Close all terminals and retry. – Gerold Meisinger Jun 15 '16 at 07:08
30

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
andyroberts
  • 3,458
  • 2
  • 37
  • 40
  • 3
    I was getting this error with PNGs despite having libpng installed. Just doing the --build-from-source fixed it. :) – fregas Mar 27 '14 at 19:56
  • 1
    I think all you need is to relink the packages. See this answer for a suggestion: https://apple.stackexchange.com/questions/123900/is-there-a-quick-way-to-relink-my-homebrew-kegs/123991#123991?newreg=f15c2f7e904f4de286b2d8b771b63d6f – Pedro Sep 06 '14 at 05:30
  • holy, you just solved me so much headache! currently this is the correct answer. – typeoneerror Dec 06 '14 at 01:38
27

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
Glorfindel
  • 21,988
  • 13
  • 81
  • 109
firien
  • 1,548
  • 16
  • 23
  • 1
    Howdy I tried this on a fresh Mountain lion install and it fails at the configuration stage `configure: error: libltdl is required for modules build`. I am relatively new to compiling and installing binaries from source, can you provide a suggested best method to installing the required `libltdl` library? – Rider_X Nov 08 '12 at 16:18
  • 3
    I had originally used the [install script](https://github.com/masterkain/ImageMagick-sl) mentioned by @rroche on my snow leopard install. After the Lion upgrade i was able to use the code above because i had all the library dependencies installed already. The above code will NOT work on a fresh install. – firien Nov 09 '12 at 18:30
  • the [script](https://github.com/maddox/magick-installer) mentioned by @23inhouse appears to [work on mountain lion](https://github.com/maddox/magick-installer/pull/35) – firien Nov 09 '12 at 18:32
  • I ended up installing the command line tools from Xcode, which seems to install a relatively recent version of ImageMagick. – Rider_X Nov 12 '12 at 00:38
18

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
arun15thmay
  • 1,062
  • 1
  • 9
  • 19
  • universal gives a single binary file which can be used for both 32bit and 64bit architectures. I think this is needed for Imagemagick to work. – arun15thmay Apr 12 '13 at 10:48
8

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

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

23inhouse
  • 1,889
  • 19
  • 18
  • This doesnt play as nice with homebrew, as linkingvia `brew link` is done. Manual links might/may/likely willl need to be done afterwards for complete access – chris Frisina Jan 12 '13 at 19:00
7

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.

timoxley
  • 5,156
  • 3
  • 36
  • 40
7

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
  • and on El Capitan (10.11). I additionally needed to `chown -R myusername` a few folders (`/usr/local/bin`, `/usr/local/share`, `/usr/local/etc`), and replace the last line with `brew unlink pillow && brew link pillow`. Thanks a ton! – michele b Nov 24 '15 at 10:42
4

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
teezee
  • 51
  • 3
4

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/"
kenorb
  • 155,785
  • 88
  • 678
  • 743
Raghava Kotekar
  • 471
  • 5
  • 8
3

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
kenorb
  • 155,785
  • 88
  • 678
  • 743
1

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

Olivier Lalonde
  • 19,423
  • 28
  • 76
  • 91
1

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.

Devin Dixon
  • 11,553
  • 24
  • 86
  • 167