Closed mmende closed 8 years ago
I solved the problem by running node-pocketsphinx with node v0.10.13 instead of v0.12 by using nvm.
I submitted pullrequest #5 for adding support for node v0.12.x, but no one is merging or commenting it.
Yeah but there is a fork from jangerritharms which seems to support 12.0 at least. Had no time to test it yet.
Switching to v0.10.13 gives me one weird error, quite literally.
gyp ERR! node -v v0.10.13
gyp ERR! node-gyp -v v0.10.2
gyp ERR! not ok
unbuild pocketsphinx@1.0.0
npm ERR! weird error 1
npm ERR! not ok code 0
^^ ok, really helpful error logging from the developer here... If you're still interested in this topic you can check out my v0.12 fork. Would be really helpful to get some response.
I'm trying to build using "npm install pocketsphinx".
$ npm install pocketsphinx
npm http GET https://registry.npmjs.org/pocketsphinx
npm http 304 https://registry.npmjs.org/pocketsphinx
npm http GET https://registry.npmjs.org/segfault-handler
npm http 304 https://registry.npmjs.org/segfault-handler
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/bindings
> segfault-handler@0.2.4 install /Users/jonyen/Documents/Projects/node_modules/pocketsphinx/node_modules/segfault-handler
> node-gyp rebuild
CXX(target) Release/obj.target/segfault-handler/src/segfault-handler.o
SOLINK_MODULE(target) Release/segfault-handler.node
SOLINK_MODULE(target) Release/segfault-handler.node: Finished
> pocketsphinx@1.0.0 install /Users/jonyen/Documents/Projects/node_modules/pocketsphinx
> node-gyp rebuild
Package pocketsphinx was not found in the pkg-config search path.
Perhaps you should add the directory containing `pocketsphinx.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pocketsphinx' found
gyp: Call to 'pkg-config --variable=modeldir pocketsphinx' returned exit status 1. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/Users/jonyen/.nvm/v0.10.13/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:415:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 14.4.0
gyp ERR! command "node" "/Users/jonyen/.nvm/v0.10.13/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/jonyen/Documents/Projects/node_modules/pocketsphinx
gyp ERR! node -v v0.10.13
gyp ERR! node-gyp -v v0.10.2
gyp ERR! not ok
unbuild pocketsphinx@1.0.0
npm ERR! weird error 1
npm ERR! not ok code 0
Try adding /usr/local/lib/pkgconfig
to your PKG_CONFIG_PATH
or the corresponding directory where your pocketsphinx.pc
is located.
Did that already, didn't help. And can't find pocketsphinx.pc.
On Thu, Jul 9, 2015 at 10:34 AM, Martin Mende notifications@github.com wrote:
Try adding /usr/local/lib/pkgconfig to your PKG_CONFIG_PATH or the corresponding directory where your pocketsphinx.pc is located.
— Reply to this email directly or view it on GitHub https://github.com/cmusphinx/node-pocketsphinx/issues/11#issuecomment-120081084 .
Did you install it from the pocketsphinx repository?
Ah, ok, so I think I'm now where you're at:
# npm install pocketsphinx
> segfault-handler@0.2.4 install /Users/jonyen/Documents/Projects/node_modules/pocketsphinx/node_modules/segfault-handler
> node-gyp rebuild
CXX(target) Release/obj.target/segfault-handler/src/segfault-handler.o
SOLINK_MODULE(target) Release/segfault-handler.node
> pocketsphinx@1.0.0 install /Users/jonyen/Documents/Projects/node_modules/pocketsphinx
> node-gyp rebuild
CXX(target) Release/obj.target/PocketSphinx/src/Factory.o
In file included from ../src/Factory.cpp:2:
../src/Recognizer.h:11:33: error: expected class name
class Recognizer : public node::ObjectWrap
^
../src/Recognizer.h:20:41: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
static v8::Handle<v8::Value> New(const v8::Arguments& args);
^~~~~~~~~~~~~
v8::internal::Arguments
/Users/jonyen/.node-gyp/0.12.6/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
In file included from ../src/Factory.cpp:2:
../src/Recognizer.h:22:43: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
static v8::Handle<v8::Value> Start(const v8::Arguments& args);
^~~~~~~~~~~~~
v8::internal::Arguments
/Users/jonyen/.node-gyp/0.12.6/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
In file included from ../src/Factory.cpp:2:
../src/Recognizer.h:23:42: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
static v8::Handle<v8::Value> Stop(const v8::Arguments& args);
^~~~~~~~~~~~~
v8::internal::Arguments
/Users/jonyen/.node-gyp/0.12.6/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
In file included from ../src/Factory.cpp:2:
../src/Recognizer.h:24:45: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
static v8::Handle<v8::Value> Restart(const v8::Arguments& args);
^~~~~~~~~~~~~
v8::internal::Arguments
/Users/jonyen/.node-gyp/0.12.6/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
In file included from ../src/Factory.cpp:2:
../src/Recognizer.h:26:43: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
static v8::Handle<v8::Value> Write(const v8::Arguments& args);
^~~~~~~~~~~~~
v8::internal::Arguments
/Users/jonyen/.node-gyp/0.12.6/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
In file included from ../src/Factory.cpp:2:
../src/Recognizer.h:27:47: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
static v8::Handle<v8::Value> WriteSync(const v8::Arguments& args);
^~~~~~~~~~~~~
v8::internal::Arguments
/Users/jonyen/.node-gyp/0.12.6/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
In file included from ../src/Factory.cpp:2:
../src/Recognizer.h:29:56: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
static v8::Handle<v8::Value> AddKeyphraseSearch(const v8::Arguments& args);
^~~~~~~~~~~~~
v8::internal::Arguments
/Users/jonyen/.node-gyp/0.12.6/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
In file included from ../src/Factory.cpp:2:
../src/Recognizer.h:30:55: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
static v8::Handle<v8::Value> AddKeywordsSearch(const v8::Arguments& args);
^~~~~~~~~~~~~
v8::internal::Arguments
/Users/jonyen/.node-gyp/0.12.6/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
In file included from ../src/Factory.cpp:2:
../src/Recognizer.h:31:54: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
static v8::Handle<v8::Value> AddGrammarSearch(const v8::Arguments& args);
^~~~~~~~~~~~~
v8::internal::Arguments
/Users/jonyen/.node-gyp/0.12.6/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
In file included from ../src/Factory.cpp:2:
../src/Recognizer.h:32:52: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
static v8::Handle<v8::Value> AddNgramSearch(const v8::Arguments& args);
^~~~~~~~~~~~~
v8::internal::Arguments
/Users/jonyen/.node-gyp/0.12.6/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
In file included from ../src/Factory.cpp:2:
../src/Recognizer.h:34:89: error: no type named 'AccessorInfo' in namespace 'v8'
static v8::Handle<v8::Value> GetSearch(const v8::Local<v8::String> property, const v8::AccessorInfo& info);
~~~~^
../src/Recognizer.h:35:94: error: no type named 'AccessorInfo' in namespace 'v8'
static void SetSearch(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
~~~~^
../src/Recognizer.h:37:47: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
static v8::Handle<v8::Value> FromFloat(const v8::Arguments& args);
^~~~~~~~~~~~~
v8::internal::Arguments
/Users/jonyen/.node-gyp/0.12.6/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
In file included from ../src/Factory.cpp:2:
../src/Recognizer.h:40:26: error: unknown type name 'uv_work_t'
static void AsyncWorker(uv_work_t* request);
^
../src/Recognizer.h:41:25: error: unknown type name 'uv_work_t'
static void AsyncAfter(uv_work_t* request);
^
16 errors generated.
make: *** [Release/obj.target/PocketSphinx/src/Factory.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:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Darwin 14.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/jonyen/Documents/Projects/node_modules/pocketsphinx
gyp ERR! node -v v0.12.6
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm ERR! Darwin 14.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "pocketsphinx"
npm ERR! node v0.12.6
npm ERR! npm v2.12.1
npm ERR! code ELIFECYCLE
npm ERR! pocketsphinx@1.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pocketsphinx@1.0.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the pocketsphinx package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls pocketsphinx
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/jonyen/Documents/Projects/npm-debug.log
If you switch your node version e.g. with nvm to v10.13 it should compile.
Hmm...nope, one weird error...
# npm install pocketsphinx
npm http GET https://registry.npmjs.org/pocketsphinx
npm http 304 https://registry.npmjs.org/pocketsphinx
npm http GET https://registry.npmjs.org/segfault-handler
npm http 304 https://registry.npmjs.org/segfault-handler
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/nan
> segfault-handler@0.2.4 install /Users/jonyen/Documents/Projects/node_modules/pocketsphinx/node_modules/segfault-handler
> node-gyp rebuild
CXX(target) Release/obj.target/segfault-handler/src/segfault-handler.o
SOLINK_MODULE(target) Release/segfault-handler.node
SOLINK_MODULE(target) Release/segfault-handler.node: Finished
> pocketsphinx@1.0.0 install /Users/jonyen/Documents/Projects/node_modules/pocketsphinx
> node-gyp rebuild
CXX(target) Release/obj.target/PocketSphinx/src/Factory.o
CXX(target) Release/obj.target/PocketSphinx/src/Recognizer.o
../src/Recognizer.cpp:23:67: error: use of undeclared identifier 'MODELDIR'
tpl->Set(String::NewSymbol("modelDirectory"), String::NewSymbol(MODELDIR));
^
../src/Recognizer.cpp:73:97: error: use of undeclared identifier 'MODELDIR'
String::AsciiValue hmmValue(Default(options->Get(String::NewSymbol("hmm")), String::NewSymbol(MODELDIR "/hmm/en_US/hub4wsj_sc_8k")));
^
../src/Recognizer.cpp:74:95: error: use of undeclared identifier 'MODELDIR'
String::AsciiValue lmValue(Default(options->Get(String::NewSymbol("lm")), String::NewSymbol(MODELDIR "/lm/en_US/hub4.5000.DMP")));
^
../src/Recognizer.cpp:75:99: error: use of undeclared identifier 'MODELDIR'
String::AsciiValue dictValue(Default(options->Get(String::NewSymbol("dict")), String::NewSymbol(MODELDIR "/lm/en_US/cmu07a.dic")));
^
../src/Recognizer.cpp:215:16: error: no matching function for call to 'ps_start_utt'
int result = ps_start_utt(instance->ps, NULL);
^~~~~~~~~~~~
/usr/local/include/pocketsphinx/pocketsphinx.h:332:5: note: candidate function not viable: requires single argument 'ps', but 2 arguments were provided
int ps_start_utt(ps_decoder_t *ps);
^
../src/Recognizer.cpp:235:16: error: no matching function for call to 'ps_start_utt'
int result = ps_start_utt(instance->ps, NULL);
^~~~~~~~~~~~
/usr/local/include/pocketsphinx/pocketsphinx.h:332:5: note: candidate function not viable: requires single argument 'ps', but 2 arguments were provided
int ps_start_utt(ps_decoder_t *ps);
^
../src/Recognizer.cpp:299:21: error: no matching function for call to 'ps_get_hyp'
const char* hyp = ps_get_hyp(instance->ps, &score, &uttid);
^~~~~~~~~~
/usr/local/include/pocketsphinx/pocketsphinx.h:408:13: note: candidate function not viable: requires 2 arguments, but 3 were provided
char const *ps_get_hyp(ps_decoder_t *ps, int32 *out_best_score);
^
../src/Recognizer.cpp:318:21: error: no matching function for call to 'ps_get_hyp'
const char* hyp = ps_get_hyp(data->instance->ps, &score, &uttid);
^~~~~~~~~~
/usr/local/include/pocketsphinx/pocketsphinx.h:408:13: note: candidate function not viable: requires 2 arguments, but 3 were provided
char const *ps_get_hyp(ps_decoder_t *ps, int32 *out_best_score);
^
8 errors generated.
make: *** [Release/obj.target/PocketSphinx/src/Recognizer.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/jonyen/.nvm/v0.10.13/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 14.4.0
gyp ERR! command "node" "/Users/jonyen/.nvm/v0.10.13/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/jonyen/Documents/Projects/node_modules/pocketsphinx
gyp ERR! node -v v0.10.13
gyp ERR! node-gyp -v v0.10.2
gyp ERR! not ok
unbuild pocketsphinx@1.0.0
npm ERR! weird error 1
npm ERR! not ok code 0
Hm strange. It worked for me when I manually compiled it with $ sudo node-gyp rebuild
...
Is your PKG_CONFIG_PATH still set? ;-)
Well, it wasn't, but then setting it still hasn't changed anything.
On Thu, Jul 9, 2015 at 11:33 AM, Martin Mende notifications@github.com wrote:
Is your PKG_CONFIG_PATH still set? ;-)
— Reply to this email directly or view it on GitHub https://github.com/cmusphinx/node-pocketsphinx/issues/11#issuecomment-120097477 .
@mmende your fork works great on mac 10.10.3 with node v0.12.4. Thanks!
@miguelmota Nice to hear... Thanks for testing
Updated to latest node, should work now.
Hi, I've installed sphinxbase (5prealpha) and pocketsphinx (5prealpha) from git, set the PKG_CONFIG_PATH environment var to /usr/local/lib/pkgconfig and get the following errors when trying to compile node-pocketsphinx: