cmusphinx / node-pocketsphinx

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

Installation Fails on Raspberry Pi2 / Pi3 #26

Closed punitganshani closed 8 years ago

punitganshani commented 8 years ago

Here's what is installed

CMAKE

pi@raspberrypi:~ $ cmake --version
cmake version 3.5.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).

SWIG

pi@raspberrypi:~ $ swig -version

SWIG Version 3.0.8
Compiled with g++ [armv7l-unknown-linux-gnueabihf]
Configured options: +pcre
Please see http://www.swig.org for reporting bugs and further information

Then I installed cmake-js

pi@raspberrypi:~ $ npm install cmake-js -g
npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN deprecated graceful-fs@3.0.8: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
/usr/local/bin/cmake-js -> /usr/local/lib/node_modules/cmake-js/bin/cmake-js
/usr/local/lib
└── cmake-js@3.2.1

Now I tried installing this package using NPM and it still doesn't find right SWIG and it gives error

Could NOT find SWIG: Found unsuitable version "2.0.12", but required is at least "3.0.7" (found /usr/bin/swig2.0)

pi@raspberrypi:~ $ npm install pocketsphinx -g

> pocketsphinx@5.0.7 install /usr/local/lib/node_modules/pocketsphinx
> cmake-js compile

(node:3499) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
info TOOL Using Unix Makefiles generator.
info TOOL Using c++11 compiler standard.
info CMD CONFIGURE
info RUN cmake "/usr/local/lib/node_modules/pocketsphinx" --no-warn-unused-cli -G"Unix Makefiles" -DCMAKE_JS_VERSION="3.2.1" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_LIBRARY_OUTPUT_DIRECTORY="/usr/local/lib/node_modules/pocketsphinx/build/Release" -DCMAKE_JS_INC="/home/pi/.cmake-js/node-arm/v6.1.0/include/node" -DNODE_RUNTIME="node" -DNODE_RUNTIMEVERSION="6.1.0" -DNODE_ARCH="arm" -DCMAKE_CXX_FLAGS="-std=c++11"
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.28")
CMake Error at /usr/local/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find SWIG: Found unsuitable version "2.0.12", but required is at
  least "3.0.7" (found /usr/bin/swig2.0)
Call Stack (most recent call first):
  /usr/local/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:386 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/share/cmake-3.5/Modules/FindSWIG.cmake:75 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:4 (find_package)

-- Configuring incomplete, errors occurred!
See also "/usr/local/lib/node_modules/pocketsphinx/build/CMakeFiles/CMakeOutput.log".
info REP Build has been failed, trying to do a full rebuild.
info CMD CLEAN
info RUN cmake -E remove_directory "/usr/local/lib/node_modules/pocketsphinx/build"
info CMD CONFIGURE
info RUN cmake "/usr/local/lib/node_modules/pocketsphinx" --no-warn-unused-cli -G"Unix Makefiles" -DCMAKE_JS_VERSION="3.2.1" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_LIBRARY_OUTPUT_DIRECTORY="/usr/local/lib/node_modules/pocketsphinx/build/Release" -DCMAKE_JS_INC="/home/pi/.cmake-js/node-arm/v6.1.0/include/node" -DNODE_RUNTIME="node" -DNODE_RUNTIMEVERSION="6.1.0" -DNODE_ARCH="arm" -DCMAKE_CXX_FLAGS="-std=c++11"
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.28")
CMake Error at /usr/local/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
 Could NOT find SWIG: Found unsuitable version "2.0.12", but required is at
  least "3.0.7" (found /usr/bin/swig2.0)
Call Stack (most recent call first):
  /usr/local/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:386 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/share/cmake-3.5/Modules/FindSWIG.cmake:75 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:4 (find_package)

-- Configuring incomplete, errors occurred!
See also "/usr/local/lib/node_modules/pocketsphinx/build/CMakeFiles/CMakeOutput.log".
ERR! OMG Process terminated: 1
npm ERR! Linux 4.4.9-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "pocketsphinx" "-g"
npm ERR! node v6.1.0
npm ERR! npm  v3.9.0
npm ERR! code ELIFECYCLE

npm ERR! pocketsphinx@5.0.7 install: `cmake-js compile`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pocketsphinx@5.0.7 install script 'cmake-js compile'.
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!     cmake-js compile
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs pocketsphinx
npm ERR! Or if that isn't available, 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!     /home/pi/npm-debug.log

I don't have the nodejs package swig installed. What's the issue here?

nshmyrev commented 8 years ago

You have old swig2.0 installed on your system, you need to remove it.

punitganshani commented 8 years ago

I did run sudo apt-get remove swig but it uninstalled successfully. Still same issue

nshmyrev commented 8 years ago

What exactly is "the same"

punitganshani commented 8 years ago
Could NOT find SWIG: Found unsuitable version "2.0.12", but required is at
least "3.0.7" (found /usr/bin/swig2.0)
nshmyrev commented 8 years ago

And, what you do not understand in this message? It says you have swig2.0. It does not lie or try to fool you, it just states the fact.

punitganshani commented 8 years ago

Appreciate your help!

Figured it out. SWIG 3.0.8 was installed but I had to manually delete the link and it worked now sudo rm -rf /usr/bin/swig2.0