westonplatter / phashion

Ruby wrapper around pHash, the perceptual hash library for detecting duplicate multimedia files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first.

sergodeeva opened this issue · comments

Hi,
I am getting an error when trying to install phashion (see below).
OS X El Capitan 10.11.6.
I have installed imagemagick and libjpeg.
Any suggestions much appreciated, I am clueless...

Building native extensions.  This could take a while...
ERROR:  Error installing phashion:
	ERROR: Failed to build gem native extension.

    /Users/wego/.rvm/rubies/ruby-2.2.2/bin/ruby -r ./siteconf20170227-71612-4mya9a.rb extconf.rb
tar xzf /Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/pHash-0.9.6.tar.gz 2>&1
env CXXFLAGS=' -pthread' CFLAGS=' -I/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/include  -L/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib -L/usr/local/lib  -x c++ ' LDFLAGS=' -L/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib -L/usr/local/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib ' ./configure --prefix=/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext --disable-audio-hash --disable-video-hash --disable-shared --with-pic 2>&1
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... unsupported
checking dependency style of gcc... gcc3
checking for /etc/gentoo-release... no
checking for /etc/redhat-release... no
checking for /etc/slackware-version... no
checking for /etc/debian_version... no
checking for /etc/SuSErelease... no
checking build system type... i386-apple-darwin15.6.0
checking host system type... i386-apple-darwin15.6.0
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... -D_THREAD_SAFE
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether ln -s works... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i386-apple-darwin15.6.0 file names to i386-apple-darwin15.6.0 format... func_convert_file_noop
checking how to convert i386-apple-darwin15.6.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for objdump... no
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin15.6.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fno-common -DPIC
checking if g++ PIC flag -fno-common -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin15.6.0 dyld
checking how to hardcode library paths into programs... immediate

*** Configuring image hash ***

checking CImg.h usability... no
checking CImg.h presence... no
checking for CImg.h... no
checking whether CImg.h is in the current or src directory.... yes
checking for png_create_read_struct in -lpng... no
checking for jpeg_read_header in -ljpeg... yes
checking for fftw_plan_dft_r2c_1d in -lfftw3... no
checking for size_t... yes
checking for uint32_t... yes
checking for uint8_t... yes
checking for uint64_t... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating examples/Makefile
config.status: creating pHash.pc
config.status: creating bindings/Makefile
config.status: creating bindings/java/Makefile
config.status: creating config.h
config.status: creating pHash-config.h
config.status: executing depfiles commands
config.status: executing libtool commands
make || true 2>&1
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in src
/bin/sh ../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..   -D_THREAD_SAFE -I/usr/local/include -Dcimg_use_jpeg  -pthread -ffast-math -O3 -MT pHash.lo -MD -MP -MF .deps/pHash.Tpo -c -o pHash.lo pHash.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -D_THREAD_SAFE -I/usr/local/include -Dcimg_use_jpeg -pthread -ffast-math -O3 -MT pHash.lo -MD -MP -MF .deps/pHash.Tpo -c pHash.cpp  -fno-common -DPIC -o pHash.o
In file included from pHash.cpp:25:
In file included from ./pHash.h:50:
../CImg.h:2160:44: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static char min() { return (char)(-1L<<(8*sizeof(char)-1)); }
                                        ~~~^
../CImg.h:2161:46: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static char max() { return ~((char)(-1L<<(8*sizeof(char)-1))); }
                                          ~~~^
../CImg.h:2171:58: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static signed char min() { return (signed char)(-1L<<(8*sizeof(signed char)-1)); }
                                                      ~~~^
../CImg.h:2172:60: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static signed char max() { return ~((signed char)(-1L<<(8*sizeof(signed char)-1))); }
                                                        ~~~^
../CImg.h:2193:46: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static short min() { return (short)(-1L<<(8*sizeof(short)-1)); }
                                          ~~~^
