aaronm67 / node-phash

Phash Bindings for Node.js
163 stars 41 forks source link

Cannot install on OSX #15

Closed dantman closed 9 years ago

dantman commented 9 years ago

I'm getting this installation error on OSX.

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
gyp ERR! System Darwin 13.4.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/daniel/Workspace/otaku/otakuseek/otakucore/node_modules/phash
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 
npm ERR! Darwin 13.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "i" "phash" "--save"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE

This is the same even after installing pHash via MacPorts on OSX.

dantman commented 9 years ago

Attempting to install via git results in this error instead.

  CC(target) Release/obj.target/zlib/deps/zlib/infback.o
  CC(target) Release/obj.target/zlib/deps/zlib/inffast.o
  CC(target) Release/obj.target/zlib/deps/zlib/inflate.o
  CC(target) Release/obj.target/zlib/deps/zlib/inftrees.o
  CC(target) Release/obj.target/zlib/deps/zlib/trees.o
  CC(target) Release/obj.target/zlib/deps/zlib/uncompr.o
  CC(target) Release/obj.target/zlib/deps/zlib/zutil.o
  LIBTOOL-STATIC Release/zlib.a
  CXX(target) Release/obj.target/pHashBinding/src/phash.o
../src/phash.cpp:36:5: error: unknown type name 'uv_work_t'
    uv_work_t request;
    ^
