OS X - Building Metapixel Under 10.5 Leopard

 

Metapixel is a really cool photomosaic generator written by Mark Probst. He distributes RPM and source code from his site, though I initially had some trouble installing under OS X 10.5. Eventually I was able to get Metapixel running under OS X 10.5, here's how it went.

First you must have XCode tools installed, you can install them off of your OS X disc or if you don't happen to have the disc handy, you can download them from Apple.

While running make I got this error.

# make
make -C rwimg
gcc -I/sw/include -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I. -Irwimg -Wall -O2   -DMETAPIXEL_VERSION=\"1.0.2\" -DRWIMG_PNG -DRWIMG_JPEG -DRWIMG_GIF -g -c rwpng.c
rwpng.c:28:17: error: png.h: No such file or directory
....more messages stating that you failed....
make[1]: *** [rwpng.o] Error 1
make: *** [librwimg] Error 2

The only really important parts, I marked in bold; pretty much rwpng can't find png.h, which is part of libpng.

I really like MacPorts, it makes installing GNU software extremely easy. It also has a port of libpng, which includes png.h. So, go download and install MacPorts, follow all the install instructions, then come back.

After you install MacPorts, you'll need to install libpng, giflib, jpeg, and possibly docbook-xml, thought I'm not 100% sure if you need it. You'll need to start the ports shell and get with the installing.

# sudo /opt/local/bin/port
> install libpng
....fetching, installing, blah blah blah
> install giflib
....fetching, installing, blah blah blah
> install jpeg
....fetching, installing, blah blah blah
> install docbook-xml
....fetching, installing, blah blah blah

Now you'll need to edit the Makefile, so open metapixel-1.0.2/Makefile in your favorite editor and get with the editing. There are only four lines you need to modify:
PREFIX = /opt/local
MANPAGE_XSL = /opt/local/share/xml/xsl/docbook-xsl/manpages/docbook.xsl
MACOS_LDOPTS = -L/opt/local/lib
MACOS_CCOPTS = -I/opt/local/include

Now, just do:
# make
# sudo make install

This will install metapixel in /opt/local/bin/, you can add that to your $PATH for easy access.
# export PATH=$PATH:/opt/local/bin/

Now get over to Derek Hildreth's Blog and learn How To Make Great Photo Mosaics with Metapixel!

And if you're too damn lazy to edit files or just can't figure it out, I attached a modified version of the metapixel source, below. I'm not responsible if you f* up your computer with it... though I doubt that would happen.

AttachmentSize
metapixel-1.0.2-Leopard.tar.gz203.68 KB