../CImg.h:2194:48: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static short max() { return ~((short)(-1L<<(8*sizeof(short)-1))); }
                                            ~~~^
../CImg.h:2215:42: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static int min() { return (int)(-1L<<(8*sizeof(int)-1)); }
                                      ~~~^
../CImg.h:2216:44: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static int max() { return ~((int)(-1L<<(8*sizeof(int)-1))); }
                                        ~~~^
../CImg.h:2237:44: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static long min() { return (long)(-1L<<(8*sizeof(long)-1)); }
                                        ~~~^
../CImg.h:2238:46: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static long max() { return ~((long)(-1L<<(8*sizeof(long)-1))); }
                                          ~~~^
pHash.cpp:415:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
11 warnings generated.
mv -f .deps/pHash.Tpo .deps/pHash.Plo
/bin/sh ../libtool --tag=CXX   --mode=link g++  -pthread -ffast-math -O3 -no-undefined -L/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib -L/usr/local/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L/usr/local/lib -o libpHash.la -rpath /Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib pHash.lo    -ljpeg
libtool: link: ar cru .libs/libpHash.a  pHash.o
libtool: link: ranlib .libs/libpHash.a
libtool: link: ( cd ".libs" && rm -f "libpHash.la" && ln -s "../libpHash.la" "libpHash.la" )
Making all in bindings
make[3]: Nothing to be done for `all-am'.
Making all in examples
g++ -DHAVE_CONFIG_H -I. -I.. -I../src  -D_THREAD_SAFE -I/usr/local/include -Dcimg_use_jpeg  -pthread -ffast-math -O3 -MT test_texthash.o -MD -MP -MF .deps/test_texthash.Tpo -c -o test_texthash.o test_texthash.cpp
In file included from test_texthash.cpp:28:
In file included from ../src/pHash.h:50:
../CImg.h:2160:44: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static char min() { return (char)(-1L<<(8*sizeof(char)-1)); }
                                        ~~~^
../CImg.h:2161:46: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static char max() { return ~((char)(-1L<<(8*sizeof(char)-1))); }
                                          ~~~^
../CImg.h:2171:58: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static signed char min() { return (signed char)(-1L<<(8*sizeof(signed char)-1)); }
                                                      ~~~^
../CImg.h:2172:60: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static signed char max() { return ~((signed char)(-1L<<(8*sizeof(signed char)-1))); }
                                                        ~~~^
../CImg.h:2193:46: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static short min() { return (short)(-1L<<(8*sizeof(short)-1)); }
                                          ~~~^
../CImg.h:2194:48: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static short max() { return ~((short)(-1L<<(8*sizeof(short)-1))); }
                                            ~~~^
../CImg.h:2215:42: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static int min() { return (int)(-1L<<(8*sizeof(int)-1)); }
                                      ~~~^
../CImg.h:2216:44: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static int max() { return ~((int)(-1L<<(8*sizeof(int)-1))); }
                                        ~~~^
../CImg.h:2237:44: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static long min() { return (long)(-1L<<(8*sizeof(long)-1)); }
                                        ~~~^
../CImg.h:2238:46: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static long max() { return ~((long)(-1L<<(8*sizeof(long)-1))); }
                                          ~~~^
test_texthash.cpp:68:26: warning: format specifies type 'intmax_t' (aka 'long') but the argument has type 'off_t' (aka 'long long') [-Wformat]
        printf(" %jd %jd %d\n", matches[j].first_index, matches[j].second_index,matches[j].length); 
                 ~~~            ^~~~~~~~~~~~~~~~~~~~~~
                 %lld
test_texthash.cpp:68:50: warning: format specifies type 'intmax_t' (aka 'long') but the argument has type 'off_t' (aka 'long long') [-Wformat]
        printf(" %jd %jd %d\n", matches[j].first_index, matches[j].second_index,matches[j].length); 
                     ~~~                                ^~~~~~~~~~~~~~~~~~~~~~~
                     %lld
12 warnings generated.
mv -f .deps/test_texthash.Tpo .deps/test_texthash.Po
/bin/sh ../libtool --tag=CXX   --mode=link g++  -pthread -ffast-math -O3  -L/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib -L/usr/local/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L/usr/local/lib -o test_texthash test_texthash.o ../src/libpHash.la -ljpeg
libtool: link: g++ -pthread -ffast-math -O3 -fstack-protector -o test_texthash test_texthash.o -Wl,-bind_at_load  -L/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib -L/usr/local/lib -L. -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib ../src/.libs/libpHash.a -ljpeg -pthread
clang: warning: argument unused during compilation: '-pthread'
clang: warning: argument unused during compilation: '-pthread'
ld: warning: directory not found for option '-L/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib'
g++ -DHAVE_CONFIG_H -I. -I.. -I../src  -D_THREAD_SAFE -I/usr/local/include -Dcimg_use_jpeg  -pthread -ffast-math -O3 -MT test_texthash2.o -MD -MP -MF .deps/test_texthash2.Tpo -c -o test_texthash2.o test_texthash2.cpp
In file included from test_texthash2.cpp:27:
In file included from ../src/pHash.h:50:
../CImg.h:2160:44: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static char min() { return (char)(-1L<<(8*sizeof(char)-1)); }
                                        ~~~^
../CImg.h:2161:46: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static char max() { return ~((char)(-1L<<(8*sizeof(char)-1))); }
                                          ~~~^
../CImg.h:2171:58: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static signed char min() { return (signed char)(-1L<<(8*sizeof(signed char)-1)); }
                                                      ~~~^
../CImg.h:2172:60: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static signed char max() { return ~((signed char)(-1L<<(8*sizeof(signed char)-1))); }
                                                        ~~~^
../CImg.h:2193:46: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static short min() { return (short)(-1L<<(8*sizeof(short)-1)); }
                                          ~~~^
../CImg.h:2194:48: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static short max() { return ~((short)(-1L<<(8*sizeof(short)-1))); }
                                            ~~~^
../CImg.h:2215:42: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static int min() { return (int)(-1L<<(8*sizeof(int)-1)); }
                                      ~~~^
../CImg.h:2216:44: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static int max() { return ~((int)(-1L<<(8*sizeof(int)-1))); }
                                        ~~~^
../CImg.h:2237:44: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static long min() { return (long)(-1L<<(8*sizeof(long)-1)); }
                                        ~~~^
../CImg.h:2238:46: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static long max() { return ~((long)(-1L<<(8*sizeof(long)-1))); }
                                          ~~~^
10 warnings generated.
mv -f .deps/test_texthash2.Tpo .deps/test_texthash2.Po
/bin/sh ../libtool --tag=CXX   --mode=link g++  -pthread -ffast-math -O3  -L/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib -L/usr/local/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L/usr/local/lib -o test_texthash2 test_texthash2.o ../src/libpHash.la -ljpeg
libtool: link: g++ -pthread -ffast-math -O3 -fstack-protector -o test_texthash2 test_texthash2.o -Wl,-bind_at_load  -L/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib -L/usr/local/lib -L. -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib ../src/.libs/libpHash.a -ljpeg -pthread
clang: warning: argument unused during compilation: '-pthread'
clang: warning: argument unused during compilation: '-pthread'
ld: warning: directory not found for option '-L/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib'
g++ -DHAVE_CONFIG_H -I. -I.. -I../src  -D_THREAD_SAFE -I/usr/local/include -Dcimg_use_jpeg  -pthread -ffast-math -O3 -MT test_imagephash.o -MD -MP -MF .deps/test_imagephash.Tpo -c -o test_imagephash.o test_imagephash.cpp
In file included from test_imagephash.cpp:30:
In file included from ../src/pHash.h:50:
../CImg.h:2160:44: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static char min() { return (char)(-1L<<(8*sizeof(char)-1)); }
                                        ~~~^
../CImg.h:2161:46: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static char max() { return ~((char)(-1L<<(8*sizeof(char)-1))); }
                                          ~~~^
../CImg.h:2171:58: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static signed char min() { return (signed char)(-1L<<(8*sizeof(signed char)-1)); }
                                                      ~~~^
../CImg.h:2172:60: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static signed char max() { return ~((signed char)(-1L<<(8*sizeof(signed char)-1))); }
                                                        ~~~^
../CImg.h:2193:46: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static short min() { return (short)(-1L<<(8*sizeof(short)-1)); }
                                          ~~~^
../CImg.h:2194:48: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static short max() { return ~((short)(-1L<<(8*sizeof(short)-1))); }
                                            ~~~^
../CImg.h:2215:42: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static int min() { return (int)(-1L<<(8*sizeof(int)-1)); }
                                      ~~~^
../CImg.h:2216:44: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static int max() { return ~((int)(-1L<<(8*sizeof(int)-1))); }
                                        ~~~^
../CImg.h:2237:44: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static long min() { return (long)(-1L<<(8*sizeof(long)-1)); }
                                        ~~~^
../CImg.h:2238:46: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static long max() { return ~((long)(-1L<<(8*sizeof(long)-1))); }
                                          ~~~^
10 warnings generated.
mv -f .deps/test_imagephash.Tpo .deps/test_imagephash.Po
/bin/sh ../libtool --tag=CXX   --mode=link g++  -pthread -ffast-math -O3  -L/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib -L/usr/local/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L/usr/local/lib -o test_image test_imagephash.o ../src/libpHash.la -ljpeg
libtool: link: g++ -pthread -ffast-math -O3 -fstack-protector -o test_image test_imagephash.o -Wl,-bind_at_load  -L/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib -L/usr/local/lib -L. -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib ../src/.libs/libpHash.a -ljpeg -pthread
clang: warning: argument unused during compilation: '-pthread'
clang: warning: argument unused during compilation: '-pthread'
ld: warning: directory not found for option '-L/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib'
g++ -DHAVE_CONFIG_H -I. -I.. -I../src  -D_THREAD_SAFE -I/usr/local/include -Dcimg_use_jpeg  -pthread -ffast-math -O3 -MT test_mhimagehash.o -MD -MP -MF .deps/test_mhimagehash.Tpo -c -o test_mhimagehash.o test_mhimagehash.cpp
In file included from test_mhimagehash.cpp:4:
In file included from ../src/pHash.h:50:
../CImg.h:2160:44: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static char min() { return (char)(-1L<<(8*sizeof(char)-1)); }
                                        ~~~^
../CImg.h:2161:46: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static char max() { return ~((char)(-1L<<(8*sizeof(char)-1))); }
                                          ~~~^
../CImg.h:2171:58: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static signed char min() { return (signed char)(-1L<<(8*sizeof(signed char)-1)); }
                                                      ~~~^
../CImg.h:2172:60: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static signed char max() { return ~((signed char)(-1L<<(8*sizeof(signed char)-1))); }
                                                        ~~~^
../CImg.h:2193:46: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static short min() { return (short)(-1L<<(8*sizeof(short)-1)); }
                                          ~~~^
../CImg.h:2194:48: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static short max() { return ~((short)(-1L<<(8*sizeof(short)-1))); }
                                            ~~~^
../CImg.h:2215:42: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static int min() { return (int)(-1L<<(8*sizeof(int)-1)); }
                                      ~~~^
../CImg.h:2216:44: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static int max() { return ~((int)(-1L<<(8*sizeof(int)-1))); }
                                        ~~~^
../CImg.h:2237:44: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static long min() { return (long)(-1L<<(8*sizeof(long)-1)); }
                                        ~~~^
../CImg.h:2238:46: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
      static long max() { return ~((long)(-1L<<(8*sizeof(long)-1))); }
                                          ~~~^
10 warnings generated.
mv -f .deps/test_mhimagehash.Tpo .deps/test_mhimagehash.Po
/bin/sh ../libtool --tag=CXX   --mode=link g++  -pthread -ffast-math -O3  -L/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib -L/usr/local/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L/usr/local/lib -o test_mhimagehash test_mhimagehash.o ../src/libpHash.la -ljpeg
libtool: link: g++ -pthread -ffast-math -O3 -fstack-protector -o test_mhimagehash test_mhimagehash.o -Wl,-bind_at_load  -L/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib -L/usr/local/lib -L. -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib ../src/.libs/libpHash.a -ljpeg -pthread
clang: warning: argument unused during compilation: '-pthread'
clang: warning: argument unused during compilation: '-pthread'
ld: warning: directory not found for option '-L/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib'
make[2]: Nothing to be done for `all-am'.
make install || true 2>&1
Making install in src
 .././install-sh -c -d '/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib'
 /bin/sh ../libtool   --mode=install /usr/bin/install -c   libpHash.la '/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib'
