[pHash-support] 2 compilation errors

Evan Klinger eklinger at phash.org
Sat Apr 27 21:42:58 PDT 2013


On Fri, Apr 26, 2013 at 6:31 PM, Ricky Huang <rhuang.work at gmail.com> wrote:

> Hello all,
>
> I am currently running an amd64 based FreeBSD 9.0.  While compiling
> the pHash-0.9.6 I came across the following compilation errors:
>
> Build with:
>   # ./configure --enable-video-hash=no --enable-audio-hash=no
>   # make
>
> I get
>   pHash.cpp:44: error: 'HW_AVAILCPU' was not declared in this scope
>
> My workaround was to run "sysctl hw.ncpu" on the command line, edit
> src/pHash.cpp, and replace HW_AVAILCPU with that value.
>
> ---
>
> After the above is fixed, I get the following error when I "make"
>
> libtool: link: g++ -O2 -ffast-math -O3 -o .libs/test_texthash
> test_texthash.o  -L/usr/local/lib ../src/.libs/libpHash.so -lpng
> /usr/local/lib/libjpeg.so /usr/local/lib/libfftw3.so -lm -Wl,-rpath
> -Wl,/usr/local/lib
> ../src/.libs/libpHash.so: undefined reference to `pthread_create'
>
> My workaround for the above is to run configure like the
> following: ./configure --enable-video-hash=no --enable-audio-hash=no
> LDFLAGS='-lpthread'
>
>
> Question are:
> 1)  Is HW_AVAILCPU something available in FreeBSD?  Am I missing some
> header files?
>

It looks like it is not. It should be HW_NCPU. This will be fixed in the
next release. Thanks for bringing it up.

2)  Shouldn't the requirement for pthread library be part of the configure
> and not something I have to provide by hand?
>
> Yes it should be. We will likely be switching to the cmake build system
soon which will simplify the configuration and building process.

Evan

>
>
> Thanks!
>
> _______________________________________________
> pHash-support mailing list
> pHash-support at lists.phash.org
> http://lists.phash.org/listinfo.cgi/phash-support-phash.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phash.org/pipermail/phash-support-phash.org/attachments/20130427/e28a0611/attachment-0001.htm>


More information about the pHash-support mailing list