ImageMagick and OS X Lion trouble
Asked Answered
C

13

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?

Cyclopean answered 14/9, 2011 at 6:36 Comment(3)
This is clearly not too general. This is about a missing library: /opt/local/lib/libltdl.7.dylib. It should not have been closed.Anthropography
If you upgraded XCode, be sure to reinstall the Command Line Tools as recommended here: https://mcmap.net/q/121852/-lion-10-7-not-supporting-convert-1-dylib-error. 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.Hightower
Agreed, I might be able to reword the question as a programming question see if it gets reopenCyclopean
M
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
Mathur answered 17/9, 2011 at 21:21 Comment(4)
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?Floozy
I had originally used the install script mentioned by @Cyclopean 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.Mathur
the script mentioned by @23inhouse appears to work on mountain lionMathur
I ended up installing the command line tools from Xcode, which seems to install a relatively recent version of ImageMagick.Floozy
H
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.

Haughty answered 26/7, 2012 at 1:21 Comment(8)
Don't forget to install xquartz.macosforge.org/landing as well. And you're good to goXenolith
Worked for me without linking.Sirius
@user192411, because ImageMagick require libtool to be compiled.Haughty
Just brew install libtool appears to works just as well... Why the --universal and manual link call afterwards?Desecrate
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?Cerulean
To reinstall: brew reinstall libtool --universal && brew unlink libtool && brew link libtoolAculeate
see kenorb's answer: After mavericks upgrade you have to uninstall/reinstall libtool, even if the latest version is already installed.Quar
I had to uninstall both imagemagick and libtool and reinstall libtool with the --universal flag then install imagemagick again.Inane
S
66
brew uninstall imagemagick
brew install imagemagick --build-from-source

worked for me

Spraggins answered 1/12, 2012 at 8:58 Comment(6)
this is not necessary just do a brew install libtool (since the precompiled imagemagick misses to download this dependency)Asher
This worked for me too, thanks. even the brew install libtool was not working.Dentition
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`Housefather
reinstalling libtool did not help me, but this worked.Bickart
Worked for me on Mavericks (10.9.3).Selsyn
I had DYLD_LIBRARY_PATH exported from a previous manual installation which confused the brew installation. Close all terminals and retry.Cursorial
M
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
Mahayana answered 5/3, 2014 at 9:30 Comment(3)
I was getting this error with PNGs despite having libpng installed. Just doing the --build-from-source fixed it. :)Quiteria
I think all you need is to relink the packages. See this answer for a suggestion: apple.stackexchange.com/questions/123900/…Tinea
holy, you just solved me so much headache! currently this is the correct answer.Vivacity
M
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
Mathur answered 17/9, 2011 at 21:21 Comment(4)
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?Floozy
I had originally used the install script mentioned by @Cyclopean 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.Mathur
the script mentioned by @23inhouse appears to work on mountain lionMathur
I ended up installing the command line tools from Xcode, which seems to install a relatively recent version of ImageMagick.Floozy
V
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
Valer answered 23/3, 2013 at 11:13 Comment(1)
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.Valer
H
8

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

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

Heindrick answered 19/3, 2012 at 1:44 Comment(1)
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 accessAwning
T
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.

Tundra answered 30/7, 2012 at 15:56 Comment(0)
A
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
Aerialist answered 20/5, 2014 at 9:21 Comment(1)
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!Bukharin
L
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
Linet answered 2/7, 2012 at 14:54 Comment(0)
K
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/"
Krysta answered 17/10, 2012 at 14:31 Comment(0)
A
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
Aculeate answered 20/7, 2013 at 10:26 Comment(1)
Thanks dude brew doctor was the answer, I actually have other libraries being link.Erethism
K
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

Klan answered 8/10, 2012 at 12:25 Comment(2)
maybe we should start comparing our brew installed libsCyclopean
Here's the error message I was getting by the way: syskall.com/trouble-installing-imagemagick-on-os-x-1072 . Hope this fix works for someone else!Klan
H
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.

Heighten answered 21/6, 2013 at 15:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.