../src/phash.cpp:81:17: error: unknown type name 'uv_work_t'
void HashWorker(uv_work_t* req) {
                ^
../src/phash.cpp:86:16: error: unknown type name 'uv_work_t'
void HashAfter(uv_work_t* req, int status) {
               ^
../src/phash.cpp:87:17: error: calling a protected constructor of class 'v8::HandleScope'
    HandleScope scope;
                ^
/Users/daniel/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: note: declared protected here
  V8_INLINE HandleScope() {}
            ^
../src/phash.cpp:93:48: error: no member named 'New' in 'v8::String'
        argv[0] = v8::Exception::Error(String::New("Error getting image hash"));
                                       ~~~~~~~~^
../src/phash.cpp:96:19: error: no matching function for call to 'Undefined'
        argv[0] = Undefined();
                  ^~~~~~~~~
/Users/daniel/.node-gyp/0.12.0/deps/v8/include/v8.h:305:28: note: candidate function not viable: requires single argument 'isolate', but no arguments were provided
  friend Handle<Primitive> Undefined(Isolate* isolate);
                           ^
../src/phash.cpp:99:23: error: no member named 'New' in 'v8::String'
    argv[1] = String::New(request->hash.c_str());
              ~~~~~~~~^
../src/phash.cpp:100:22: error: member reference type 'Persistent<v8::Function>' is not a pointer; maybe you meant to use '.'?
    request->callback->Call(Context::GetCurrent()->Global(), 2, argv);
    ~~~~~~~~~~~~~~~~~^~
                     .
../src/phash.cpp:100:24: error: no member named 'Call' in 'v8::Persistent<v8::Function, v8::NonCopyablePersistentTraits<v8::Function> >'
    request->callback->Call(Context::GetCurrent()->Global(), 2, argv);
    ~~~~~~~~~~~~~~~~~  ^
../src/phash.cpp:100:38: error: no member named 'GetCurrent' in 'v8::Context'
    request->callback->Call(Context::GetCurrent()->Global(), 2, argv);
                            ~~~~~~~~~^
../src/phash.cpp:101:23: error: no member named 'Dispose' in 'v8::Persistent<v8::Function, v8::NonCopyablePersistentTraits<v8::Function> >'
    request->callback.Dispose();
    ~~~~~~~~~~~~~~~~~ ^
../src/phash.cpp:106:36: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'?
Handle<Value> ImageHashAsync(const Arguments& args) {
                                   ^~~~~~~~~
                                   v8::internal::Arguments
/Users/daniel/.node-gyp/0.12.0/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
../src/phash.cpp:107:13: error: member access into incomplete type 'const v8::internal::Arguments'
    if (args.Length() < 2 || !args[1]->IsFunction()) {
            ^
/Users/daniel/.node-gyp/0.12.0/deps/v8/include/v8.h:127:7: note: forward declaration of 'v8::internal::Arguments'
class Arguments;
      ^
../src/phash.cpp:109:56: error: no member named 'New' in 'v8::String'
        return ThrowException(Exception::Error(String::New("Callback is required and must be an Function.")));
                                               ~~~~~~~~^
../src/phash.cpp:112:31: error: type 'const v8::internal::Arguments' does not provide a subscript operator
    String::Utf8Value str(args[0]);
                          ~~~~^~
../src/phash.cpp:113:54: error: type 'const v8::internal::Arguments' does not provide a subscript operator
    Handle<Function> cb = Handle<Function>::Cast(args[1]);
                                                 ~~~~^~
../src/phash.cpp:116:47: error: 'New' is a private member of 'v8::PersistentBase<v8::Function>'
    request->callback = Persistent<Function>::New(cb);
                                              ^
/Users/daniel/.node-gyp/0.12.0/deps/v8/include/v8.h:572:23: note: declared private here
  V8_INLINE static T* New(Isolate* isolate, T* that);
                      ^
../src/phash.cpp:116:53: error: too few arguments to function call, expected 2, have 1
    request->callback = Persistent<Function>::New(cb);
                        ~~~~~~~~~~~~~~~~~~~~~~~~~   ^
/Users/daniel/.node-gyp/0.12.0/deps/v8/include/v8.h:572:3: note: 'New' declared here
  V8_INLINE static T* New(Isolate* isolate, T* that);
  ^
/Users/daniel/.node-gyp/0.12.0/deps/v8/include/v8config.h:289:20: note: expanded from macro 'V8_INLINE'
# define V8_INLINE inline __attribute__((always_inline))
                   ^
../src/phash.cpp:119:19: error: use of undeclared identifier 'uv_default_loop'
    uv_queue_work(uv_default_loop(), &request->request, HashWorker, HashAfter);
                  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/pHashBinding/src/phash.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
gyp ERR! System Darwin 13.4.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/daniel/Workspace/otaku/otakuseek/otakucore/node_modules/phash
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 
npm ERR! Darwin 13.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "i" "phash@git+https://github.com/aaronm67/node-phash.git" "--save"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE
mkoryak commented 9 years ago

Same here. osx 10.8.3 install blows up:

> phash@0.0.5 install /code/node_modules/phash
> node-gyp rebuild

2015-03-31 22:30:47.362 xcodebuild[4715:f07] Error loading /Developer/Library/Xcode/Plug-ins/XcodeSubversionPlugin.xcplugin/Contents/MacOS/XcodeSubversionPlugin:  dlopen(/Developer/Library/Xcode/Plug-ins/XcodeSubversionPlugin.xcplugin/Contents/MacOS/XcodeSubversionPlugin, 265): Library not loaded: /usr/lib/libsvn_client-1.0.dylib
  Referenced from: /Developer/Library/Xcode/Plug-ins/XcodeSubversionPlugin.xcplugin/Contents/MacOS/XcodeSubversionPlugin
  Reason: image not found
2015-03-31 22:30:47.362 xcodebuild[4715:f07] WARNING: Failed to load plugin at: /Developer/Library/Xcode/Plug-ins/XcodeSubversionPlugin.xcplugin, skipping.  Could not load bundle.
2015-03-31 22:30:47.574 xcodebuild[4717:f07] Error loading /Developer/Library/Xcode/Plug-ins/XcodeSubversionPlugin.xcplugin/Contents/MacOS/XcodeSubversionPlugin:  dlopen(/Developer/Library/Xcode/Plug-ins/XcodeSubversionPlugin.xcplugin/Contents/MacOS/XcodeSubversionPlugin, 265): Library not loaded: /usr/lib/libsvn_client-1.0.dylib
  Referenced from: /Developer/Library/Xcode/Plug-ins/XcodeSubversionPlugin.xcplugin/Contents/MacOS/XcodeSubversionPlugin
  Reason: image not found
2015-03-31 22:30:47.575 xcodebuild[4717:f07] WARNING: Failed to load plugin at: /Developer/Library/Xcode/Plug-ins/XcodeSubversionPlugin.xcplugin, skipping.  Could not load bundle.
  CXX(target) Release/obj.target/pHash/phash.o
../phash.cpp:3:19: warning: pHash.h: No such file or directory
../phash.cpp:10: error: ‘string’ does not name a type
../phash.cpp:11: error: ‘string’ does not name a type
../phash.cpp:17: error: expected constructor, destructor, or type conversion before ‘NumberToString’
../phash.cpp:24: error: expected ‘,’ or ‘...’ before ‘&’ token
../phash.cpp:24: error: ISO C++ forbids declaration of ‘string’ with no type
../phash.cpp: In function ‘T StringToNumber(int)’:
../phash.cpp:25: error: ‘istringstream’ was not declared in this scope
../phash.cpp:25: error: expected `;' before ‘ss’
../phash.cpp:27: error: ‘ss’ was not declared in this scope
../phash.cpp: At global scope:
../phash.cpp:34: error: ‘string’ does not name a type
../phash.cpp: In function ‘void HashWorker(uv_work_t*)’:
../phash.cpp:50: error: ‘struct PhashRequest’ has no member named ‘hash’
../phash.cpp:50: error: ‘struct PhashRequest’ has no member named ‘file’
../phash.cpp:50: error: ‘getHash’ was not declared in this scope
../phash.cpp: In function ‘void HashAfter(uv_work_t*, int)’:
../phash.cpp:59: error: ‘struct PhashRequest’ has no member named ‘hash’
../phash.cpp:66: error: ‘struct PhashRequest’ has no member named ‘hash’
../phash.cpp: In function ‘v8::Handle<v8::Value> ImageHashAsync(const v8::Arguments&)’:
../phash.cpp:84: error: ‘struct PhashRequest’ has no member named ‘file’
../phash.cpp:84: error: ‘string’ was not declared in this scope
../phash.cpp: In function ‘v8::Handle<v8::Value> ImageHashSync(const v8::Arguments&)’:
../phash.cpp:93: error: ‘string’ was not declared in this scope
../phash.cpp:93: error: expected `;' before ‘result’
../phash.cpp:94: error: ‘result’ was not declared in this scope
../phash.cpp: In function ‘v8::Handle<v8::Value> HammingDistance(const v8::Arguments&)’:
../phash.cpp:102: error: ‘string’ was not declared in this scope
../phash.cpp:102: error: expected `;' before ‘aString’
../phash.cpp:103: error: expected `;' before ‘bString’
../phash.cpp:105: error: ‘ulong64’ was not declared in this scope
../phash.cpp:105: error: expected `;' before ‘hasha’
../phash.cpp:106: error: expected `;' before ‘hashb’
../phash.cpp:108: error: ‘hasha’ was not declared in this scope
../phash.cpp:108: error: ‘hashb’ was not declared in this scope
../phash.cpp:108: error: ‘ph_hamming_distance’ was not declared in this scope
../phash.cpp: In function ‘v8::Handle<v8::Value> oldHash(const v8::Arguments&)’:
../phash.cpp:121: error: ‘ulong64’ was not declared in this scope
../phash.cpp:121: error: expected `;' before ‘hash’
../phash.cpp:122: error: ‘hash’ was not declared in this scope
../phash.cpp:122: error: ‘ph_dct_imagehash’ was not declared in this scope
make: *** [Release/obj.target/pHash/phash.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Darwin 12.3.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /code/node_modules/phash
gyp ERR! node -v v0.10.32
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok 

kinda wierd that it needs subversion for something in there

dantman commented 9 years ago

I'm switching to phash-image which installs fine and appears to work.

aaronm67 commented 9 years ago

I'll close this and track the progress in #17 -- they are the same issue.