19Aug/0930
Install ImageMagick in Leopard / Snow Leopard

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:
- Install MySQL and MySQL Ruby gem on Snow Leopard, 64 bit
- Having fun with MacRuby on Snow Leopard
- Install Git from source on Snow Leopard 64 bit
- Install Passenger (mod_rails) in Snow Leopard 64 bit
- How to install Sphinx search engine in Snow Leopard, x86 and x86_64
Enjoy this article?
Additional comments powered by BackType
September 4th, 2009 - 16:24
Thanks for this wunderful shell script!
All runs now :)
September 6th, 2009 - 09:21
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
September 6th, 2009 - 10:01
@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.
September 8th, 2009 - 20:42
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
September 8th, 2009 - 20:44
@Dan McGrady
thanks for spotting this, post fixed.
November 2nd, 2009 - 09:41
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?
November 2nd, 2009 - 12:18
Reported here: http://github.com/masterkain/ImageMagick-sl/issues/#issue/1 macports issue
November 5th, 2009 - 20:06
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:
So, I suppose, a working X11 installation is needed for running ImageMagick, even if I’ll never use the display command?
Cheers,
Stefan.
November 5th, 2009 - 21:49
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.
November 11th, 2009 - 18:22
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! :)
November 11th, 2009 - 18:55
hi yortz,
can you please run
and see if there’s some result? note that locate.updatedb may require some time to finish.
November 11th, 2009 - 19:03
@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!:)
November 11th, 2009 - 19:04
hey yortz, glad you sorted that out and posted the solution here, thanks!
November 12th, 2009 - 00:44
saved me a ton of trouble! THANK YOU !!
December 14th, 2009 - 00:05
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
December 14th, 2009 - 20:26
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!
January 11th, 2010 - 01:28
Thanks for this script. Saved me from days of torment again. Worked first time for me on 10.6.2.
January 14th, 2010 - 21:27
Dude, this is awesome! Thanks for taking the time. Worked first time for me too, 10.6.2.
February 4th, 2010 - 00:39
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!
February 18th, 2010 - 14:33
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!
February 24th, 2010 - 15:53
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?
February 24th, 2010 - 16:04
please delete last comment: permissions issue
February 28th, 2010 - 20:08
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
February 28th, 2010 - 20:17
hello,
thanks, I merged the commit.
cheers
March 17th, 2010 - 14:46
thank you, this worked perfectly for me!
July 13th, 2010 - 23:19
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)
July 13th, 2010 - 23:21
absolutely no problem, thanks for contributing!
July 14th, 2010 - 00:27
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?
July 14th, 2010 - 00:33
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
July 14th, 2010 - 01:31
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?