Unable to install on ubuntu 11.11 #9

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
9 participants
@ariejan
Collaborator

ariejan commented Oct 25, 2012

I got it to compile on OSX for my dev environment but I'm having issues on linux.

I have libjpeg8-dev installed, but the file missing seems to be part of the phash library somehow.

Also those error in the examples seem odd, looks like -lpthread is missing there.

make[1]: Entering directory `/var/lib/gems/1.9.1/gems/phashion-1.0.4/ext/phashion_ext/pHash-0.9.3/examples'
/bin/bash ../libtool --tag=CXX   --mode=link g++  -O2 -ffast-math -O3  -L/usr/local/lib -ljpeg -o buildmvptreedct buildmvptree_dctimage.o ../src/libpHash.la -lm  
libtool: link: g++ -O2 -ffast-math -O3 -o buildmvptreedct buildmvptree_dctimage.o  -L/usr/local/lib ../src/.libs/libpHash.a -ljpeg -lm
../src/.libs/libpHash.a(pHash.o): In function `ph_dct_image_hashes':
pHash.cpp:(.text+0x19ee): undefined reference to `pthread_create'
pHash.cpp:(.text+0x1a07): undefined reference to `pthread_join'
collect2: ld returned 1 exit status
make[1]: *** [buildmvptreedct] Error 1
make[1]: Leaving directory `/var/lib/gems/1.9.1/gems/phashion-1.0.4/ext/phashion_ext/pHash-0.9.3/examples'
make: *** [install-recursive] Error 1
mv CImg.h ../include 2>&1
creating Makefile

make
gcc -I. -I/usr/include/ruby-1.9.1/x86_64-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I.   -fPIC  -I/var/lib/gems/1.9.1/gems/phashion-1.0.4/ext/phashion_ext/include  -L/var/lib/gems/1.9.1/gems/phashion-1.0.4/ext/phashion_ext/lib  -x c++   -o phashion_ext.o -c phashion_ext.c
In file included from phashion_ext.c:2:0:
/var/lib/gems/1.9.1/gems/phashion-1.0.4/ext/phashion_ext/include/pHash.h:31:26: fatal error: pHash-config.h: No such file or directory
compilation terminated.
make: *** [phashion_ext.o] Error 1
@poitch

This comment has been minimized.

Show comment Hide comment
@poitch

poitch Jan 25, 2012

I see, so since the example fail to compile it actually fails to compile the actual library and install it. What is odd is that the extconf.rb doesn't catch the failure on the make and try and keeps going...

poitch commented Jan 25, 2012

I see, so since the example fail to compile it actually fails to compile the actual library and install it. What is odd is that the extconf.rb doesn't catch the failure on the make and try and keeps going...

@poitch

This comment has been minimized.

Show comment Hide comment
@poitch

poitch Jan 25, 2012

got it to install by adding --disable-pthread when building libphash.

Actually libphash-0.9.3 doesn't build on linux, but libphash-0.9.4 does, any chance we get a new gem with the updated lib?

poitch commented Jan 25, 2012

got it to install by adding --disable-pthread when building libphash.

Actually libphash-0.9.3 doesn't build on linux, but libphash-0.9.4 does, any chance we get a new gem with the updated lib?

@4poc

This comment has been minimized.

Show comment Hide comment
@4poc

4poc Mar 31, 2012

+1 please new gem! (same problem here with fedora 64bit)

4poc commented Mar 31, 2012

+1 please new gem! (same problem here with fedora 64bit)

@dingzj

This comment has been minimized.

Show comment Hide comment
@dingzj

dingzj May 9, 2012

Have the same problem when install it on ubuntu 64bit.

/bin/bash ../libtool --tag=CXX   --mode=link g++  -O2 -ffast-math -O3  -L/usr/local/lib -ljpeg -o buildmvptreedct buildmvptree_dctimage.o ../src/libpHash.la -lm  
libtool: link: g++ -O2 -ffast-math -O3 -o buildmvptreedct buildmvptree_dctimage.o  -L/usr/local/lib ../src/.libs/libpHash.a /usr/lib/libjpeg.so -lm
../src/.libs/libpHash.a(pHash.o): In function `ph_dct_image_hashes':
pHash.cpp:(.text+0x1c5c): undefined reference to `pthread_create'
pHash.cpp:(.text+0x1c76): undefined reference to `pthread_join'
collect2: ld returned 1 exit status
make[1]: *** [buildmvptreedct] Error 1

dingzj commented May 9, 2012

Have the same problem when install it on ubuntu 64bit.

