Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

instillation error #84

Closed
srgangireddy opened this issue Mar 7, 2019 · 15 comments
Closed

instillation error #84

srgangireddy opened this issue Mar 7, 2019 · 15 comments

Comments

@srgangireddy
Copy link

I followed the steps given in README page but gettign the following errors when I did "python setup.py install"

[9/983] Building CXX object kaldi/base/CMakeFiles/_kaldi_error.dir/kaldi-error-clifwrap-init.cc.o
FAILED: kaldi/base/CMakeFiles/_kaldi_error.dir/kaldi-error-clifwrap-init.cc.o
/usr/bin/c++ -D_kaldi_error_EXPORTS -I../kaldi/lib -I../kaldi -Ikaldi -I../tools/kaldi/src -I/usr/include/python2.7 -I/home/sgangireddy/venv_py36/lib/python3.6/site-packages/numpy/core/include -std=c++11 -I.. -isystem /home/sgangireddy/PycharmProjects/pykaldi/tools/kaldi/tools/openfst/include -O1 -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/home/sgangireddy/PycharmProjects/pykaldi/tools/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g -fPIC -Wno-maybe-uninitialized -fPIC -MD -MT kaldi/base/CMakeFiles/_kaldi_error.dir/kaldi-error-clifwrap-init.cc.o -MF kaldi/base/CMakeFiles/_kaldi_error.dir/kaldi-error-clifwrap-init.cc.o.d -o kaldi/base/CMakeFiles/_kaldi_error.dir/kaldi-error-clifwrap-init.cc.o -c kaldi/base/kaldi-error-clifwrap-init.cc
kaldi/base/kaldi-error-clifwrap-init.cc: In function ‘void PyInit__kaldi_error()’:
kaldi/base/kaldi-error-clifwrap-init.cc:17:60: error: return-statement with a value, in function returning 'void' [-fpermissive]
if (!kaldi_base___kaldi__error_clifwrap::Ready()) return nullptr;
^
kaldi/base/kaldi-error-clifwrap-init.cc:18:51: error: return-statement with a value, in function returning 'void' [-fpermissive]
return kaldi_base___kaldi__error_clifwrap::Init();
^
[12/983] Building CXX object kaldi/base/CMakeFiles/_kaldi_error.dir/kaldi-error-clifwrap.cc.o
FAILED: kaldi/base/CMakeFiles/_kaldi_error.dir/kaldi-error-clifwrap.cc.o
/usr/bin/c++ -D_kaldi_error_EXPORTS -I../kaldi/lib -I../kaldi -Ikaldi -I../tools/kaldi/src -I/usr/include/python2.7 -I/home/sgangireddy/venv_py36/lib/python3.6/site-packages/numpy/core/include -std=c++11 -I.. -isystem /home/sgangireddy/PycharmProjects/pykaldi/tools/kaldi/tools/openfst/include -O1 -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/home/sgangireddy/PycharmProjects/pykaldi/tools/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g -fPIC -Wno-maybe-uninitialized -fPIC -MD -MT kaldi/base/CMakeFiles/_kaldi_error.dir/kaldi-error-clifwrap.cc.o -MF kaldi/base/CMakeFiles/_kaldi_error.dir/kaldi-error-clifwrap.cc.o.d -o kaldi/base/CMakeFiles/_kaldi_error.dir/kaldi-error-clifwrap.cc.o -c kaldi/base/kaldi-error-clifwrap.cc
kaldi/base/kaldi-error-clifwrap.cc:167:27: error: variable ‘kaldi_base___kaldi__error_clifwrap::PyModuleDef kaldi_base___kaldi__error_clifwrap::Module’ has initializer but incomplete type
static struct PyModuleDef Module = {
^
kaldi/base/kaldi-error-clifwrap.cc:168:3: error: ‘PyModuleDef_HEAD_INIT’ was not declared in this scope
PyModuleDef_HEAD_INIT,
^
kaldi/base/kaldi-error-clifwrap.cc: In function ‘PyObject* kaldi_base___kaldi__error_clifwrap::Init()’:
kaldi/base/kaldi-error-clifwrap.cc:176:45: error: ‘PyModule_Create’ was not declared in this scope
PyObject* module = PyModule_Create(&Module);
^
[13/983] Building CXX object kaldi/base/CMakeFiles/_kaldi_math.dir/kaldi-math-clifwrap.cc.o
FAILED: kaldi/base/CMakeFiles/_kaldi_math.dir/kaldi-math-clifwrap.cc.o
/usr/bin/c++ -D_kaldi_math_EXPORTS -I../kaldi/lib -I../kaldi -Ikaldi -I../tools/kaldi/src -I/usr/include/python2.7 -I/home/sgangireddy/venv_py36/lib/python3.6/site-packages/numpy/core/include -std=c++11 -I.. -isystem /home/sgangireddy/PycharmProjects/pykaldi/tools/kaldi/tools/openfst/include -O1 -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-declarations -Winit-self -DKALDI_DOUBLEPRECISION=0 -DHAVE_EXECINFO_H=1 -DHAVE_CXXABI_H -DHAVE_ATLAS -I/home/sgangireddy/PycharmProjects/pykaldi/tools/kaldi/tools/ATLAS_headers/include -msse -msse2 -pthread -g -fPIC -Wno-maybe-uninitialized -fPIC -MD -MT kaldi/base/CMakeFiles/_kaldi_math.dir/kaldi-math-clifwrap.cc.o -MF kaldi/base/CMakeFiles/_kaldi_math.dir/kaldi-math-clifwrap.cc.o.d -o kaldi/base/CMakeFiles/_kaldi_math.dir/kaldi-math-clifwrap.cc.o -c kaldi/base/kaldi-math-clifwrap.cc
kaldi/base/kaldi-math-clifwrap.cc: In function ‘int kaldi_base___kaldi__math_clifwrap::pyRandomState::set_seed(PyObject*, PyObject*, void*)’:
kaldi/base/kaldi-math-clifwrap.cc:44:87: error: ‘PyUnicode_AsUTF8’ was not declared in this scope
PyErr_Format(PyExc_ValueError, "%s is not valid for seed:int", s? PyUnicode_AsUTF8(s): "input");
^
kaldi/base/kaldi-math-clifwrap.cc: At global scope:
kaldi/base/kaldi-math-clifwrap.cc:781:27: error: variable ‘kaldi_base___kaldi__math_clifwrap::PyModuleDef kaldi_base___kaldi__math_clifwrap::Module’ has initializer but incomplete type
static struct PyModuleDef Module = {
^
kaldi/base/kaldi-math-clifwrap.cc:782:3: error: ‘PyModuleDef_HEAD_INIT’ was not declared in this scope
PyModuleDef_HEAD_INIT,
^
kaldi/base/kaldi-math-clifwrap.cc: In function ‘PyObject* kaldi_base___kaldi__math_clifwrap::Init()’:
kaldi/base/kaldi-math-clifwrap.cc:790:45: error: ‘PyModule_Create’ was not declared in this scope
PyObject* module = PyModule_Create(&Module);
^
[14/983] Generating fstream-clifwrap.cc, fstream-clifwrap.h, fstream-clifwrap-init.cc
ninja: build stopped: subcommand failed.
Command '['ninja', '-j', '6']' returned non-zero exit status 1.

@eracube
Copy link

eracube commented Mar 7, 2019

I have got a similar error

Line .123456789.123456789.123456789.123456789
1:from "fstext/symbol-table-clifwrap.h" import *\n
2:from "fstext/float-weight-clifwrap.h" import *\n
3:from "fstext/lattice-weight-clifwrap.h" import *\n
4:from "fstext/fst-clifwrap.h" import *\n
5:from "fstext/expanded-fst-clifwrap.h" import *\n
6:from "fstext/mutable-fst-clifwrap.h" import *\n
7:from "fstext/vector-fst-clifwrap.h" import *\n
8:from "fstext/fstext-utils.h" import *\n
9:\n
10:from kaldi.util import _value_error_on_false\n
11:\n
12:from "fstext/fstext-utils-inl.h":\n
............

_ParseError: include "fstext/expanded-fst-clifwrap.h" not found
[134/983] Building CXX object kaldi/fstext/CMakeFiles/_log_construct2_ops.dir/log-construct2-ops-clifwrap.cc.o
ninja: build stopped: subcommand failed.
Command '['ninja', '-j', '2']' returned non-zero exit status 1.

@dogancan
Copy link
Member

dogancan commented Mar 7, 2019

@srgangireddy It seems the python include directory detected by cmake is not compatible with the active python environment where numpy is installed. See below for the relevant compiler flags from your error log.

... -I/usr/include/python2.7 -I/home/sgangireddy/venv_py36/lib/python3.6/site-packages/numpy/core/include ...

My guess is you are trying to install inside a python3.6 virtual environment but cmake is somehow picking up the include directory for system python2.7. Is PYTHONPATH set in your shell environment?

@dogancan
Copy link
Member

dogancan commented Mar 7, 2019

@eracube I just pushed a fix for your problem. Could you retry building after pulling the latest changes and report here what happens?

@eracube
Copy link

eracube commented Mar 8, 2019

@eracube I just pushed a fix for your problem. Could you retry building after pulling the latest changes and report here what happens?

Thank you @dogancan I have successfully build it. Now I have to make ASR to work. Unfortunately, I don't have a large dataset to train my model.

@dogancan
Copy link
Member

dogancan commented Mar 8, 2019

@eracube You're welcome. Note that pykaldi does not provide any high-level utilities or APIs for ASR training. If you want to train your own models, you will have to use kaldi recipes. Alternatively, you might be able to find pre-trained models, like the ones downloaded when you run the example setups in pykaldi/examples/setups.

@srgangireddy
Copy link
Author

@dogancan ; Earlier I tried to build from source but now build using docker. Now the build is successful. Thank you.

@dogancan
Copy link
Member

You're welcome. I am closing this issue, but feel free to reopen.

@eracube
Copy link

eracube commented Mar 14, 2019

Hello @dogancan, I was able to install pykaldi on my mac successfully but I tried to install the same in my linux machine and it gives me the following error when I try to install clif :

Cloning into '/pykaldi/tools/clif'...
remote: Enumerating objects: 512, done.
remote: Total 512 (delta 0), reused 0 (delta 0), pack-reused 512
Receiving objects: 100% (512/512), 367.24 KiB | 0 bytes/s, done.
Resolving deltas: 100% (298/298), done.
Checking connectivity... done.
Already up-to-date.
/pykaldi/env/bin/ninja
Using ninja for the clif backend build.
Checked out revision 307315.
Checked out revision 307315.
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Check for working C compiler using: Ninja
CMake Error:
The detected version of Ninja () is less than the version of Ninja required
by CMake (1.3).

CMake Error: Internal CMake error, TryCompile generation of cmake failed
-- Check for working C compiler using: Ninja -- broken
CMake Error at /usr/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "/usr/bin/cc" is not able to compile a simple test program.

It fails with the following output:

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:54 (project)

-- Configuring incomplete, errors occurred!
See also "/pykaldi/tools/clif_backend/build_matcher/CMakeFiles/CMakeOutput.log".
See also "/pykaldi/tools/clif_backend/build_matcher/CMakeFiles/CMakeError.log".

The ninja version that is installed is ninja==1.9.0

@dogancan
Copy link
Member

It seems like CMake is confused about ninja version. Can you try removing pykaldi/tools/clif_backend directory and rerunning install_clif.sh?

@eracube
Copy link

eracube commented Mar 14, 2019

I removed the clif_backend directory and ran install_clif.sh, but I am still getting the same issue.

@dogancan
Copy link
Member

Do you have a system wide old ninja installation? For some reason CMake is not able to determine the version of ninja inside your virtual environment. This is likely a CMake bug.

@dogancan
Copy link
Member

Another option would be to remove all ninja installations. Then the build scripts would use make instead of ninja. It would run somewhat slower but at least you would be able to build clif and pykaldi.

@eracube
Copy link

eracube commented Mar 14, 2019

I don't have ninja installed on this machine. I had tried re-running after removing my local ninja installation but forgot to remove pykaldi/tools/clif_backend. It is fixed now using make. However, I am still not sure why CMake is confused whether or not ninja is installed. Thank you for this.

@dogancan
Copy link
Member

Same here. I don’t know why CMake is confused. This is not something we have seen before. I am glad removing ninja worked out.

@abdowiss
Copy link

abdowiss commented Aug 5, 2019

pykaldi is very Complicated in installation on windows

mrd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants