iCoreTech Research Labs Just a placeholder

19Aug/0930

Install ImageMagick in Leopard / Snow Leopard

ImageMagick

This is a bash script that attempts to download, extract and compile what's required in order to successfully install ImageMagick on Snow Leopard.

Update: I moved the script on github.

Related posts:

  1. Install MySQL and MySQL Ruby gem on Snow Leopard, 64 bit
  2. Having fun with MacRuby on Snow Leopard
  3. Install Git from source on Snow Leopard 64 bit
  4. Install Passenger (mod_rails) in Snow Leopard 64 bit
  5. How to install Sphinx search engine in Snow Leopard, x86 and x86_64

Comments (30) Trackbacks (0)
  1. Thanks for this wunderful shell script!
    All runs now :)

  2. Hi.

    Thanks. This is the only reasonable install and compile description I could find that did not involve installing a parallel toolchain.

    A couple of notes.

    1) A couple of the sourceforge downloads fell over due to url or package name changes. No bother, just needed to check online and repair the urls.

    2) If you want to use perl magick, and are getting the error: “Can’t locate Image/Magick.pm in @INC” then you need to alter the ImageMagick /.configure to read:

    ./configure –prefix=/usr/local –disable-static –with-modules –without-magick-plus-plus –with-quantum-depth=8 –with-gs-font-dir=/usr/local/share/ghostscript/fonts

    (ie. remove the “–without-perl” from the command)

    And it will install the Magick.pm in the right place once you have made and made install

    Many thanks and good day to you.

    Michael

  3. @Michael
    meh, we can’t even trust sourceforge mirrors anymore ;) I updated the script to use heanet, should be good to go.

    thanks for pointing out the Perl installation, I admit that this script was primarly targeted to a Ruby/Ruby on Rails developer.

  4. Theres an error on this line:

    tar xzvf jpegsrc.v7.tar.gz
    cd jpeg-6b

    should be:
    tar xzvf jpegsrc.v7.tar.gz
    cd jpeg-7

  5. Hi,

    thanks, your script worked fine for me except that I get the following error in some ImageMagick commands:

    Magick::ImageMagickError: Wrong JPEG library version: library is 70, caller expects 62 `’ @ jpeg.c/EmitMessage/232

    Can anybody advice? What do I need to do?

  6. Hi Claudio,

    thanks for your effort! Just downloaded your script and ran it here on my 10.6.1 machine.
    However, the script ends with:

    ImageMagick installed.
    dyld: Library not loaded: /usr/X11/lib/libXext.6.dylib
      Referenced from: /Users/stefan/Applications/ImageMagick-6.5.5/bin/convert
      Reason: image not found
    ./install_im.sh: line 147: 79821 Trace/BPT trap          convert -version
    Testing...
    dyld: Library not loaded: /usr/X11/lib/libXext.6.dylib
      Referenced from: /Users/stefan/Applications/ImageMagick-6.5.5/lib/libMagickCore.2.dylib
      Reason: image not found
    ./install_im.sh: line 150: 79824 Trace/BPT trap          $CONFIGURE_PREFIX/bin/convert logo: logo.gif
    dyld: Library not loaded: /usr/X11/lib/libXext.6.dylib
      Referenced from: /Users/stefan/Applications/ImageMagick-6.5.5/lib/libMagickCore.2.dylib
      Reason: image not found
    ./install_im.sh: line 151: 79825 Trace/BPT trap          $CONFIGURE_PREFIX/bin/convert logo: logo.jpg
    dyld: Library not loaded: /usr/X11/lib/libXext.6.dylib
      Referenced from: /Users/stefan/Applications/ImageMagick-6.5.5/lib/libMagickCore.2.dylib
      Reason: image not found
    ./install_im.sh: line 152: 79826 Trace/BPT trap          $CONFIGURE_PREFIX/bin/convert logo: logo.png
    dyld: Library not loaded: /usr/X11/lib/libXext.6.dylib
      Referenced from: /Users/stefan/Applications/ImageMagick-6.5.5/lib/libMagickCore.2.dylib
      Reason: image not found
    ./install_im.sh: line 153: 79827 Trace/BPT trap          $CONFIGURE_PREFIX/bin/convert logo: logo.tiff
    Tests done.

    So, I suppose, a working X11 installation is needed for running ImageMagick, even if I’ll never use the display command?

    Cheers,
    Stefan.

    • hi Stefan,
      I never run into any problem without X11; however it seems that you are running ImageMagick-6.5.5 and in your Application directory, the script uses 6.5.6-10 and it installs in /usr/local by default.

      So I don’t know what’s going on on your system, try cleaning other ImageMagick versions before attempting to run the script.

      You may want also to try “which convert” to see where’s the current binary location.

  7. ciao Claudio, your script works ok, but I am having a heck of a day trying to understand why IM always complains about Wrong JPEG library version. Actually I am not using macports, and I’ve run several times your script after removing “redundants” file and libs from /usr/local/lib. Compilation is OK, anyway when it runs the tests it always fails with the dreaded error message:

    ImageMagick installed.
    Version: ImageMagick 6.5.6-10 2009-11-11 Q8 OpenMP http://www.imagemagick.org
    Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC

    Testing…
    convert: Wrong JPEG library version: library is 70, caller expects 62 `logo.jpg’ @ jpeg.c/EmitMessage/232.
    Tests done.

    any support on this would be highly appreciated. Ciao! :)

  8. @myself: I am such an “ass”

    actually i did it quire differently, since in a way or another I had another libjpeg messing with the convert task, i run “convert -list configure” and found the line that was messing with jpg convert

    LDFLAGS -L/usr/local/lib -L/usr/local/lib -L/sw/lib -L/usr/X11/lib -R/usr/X11/lib

    actually as you can see i got a previous fink install running on my macbookpro, reason why when trying to convert the jpg it was always complaining (loading the old 62 lib)

    So to fix the issue:

    1) be sure to remove your /sw folder (and opt/local if you are using macports)

    2) /usr/local/lib (just to be sure i got rid of all previous install files and ilbs)

    3) rerun your script as root from /usr/local/src (this is the folder that i use to build )

    … and then magically imagemagick builds and all tests pass and i can go back to my rails app and correctly upload jpegs:)

    grazie Claudio! good work with your script, so for anyone else dealing with this error just be sure to remove both macports and fink! wasted my whole afternoon after this!:)

  9. saved me a ton of trouble! THANK YOU !!

  10. Thanks for putting this together. I am excited about getting imagemagick working on 10.6.2.

    I am new to customizing os x server, although I am pretty comfortable with linux. Anyway, I hope you can offer a suggestion.

    The installed failed, the first error reported was immediately after downloading and decompressing files:
    Starting…
    checking for a BSD-compatible install… /usr/bin/install -c
    checking whether build environment is sane… configure: error: unsafe absolute working directory name
    make: *** No targets specified and no makefile found. Stop.

    TIA,

    – Mark

  11. Please disregard my previous note. For anyone who comes along behind me, here is what solved my problem: I thought about yortz’s post on Nov. 11, then deleted macports and related files in usr/local. More importantly, I ran the script in /usr/local as root. That was a key issue in my case.

    The script ran straight through, all tests worked and I was able to verify the version with the “identify” command.

    Thanks for taking the time to put this script together!

  12. Thanks for this script. Saved me from days of torment again. Worked first time for me on 10.6.2.

  13. Dude, this is awesome! Thanks for taking the time. Worked first time for me too, 10.6.2.

  14. Thanks kain, for sharing the script.

    I just chaged it to install the new ImageMagick-6.5.9-1 … everything worked quite well on 10.6.2!

    thx again!

  15. Don’t you miss a /fonts in line 144? Had some trouble with the fonts but other than that it worked great! Thanks a lot!

  16. Downloading http://heanet.dl.sourceforge.net/project/freetype/freetype2/2.3.11/freetype-2.3.11.tar.gz
    ls: freetype-2.3.11.tar.gz: No such file or directory
    Failed download: http://heanet.dl.sourceforge.net/project/freetype/freetype2/2.3.11/freetype-2.3.11.tar.gz, size: B, aborting.

    I have no idea why it is doing this, the url works fine when i try it in a browser

    Help?

  17. please delete last comment: permissions issue

  18. Thanks for making this script, it really saved me a lot of time.

    I updated the lib-png download URL, which was broken. For some reason they removed 1.2.42, so I bumped it up to 1.2.43 which allowed the script to install ImageMagick on Snow Leopard just fine, and it’s working great with Rmagick 2.13.0.

    lib-png 1.4 is available, but I dedicated to increment by only one minor version, to 1.2.43, in the interest of not rattling the cages of anything else that may depend on lib-png.

    I just sent a pull request, but if anyone comes across this before it gets merged in, here’s a link to the commit that fixes it – http://github.com/kjohnston/ImageMagick-sl/commit/a7bc1823ef4678d2673bf3c95902bbf6dc62ad4d

  19. thank you, this worked perfectly for me!

  20. masterkain, my apologies for the multiple commits. i’m new to github but needed to update the files (i didn’t realize i needed to update it in two places)

  21. quick question: after completing the install, i get these lines:
    —–
    ImageMagick installed.
    /usr/local/bin/install_im.sh: line 150: convert: command not found
    Testing…
    Tests done.
    —–
    Has anyone faced this issue?

    • by mistake in a pull request from another developer a CONFIGURE_PREFIX=/usr/local/ImageMagick slipped in instead of /usr/local, it is just been fixed in the repo

      • kain, i’m not sure if you got all 3 of my changes to the file. i changed the download link for libpng and ImageMagick but I forgot to change the folder names below that so I had a 3rd commit that changed those folder names as well. Should I commit the changes again?


Leave a comment


No trackbacks yet.

Additional comments powered by BackType