go-phash icon indicating copy to clipboard operation
go-phash copied to clipboard

During build process of go-phash fails

Open myusuf3 opened this issue 9 years ago • 6 comments

During the build I get the following error I am not sue if this is incompatibility with new CImg.h or not.

In file included from /usr/include/pHash.h:50:0, from ../.go_workspace/src/github.com/kavu/go-phash/phash.cpp:7: /usr/include/CImg.h: In member function ‘cimg_library::CImg<T>& cimg_library::CImg<T>::draw_spline(int, int, float, float, int, int, float, float, const cimg_library::CImg<t>&, int, int, int, int, float, float, unsigned int, bool)’: /usr/include/CImg.h:27246:18: error: declaration of ‘float t’ for (float t = 0; t<1; t+=_precision) { ^ /usr/include/CImg.h:27222:14: error: shadows template parm ‘class t’ template<typename t>

myusuf3 avatar Dec 28 '15 20:12 myusuf3

Do you know what version of pHash is installed? And did you installed CImg separately?

kavu avatar Dec 28 '15 20:12 kavu

I installed latest cimg-dev on ubuntu. I am currently using the version provided in this library, here is the H file that the error is referring to though is in the include directory.

myusuf3 avatar Jan 08 '16 23:01 myusuf3

I have also install latest libphash0 and libphash-dev

myusuf3 avatar Jan 10 '16 22:01 myusuf3

@myusuf3 can you provide the following information:

  • Ubuntu disto version
  • How CImg installed? libcimg-dev from Ubuntu packages? What version?
  • What version of libphash0 and libphash-dev?

kavu avatar Jan 11 '16 08:01 kavu

i am on 12.04 I am installing it as libcimg-dev from apt the most current versions.

myusuf3 avatar Jan 11 '16 17:01 myusuf3

@myusuf3, I just ran tests on fresh Ubuntu 12.04.5 Digital Ocean droplet with this script:

#!/bin/sh

wget https://godeb.s3.amazonaws.com/godeb-amd64.tar.gz
tar xzvf godeb-amd64.tar.gz

./godeb install 1.5.2
dpkg -i go_1.5.2-godeb1_amd64.deb

aptitude update
aptitude upgrade -y
aptitude install -y libphash0-dev cimg-dev git pkg-config graphicsmagick graphicsmagick-imagemagick-compat build-essential gcc

mkdir GOPATH
export GOPATH=/root/GOPATH

go get github.com/kavu/go-phash
cd /root/GOPATH/src/github.com/kavu/go-phash/
go test -v ./...

You could try yourself, tuning it appropriately.

Unfortunately, later (15.04, for example) Ubuntu versions are missing libpash completely, and even ./configure && make && make install method for pHash source is not working for me. So, if you really need to make my package working, we need to debug it on your system somehow, I need your help here. But in my personal opinion, you should try https://github.com/azr/phash package, it may help you. Or abandon pHash, as it deeply unmaintained…

kavu avatar Jan 11 '16 19:01 kavu