[pHash-support] OS X compilation report, solutions

Michael Ashton data at gtf.org
Sun Jul 25 17:20:28 PDT 2010

Hello all,

Thanks for writing this library -- it's amazing for something like this to
be freely available.

I had a little trouble compiling release 0.9.1 on OS X, and I'd like to let
everybody know how I compiled it.

My system is a MacBook Pro, with a Core 2 Duo (therefore 64-bit), running OS
X 10.6.4.  I used Homebrew to install all of the dependencies except CImg,
which is a single header file; I copied it into the src/ directory.  The
compiler was G++ 4.2.1, as shipped with XCode 3.2.2.

The first problem I had involved complex.h.  The compilation failed with a
very long string of errors, complaining about C template linkage, among
other things.  The problem was with complex.h, included from ph_fft.h.  On
this system, the C++ header <complex> is loaded instead of the C header
<complex.h>.  To force it to load the C header, I changed the #include line
to #include "/usr/include/complex.h".  I'm sure there's a more portable way
to do this, but this worked for me.

The second problem was with configure.  Since I didn't need video or image
hashing, I tried disabling the video and image hash functions using
--enable-image-hash=no and --enable-video-hash=no, hoping that the complex.h
problem might go away.  However, one of the link steps was still looking for
the video hash (I think), even with the configure flags.

The third problem was with Java.  On OS X, the Java SDK is kept in a
framework, which means that the directory structure is a bit unusual.  The
path to jni.h on my system is
so that directory needs to be included.  I'm not sure where the best place
is to put that path, though -- the Autoconf macros try an autodetection
based on locate, but locate isn't activated by default on recent OS X
machines, being supplanted by Spotlight.  Maybe an explicit option or
platform detection would be in order.

Hope this helps, and thanks again for the library.

Michael Ashton

Quidquid latine dictum sit, altum viditur.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phash.org/pipermail/phash-support-phash.org/attachments/20100725/eaa49d5a/attachment-0001.htm>

More information about the pHash-support mailing list