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

Failed to install pykaldi #279

Open
soroushhashemifar opened this issue Jun 20, 2021 · 3 comments
Open

Failed to install pykaldi #279

soroushhashemifar opened this issue Jun 20, 2021 · 3 comments

Comments

@soroushhashemifar
Copy link

I followed the instructions and ran the following to commands to install pykaldi:

git clone https://github.com/pykaldi/pykaldi.git
cd pykaldi
sudo apt-get install autoconf automake cmake curl g++ git graphviz libatlas3-base libtool make pkg-config subversion unzip wget zlib1g-dev
sudo apt install intel-mkl-64bit-2020.4-912
python3.7 -m pip install --upgrade pip setuptools
python3.7 -m pip install numpy pyparsing ninja==1.10.0
cd tools
sudo torify ./check_dependencies.sh /usr/bin/python3.7
sudo torify ./install_protobuf.sh /usr/bin/python3.7
sudo torify ./install_clif.sh /usr/bin/python3.7
sudo torify ./install_kaldi.sh
cd ..
python3.7 -m pip install setuptools 
sudo apt-get install ninja-build
sudo python3.7 setup.py install

I get this error for the last line:


running install
running bdist_egg
running egg_info
writing pykaldi.egg-info/PKG-INFO
writing dependency_links to pykaldi.egg-info/dependency_links.txt
writing requirements to pykaldi.egg-info/requires.txt
writing top-level names to pykaldi.egg-info/top_level.txt
reading manifest file 'pykaldi.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'pykaldi.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
Using PYCLIF: /usr/local/bin/pyclif
Using CLIF_MATCHER: /usr/clang/bin/clif-matcher
-- Configuring done
-- Generating done
-- Build files have been written to: /home/soroushh/KhodnevisProjects/wav2vec-u/pykaldi/build
[6/505] Building CXX object kaldi/matrix/CMakeFiles/_matrix_ext.dir/matrix-ext.cc.o
FAILED: kaldi/matrix/CMakeFiles/_matrix_ext.dir/matrix-ext.cc.o 
/usr/bin/c++  -D_matrix_ext_EXPORTS -I../kaldi/lib -I../kaldi -Ikaldi -I../tools/kaldi/src -I/usr/include/python2.7 -I/home/soroushh/.local/lib/python3.7/site-packages/numpy/core/include -std=c++11 -I.. -isystem /home/soroushh/KhodnevisProjects/wav2vec-u/pykaldi/tools/kaldi/tools/openfst-1.6.7/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_MKL -I/opt/intel/mkl/include -m64 -msse -msse2 -pthread -g -fPIC -Wno-maybe-uninitialized -fPIC -MD -MT kaldi/matrix/CMakeFiles/_matrix_ext.dir/matrix-ext.cc.o -MF kaldi/matrix/CMakeFiles/_matrix_ext.dir/matrix-ext.cc.o.d -o kaldi/matrix/CMakeFiles/_matrix_ext.dir/matrix-ext.cc.o -c ../kaldi/matrix/matrix-ext.cc
In file included from /home/soroushh/.local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:4:0,
                 from /home/soroushh/.local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 from /home/soroushh/.local/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from ../kaldi/matrix/matrix-ext.cc:8:
/home/soroushh/.local/lib/python3.7/site-packages/numpy/core/include/numpy/npy_common.h:386:9: error: ‘Py_hash_t’ does not name a type
 typedef Py_hash_t npy_hash_t;
         ^~~~~~~~~
In file included from /home/soroushh/.local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:0,
                 from /home/soroushh/.local/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from ../kaldi/matrix/matrix-ext.cc:8:
/home/soroushh/.local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:655:9: error: ‘npy_hash_t’ does not name a type; did you mean ‘npy_half’?
         npy_hash_t hash;
         ^~~~~~~~~~
         npy_half
[11/505] Building CXX object kaldi/chain/CMakeFiles/_chain_generic_numerator.dir/chain-generic-numerator-clifwrap.cc.o
ninja: build stopped: subcommand failed.
Command '['ninja', '-j', '6']' returned non-zero exit status 1.
@bmilde
Copy link
Contributor

bmilde commented Jun 20, 2021 via email

@soroushhashemifar
Copy link
Author

Please give more details of your system (OS/distro, g++ version, numpy version, etc) I'd recommend using a virtual environment for Python to install everything. You can also try with Python 3.8, but actually our build succeeds in the CI github pipeline with ubuntu 20.04 / python 3.7 so I'm not sure why you're running into this issue.

On Sun, Jun 20, 2021, 12:38 PM Soroush Hashemi Far @.***> wrote: I followed the instructions and ran the following to commands to install pykaldi: git clone https://github.com/pykaldi/pykaldi.git cd pykaldi sudo apt-get install autoconf automake cmake curl g++ git graphviz libatlas3-base libtool make pkg-config subversion unzip wget zlib1g-dev sudo apt install intel-mkl-64bit-2020.4-912 python3.7 -m pip install --upgrade pip setuptools python3.7 -m pip install numpy pyparsing ninja==1.10.0 cd tools sudo torify ./check_dependencies.sh /usr/bin/python3.7 sudo torify ./install_protobuf.sh /usr/bin/python3.7 sudo torify ./install_clif.sh /usr/bin/python3.7 sudo torify ./install_kaldi.sh cd .. python3.7 -m pip install setuptools sudo apt-get install ninja-build sudo python3.7 setup.py install I get this error for the last line: running install running bdist_egg running egg_info writing pykaldi.egg-info/PKG-INFO writing dependency_links to pykaldi.egg-info/dependency_links.txt writing requirements to pykaldi.egg-info/requires.txt writing top-level names to pykaldi.egg-info/top_level.txt reading manifest file 'pykaldi.egg-info/SOURCES.txt' adding license file 'LICENSE' writing manifest file 'pykaldi.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py running build_ext Using PYCLIF: /usr/local/bin/pyclif Using CLIF_MATCHER: /usr/clang/bin/clif-matcher -- Configuring done -- Generating done -- Build files have been written to: /home/soroushh/KhodnevisProjects/wav2vec-u/pykaldi/build [6/505] Building CXX object kaldi/matrix/CMakeFiles/_matrix_ext.dir/matrix-ext.cc.o FAILED: kaldi/matrix/CMakeFiles/_matrix_ext.dir/matrix-ext.cc.o /usr/bin/c++ -D_matrix_ext_EXPORTS -I../kaldi/lib -I../kaldi -Ikaldi -I../tools/kaldi/src -I/usr/include/python2.7 -I/home/soroushh/.local/lib/python3.7/site-packages/numpy/core/include -std=c++11 -I.. -isystem /home/soroushh/KhodnevisProjects/wav2vec-u/pykaldi/tools/kaldi/tools/openfst-1.6.7/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_MKL -I/opt/intel/mkl/include -m64 -msse -msse2 -pthread -g -fPIC -Wno-maybe-uninitialized -fPIC -MD -MT kaldi/matrix/CMakeFiles/_matrix_ext.dir/matrix-ext.cc.o -MF kaldi/matrix/CMakeFiles/_matrix_ext.dir/matrix-ext.cc.o.d -o kaldi/matrix/CMakeFiles/_matrix_ext.dir/matrix-ext.cc.o -c ../kaldi/matrix/matrix-ext.cc In file included from /home/soroushh/.local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:4:0, from /home/soroushh/.local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12, from /home/soroushh/.local/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, from ../kaldi/matrix/matrix-ext.cc:8: /home/soroushh/.local/lib/python3.7/site-packages/numpy/core/include/numpy/npy_common.h:386:9: error: ‘Py_hash_t’ does not name a type typedef Py_hash_t npy_hash_t; ^~~~~~~~~ In file included from /home/soroushh/.local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:0, from /home/soroushh/.local/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, from ../kaldi/matrix/matrix-ext.cc:8: /home/soroushh/.local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:655:9: error: ‘npy_hash_t’ does not name a type; did you mean ‘npy_half’? npy_hash_t hash; ^~~~~~~~~~ npy_half [11/505] Building CXX object kaldi/chain/CMakeFiles/_chain_generic_numerator.dir/chain-generic-numerator-clifwrap.cc.o ninja: build stopped: subcommand failed. Command '['ninja', '-j', '6']' returned non-zero exit status 1. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#279>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACKGA6VUGF2EJRJZQG4AA3DTTXAL7ANCNFSM4676MVJA .

My system spec:

  • Ubuntu 18.04
  • gcc version 7.5.0
  • Numpy 1.20.3

after a few investigation I found that "ninja -j 6" give the below error:

ninja: error: loading 'build.ninja': No such file or directory

and this causes the error above. I have no idea how to resolve it.

@RanoRaraku
Copy link

Hi, I got the same error :
Command '['ninja', '-j', '18']' returned non-zero exit status 1.

I tried to install it from a conda env with Python 3.8.12, ninja 1.10.2.3,
Did you find a solution?

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

3 participants