libtool: install: /usr/bin/install -c .libs/libpHash.lai /Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib/libpHash.la
libtool: install: /usr/bin/install -c .libs/libpHash.a /Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib/libpHash.a
libtool: install: chmod 644 /Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib/libpHash.a
libtool: install: ranlib /Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib/libpHash.a
 .././install-sh -c -d '/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/include'
 /usr/bin/install -c -m 644 pHash.h '/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/include'
Making install in bindings
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
Making install in examples
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Nothing to be done for `install-exec-am'.
 ./install-sh -c -d '/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/include'
 /usr/bin/install -c -m 644 pHash-config.h '/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/include'
 ./install-sh -c -d '/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib/pkgconfig'
 /usr/bin/install -c -m 644 pHash.pc '/Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0/ext/phashion_ext/lib/pkgconfig'
mv CImg.h ../include 2>&1
checking for sqlite3ext.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/Users/wego/.rvm/rubies/ruby-2.2.2/bin/$(RUBY_BASE_NAME)
/Users/wego/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
	from /Users/wego/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:587:in `try_cpp'
	from /Users/wego/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:1060:in `block in have_header'
	from /Users/wego/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:911:in `block in checking_for'
	from /Users/wego/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:351:in `block (2 levels) in postpone'
	from /Users/wego/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:321:in `open'
	from /Users/wego/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:351:in `block in postpone'
	from /Users/wego/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:321:in `open'
	from /Users/wego/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:347:in `postpone'
	from /Users/wego/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:910:in `checking_for'
	from /Users/wego/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:1059:in `have_header'
	from extconf.rb:46:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/wego/.rvm/gems/ruby-2.2.2@neo/gems/phashion-1.2.0 for inspection.
Results logged to /Users/wego/.rvm/gems/ruby-2.2.2@neo/extensions/x86_64-darwin-15/2.2.0/phashion-1.2.0/gem_make.out

@sergodeeva it looks like it failed on checking for sqlite3ext.h... *** extconf.rb failed ***. Do you have sqlite3 installed?

The problem was solved by running brew install libpng
(found the solution here: #53 (comment))
thanks @westonplatter !

@sergodeeva ah, good to know. Which OS are you on? I'll update the README prereqs if your experience is different than what's described there.

@westonplatter I was on OS X El Capitan 10.11.6 when I got that error.
Yesterday I updated to macOS Sierra 10.12.3 (16D32) - still was getting the same error.
The problem was solved after I ran brew install libpng

@westonplatter, on a fresh install of MacOS Sierra, I needed to both brew install libpng & brew install libjpeg to get it to install successfully.

I was specifically installing 1.2.0.

@delian7 thanks for the input. I'll add libpng to the README.md