[pHash-support] OS X compilation report, solutions

dstarkweather at phash.org dstarkweather at phash.org
Sun Jul 25 19:40:12 PDT 2010

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

Thanks michael for the comments.

> 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.

This looks like an acceptable solution.  The linux code uses the c99
complex data types.  On windows we just had to implement our own complex.h
header file.  Perhaps this could be included in linux as well.

> 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 audio hash is the one that needs the complex.h file.

> 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
> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers/jni.h,
> 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.

Yes. Thanks for the suggestion.

> Hope this helps, and thanks again for the library.
> regards
> Michael Ashton
> --
> Quidquid latine dictum sit, altum viditur.
> _______________________________________________
> pHash-support mailing list
> pHash-support at lists.phash.org
> http://lists.phash.org/listinfo.cgi/phash-support-phash.org

More information about the pHash-support mailing list