cmusphinx / node-pocketsphinx

Pocketsphinx bindings for Node.JS
Other
242 stars 47 forks source link

make: *** No rule to make target '/swig/sphinxbase.i', needed by 'sb.cpp'. Stop. #18

Closed ashishbajaj99 closed 8 years ago

ashishbajaj99 commented 8 years ago

While trying to install I get the following error:

[pi@ashiya:~/conduit/pocketsphinx/pocketsphinx-node $ npm install pocketsphinx --save

> pocketsphinx@5.0.5 install /home/pi/conduit/pocketsphinx/pocketsphinx-node/node_modules/pocketsphinx
> node-gyp rebuild

make: Entering directory '/home/pi/conduit/pocketsphinx/pocketsphinx-node/node_modules/pocketsphinx/build'
  ACTION Checking for sphinxbase and pocketsphinx version 5prealpha with pkg-config .
make: *** No rule to make target '/swig/sphinxbase.i', needed by 'sb.cpp'.  Stop.
make: Leaving directory '/home/pi/conduit/pocketsphinx/pocketsphinx-node/node_modules/pocketsphinx/build'
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:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.1.13-v7+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/conduit/pocketsphinx/pocketsphinx-node/node_modules/pocketsphinx
gyp ERR! node -v v5.3.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
npm ERR! Linux 4.1.13-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "pocketsphinx" "--save"
npm ERR! node v5.3.0
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE

npm ERR! pocketsphinx@5.0.5 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the pocketsphinx@5.0.5 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, 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:

The following are compiled and installed correctly:

  1. sphinxbase version 5prealpha
  2. pocketshinx version 5prealpha (Tested this works well: pocketsphinx_continuous -inmic yes)
  3. swig3.0: Version 3.0.2
  4. node: version 5.3.0
  5. node-gyp: version 3.2.1
  6. pkg-config: version 0.28

I see that the source code of sphinxbase contains the reported /swig/sphinxbase.i file here: https://github.com/cmusphinx/sphinxbase/blob/master/swig/sphinxbase.i

Do I need to be storing the source code in a relative path? Currently my directory structure looks as follows:

projectName
├── package.json
└── sphinxbase
nshmyrev commented 8 years ago

Provide the output of the following commands:

  pkg-config --variable=datadir sphinxbase
  pkg-config --modversion sphinxbase
ashishbajaj99 commented 8 years ago

Looks like the first one "datadir" is not found:

pi@ashiya:~/conduit/pocketsphinx/pocketsphinx-node $ pkg-config --variable=datadir sphinxbase

pi@ashiya:~/conduit/pocketsphinx/pocketsphinx-node $ pkg-config --modversion sphinxbase
5prealpha

Do I need to explicitly set it up?

Here are all the variables associated with the sphinxbase package (setup by the sphinxbase buildsystem?):

pi@ashiya:~/conduit/pocketsphinx/pocketsphinx-node $ pkg-config --print-variables sphinxbase
exec_prefix
prefix
libdir
includedir
libs
pi@ashiya:~/conduit/pocketsphinx/pocketsphinx-node $ pkg-config --variable=exec_prefix sphinxbase
/usr/local
pi@ashiya:~/conduit/pocketsphinx/pocketsphinx-node $ pkg-config --variable=prefix sphinxbase
/usr/local
pi@ashiya:~/conduit/pocketsphinx/pocketsphinx-node $ pkg-config --variable=libdir sphinxbase
/usr/local/lib
pi@ashiya:~/conduit/pocketsphinx/pocketsphinx-node $ pkg-config --variable=includedir sphinxbase
/usr/local/include
pi@ashiya:~/conduit/pocketsphinx/pocketsphinx-node $ pkg-config --variable=libs sphinxbase
"-lasound -lpthread -lm "

Here is some more info in case it helps?

pi@ashiya:~ $ pkg-config --cflags --libs pocketsphinx 
-I/usr/local/include -I/usr/local/include/sphinxbase -I/usr/local/include/pocketsphinx -I/usr/local/include -I/usr/local/include/sphinxbase -L/usr/local/lib -lpocketsphinx -lsphinxbase -lsphinxad -lasound -lpthread -lm 
pi@ashiya:~ $ pkg-config --cflags --libs sphinxbase 
-I/usr/local/include -I/usr/local/include/sphinxbase -L/usr/local/lib -lsphinxbase -lsphinxad -lasound -lpthread -lm 
ashishbajaj99 commented 8 years ago

Based on my previous comment, were you able to identify the problem?

nshmyrev commented 8 years ago

Datadir variable should be there. Are you sure you compiled latest sphinxbase from github? Please share the file /usr/local/lib/pkgconfig/sphinxbase.pc

ashishbajaj99 commented 8 years ago

Here is the sphinxbase.pc file:

pi@ashiya:~ $ cat /usr/local/lib/pkgconfig/sphinxbase.pc 
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
libs="-lasound -lpthread -lm "

Name: SphinxBase
Description: Shared components for Sphinx speech recognition
Version: 5prealpha
URL: http://www.cmusphinx.org/
Libs: -L${libdir} -lsphinxbase -lsphinxad -lasound -lpthread -lm 
Libs.private: ${libs}
Cflags: -I${includedir} -I${includedir}/sphinxbase

I got the code from the links pointed to from the official download page here: http://cmusphinx.sourceforge.net/wiki/download

They point to sourceforge and here is how I got them:

wget http://sourceforge.net/projects/cmusphinx/files/sphinxbase/5prealpha/sphinxbase-5prealpha.tar.gz
wget http://sourceforge.net/projects/cmusphinx/files/pocketsphinx/5prealpha/pocketsphinx-5prealpha.tar.gz
nshmyrev commented 8 years ago

You need to get latest sphinxbase from github.

README says that.

ashishbajaj99 commented 8 years ago

Works now - yes agree it mentions it, but its not clear if its a must have. Would be super if the README is made a lot more readable - definitely would've saved me a lot of time. Let me know if you want help with this, I can help set it up.