cmusphinx / node-pocketsphinx

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

Install fails also with node 6.10 #41

Closed nielsnl68 closed 7 years ago

nielsnl68 commented 7 years ago

When i try to install i get an issue with swig not getting the right path. It looks like that "pkg-config --variable datadir sphinxbase OUTPUT_VARIABLE SB_DATADIR OUTPUT_STRIP_TRAILING_WHITESPACE" does not set the right variable anymore.


pocketsphinx@5.0.7 install /home/pi/node_modules/pocketsphinx
cmake-js compile

info TOOL Using Unix Makefiles generator.
info TOOL Using c++11 compiler standard.
info CMD CONFIGURE
WARN invalid config loglevel="notice"
info RUN cmake "/home/pi/node_modules/pocketsphinx" --no-warn-unused-cli -G"Unix Makefiles" -DCMAKE_JS_VERSION="3.4.1" -DCMAKE_BUILD_TYPE="Release " -DCMAKE_LIBRARY_OUTPUT_DIRECTORY="/home/pi/node_modules/pocketsphinx/build/Release" -DCMAKE_JS_INC="/home/pi/.cmake-js/node-arm/v6.10.3/include/ node" -DNODE_RUNTIME="node" -DNODE_RUNTIMEVERSION="6.10.3" -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")
-- Found SWIG: /usr/local/bin/swig (found suitable version "4.0.0", minimum required is "3.0.7")
-- Checking for module 'sphinxbase>=5prealpha'
-- Found sphinxbase, version 5prealpha
-- Checking for module 'pocketsphinx>=5prealpha'
-- Found pocketsphinx, version 5prealpha
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/node_modules/pocketsphinx/build
info CMD BUILD
info RUN cmake --build "/home/pi/node_modules/pocketsphinx/build" --config Release
[ 16%] Generating swig bindings
Unable to find file '/swig/sphinxbase.i'.
sphinxbase/CMakeFiles/SphinxBase.dir/build.make:61: recept voor doel 'sphinxbase/sb.cpp' is mislukt
make[2]: [sphinxbase/sb.cpp] Fout 1
CMakeFiles/Makefile2:85: recept voor doel 'sphinxbase/CMakeFiles/SphinxBase.dir/all' is mislukt
make[1]:
[sphinxbase/CMakeFiles/SphinxBase.dir/all] Fout 2
Makefile:83: recept voor doel 'all' is mislukt
make: [all] Fout 2
info REP Build has been failed, trying to do a full rebuild.
info CMD CLEAN
info RUN cmake -E remove_directory "/home/pi/node_modules/pocketsphinx/build"
info CMD CONFIGURE
info RUN cmake "/home/pi/node_modules/pocketsphinx" --no-warn-unused-cli -G"Unix Makefiles" -DCMAKE_JS_VERSION="3.4.1" -DCMAKE_BUILD_TYPE="Release " -DCMAKE_LIBRARY_OUTPUT_DIRECTORY="/home/pi/node_modules/pocketsphinx/build/Release" -DCMAKE_JS_INC="/home/pi/.cmake-js/node-arm/v6.10.3/include/ node" -DNODE_RUNTIME="node" -DNODE_RUNTIMEVERSION="6.10.3" -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")
-- Found SWIG: /usr/local/bin/swig (found suitable version "4.0.0", minimum required is "3.0.7")
-- Checking for module 'sphinxbase>=5prealpha'
-- Found sphinxbase, version 5prealpha
-- Checking for module 'pocketsphinx>=5prealpha'
-- Found pocketsphinx, version 5prealpha
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/node_modules/pocketsphinx/build
info CMD BUILD
info RUN cmake --build "/home/pi/node_modules/pocketsphinx/build" --config Release
[ 16%] Generating swig bindings
Unable to find file '/swig/sphinxbase.i'.
sphinxbase/CMakeFiles/SphinxBase.dir/build.make:61: recept voor doel 'sphinxbase/sb.cpp' is mislukt
make[2]:
[sphinxbase/sb.cpp] Fout 1
CMakeFiles/Makefile2:85: recept voor doel 'sphinxbase/CMakeFiles/SphinxBase.dir/all' is mislukt
make[1]: [sphinxbase/CMakeFiles/SphinxBase.dir/all] Fout 2
Makefile:83: recept voor doel 'all' is mislukt
make:
[all] Fout 2
ERR! OMG Process terminated: 2
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
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.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2017-06-03T10_52_23_959Z-debug.log

nshmyrev commented 7 years ago

README says:

Make sure that PKG_CONFIG_PATH includes the folder where you installed pocketsphinx, for example, if you installed with default prefix, export PKG_CONFIG_PATH:

    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

You can test installation with

    pkg-config --modversion pocketsphinx // This should print the version
nielsnl68 commented 7 years ago

When you think this helps, you are wrong. `pkg-config --modversion pocketsphinx' Gives the right version. And it is not clear what to do with the 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig' line must be placed or changed in.

Please reopen this until it is working for real.

nshmyrev commented 7 years ago

Run pkg-config --variable datadir sphinxbase and provide the output. Also provide your cmake version.

nielsnl68 commented 7 years ago

cmake version is 3.6.2

pkg-config --variable datadir sphinxbase does not return anything.

nshmyrev commented 7 years ago

You can check installed sphinxbase.pc file in /usr/local/lib if it actually contains datadir variable. You have probably installed some older revision without it. It also might be that you have another file in /usr/lib instead of /usr/local/lib

nielsnl68 commented 7 years ago

First of to he sure, i did use the github version os sphinxbase and pocketsphinx. I found the file in /usr/local/lib/pkgconfig

With the following content:

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

nshmyrev commented 7 years ago

Original sphinxbase.pc.in has datadir variable:

https://github.com/cmusphinx/sphinxbase/blob/master/sphinxbase.pc.in

You can check your installation of sphinxbase and probably you can try to reinstall to check when datadir disappeared.

nielsnl68 commented 7 years ago

My version of that file did not included that 'datadir variable' as well. After installing the zips from sourceforse the install of the node-red package was able to be install.

Just for knowledge; When i installed sphinxbase & pocketsphinx for the first time via github i used a insisted that i used an older version. I suspect now that at that point de datadir was not included yet.

Thanks for your time