/bin/bash ../libtool --tag=CXX   --mode=link g++  -O2 -ffast-math -O3  -L/usr/local/lib -ljpeg -o buildmvptreedct buildmvptree_dctimage.o ../src/libpHash.la -lm  
libtool: link: g++ -O2 -ffast-math -O3 -o buildmvptreedct buildmvptree_dctimage.o  -L/usr/local/lib ../src/.libs/libpHash.a /usr/lib/libjpeg.so -lm
../src/.libs/libpHash.a(pHash.o): In function `ph_dct_image_hashes':
pHash.cpp:(.text+0x1c5c): undefined reference to `pthread_create'
pHash.cpp:(.text+0x1c76): undefined reference to `pthread_join'
collect2: ld returned 1 exit status
make[1]: *** [buildmvptreedct] Error 1
@dingzj

This comment has been minimized.

Show comment Hide comment
@dingzj

dingzj May 10, 2012

just understand how to build gems and work this problem around, using @poitch 's hint.

  1. cd /tmp; gem clone https://github.com/mperham/phashion.git
  2. cd phashion;
  3. vim ext/phashion_ext/extconf.rb, add " --disable-pthread " after "--disable-video-hash"
  4. vim phashion.gemspec; comment line "#s.homepage", so it will load local
  5. gem build phashion.gemspec; gem install ./phashion-x.x.x.gem; #remember "./" part to install it from local
    DONE!

dingzj commented May 10, 2012

just understand how to build gems and work this problem around, using @poitch 's hint.

  1. cd /tmp; gem clone https://github.com/mperham/phashion.git
  2. cd phashion;
  3. vim ext/phashion_ext/extconf.rb, add " --disable-pthread " after "--disable-video-hash"
  4. vim phashion.gemspec; comment line "#s.homepage", so it will load local
  5. gem build phashion.gemspec; gem install ./phashion-x.x.x.gem; #remember "./" part to install it from local
    DONE!
@yefim

This comment has been minimized.

Show comment Hide comment
@yefim

yefim Jul 2, 2012

@dingzj The 1st step has a typo.

It should be cd /tmp; git clone https://github.com/mperham/phashion.git

yefim commented Jul 2, 2012

@dingzj The 1st step has a typo.

It should be cd /tmp; git clone https://github.com/mperham/phashion.git

@ariejan

This comment has been minimized.

Show comment Hide comment
@ariejan

ariejan Oct 24, 2012

Collaborator

I don't have access to this repo, but my fork seems to work on Ubuntu 12.04. Use this in you Gemfile:

gem 'phashion', git: 'git://github.com/ariejan/phashion.git'
Collaborator

ariejan commented Oct 24, 2012

I don't have access to this repo, but my fork seems to work on Ubuntu 12.04. Use this in you Gemfile:

gem 'phashion', git: 'git://github.com/ariejan/phashion.git'

@ghost ghost assigned ariejan Oct 25, 2012

@ariejan

This comment has been minimized.

Show comment Hide comment
@ariejan

ariejan Oct 25, 2012

Collaborator

Installation was tested on Ubuntu 12.04 and Mac OS X 10.8 Mountain Lion.

Collaborator

ariejan commented Oct 25, 2012

Installation was tested on Ubuntu 12.04 and Mac OS X 10.8 Mountain Lion.

@keithpitt

This comment has been minimized.

Show comment Hide comment
@keithpitt

keithpitt Feb 25, 2013

Should this be merged into master?

Should this be merged into master?

@mperham

This comment has been minimized.

Show comment Hide comment
@mperham

mperham Feb 25, 2013

Collaborator

The answer is not to turn off pthreads, it's to link against the pthreads library also.

Collaborator

mperham commented Feb 25, 2013

The answer is not to turn off pthreads, it's to link against the pthreads library also.

@deXterbed

This comment has been minimized.

Show comment Hide comment
@deXterbed

deXterbed May 15, 2013

In 12.04 (64/32bit)

sudo apt-get install libmagickwand-dev

will fix the problem

In 12.04 (64/32bit)

sudo apt-get install libmagickwand-dev

will fix the problem

@dkam

This comment has been minimized.

Show comment Hide comment
@dkam

dkam May 27, 2013

Collaborator

Installing libmagickwand-dev didn't work for me. The failing g++ call needs "-pthread" or "-lpthread" (at the end of the command) included

This fails:

g++ -O2 -ffast-math -O3 -o buildmvptreedct buildmvptree_dctimage.o  -L/usr/local/lib ../src/.libs/libpHash.a -ljpeg -lpng -lm

These work:

g++ -pthread -O2 -ffast-math -O3 -o buildmvptreedct buildmvptree_dctimage.o  -L/usr/local/lib ../src/.libs/libpHash.a -ljpeg -lpng -lm

g++ -O2 -ffast-math -O3 -o buildmvptreedct buildmvptree_dctimage.o  -L/usr/local/lib ../src/.libs/libpHash.a -ljpeg -lpng -lm -lpthread

But I can't see how to get those flags into the g++ command.

Collaborator

dkam commented May 27, 2013

Installing libmagickwand-dev didn't work for me. The failing g++ call needs "-pthread" or "-lpthread" (at the end of the command) included

This fails:

g++ -O2 -ffast-math -O3 -o buildmvptreedct buildmvptree_dctimage.o  -L/usr/local/lib ../src/.libs/libpHash.a -ljpeg -lpng -lm

These work:

g++ -pthread -O2 -ffast-math -O3 -o buildmvptreedct buildmvptree_dctimage.o  -L/usr/local/lib ../src/.libs/libpHash.a -ljpeg -lpng -lm

g++ -O2 -ffast-math -O3 -o buildmvptreedct buildmvptree_dctimage.o  -L/usr/local/lib ../src/.libs/libpHash.a -ljpeg -lpng -lm -lpthread

But I can't see how to get those flags into the g++ command.

@dkam

This comment has been minimized.

Show comment Hide comment
@dkam

dkam May 27, 2013

Collaborator

Ahhh - need to include

CXXFLAGS = ' -pthread'

in the configure line.

Collaborator

dkam commented May 27, 2013

Ahhh - need to include

CXXFLAGS = ' -pthread'

in the configure line.

@dkam

This comment has been minimized.

Show comment Hide comment
@dkam

dkam May 28, 2013

Collaborator

I've created a new pull request #15 which should resolve this issue by, as Mike suggested, including pthreads.

Collaborator

dkam commented May 28, 2013

I've created a new pull request #15 which should resolve this issue by, as Mike suggested, including pthreads.

@dkam

This comment has been minimized.

Show comment Hide comment
@dkam

dkam May 28, 2013

Collaborator

#15 should resolve this issue. Please reopen if that's not the case.

Collaborator

dkam commented May 28, 2013

#15 should resolve this issue. Please reopen if that's not the case.

@dkam dkam closed this May 28, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment