dmitriy-serdyuk / kaldi-python

Python wrappers for Kaldi data
Apache License 2.0
33 stars 17 forks source link

Removed thread/kaldi-thread.a dependency in kaldi_io/Makefile #15

Closed Jonathan-LeRoux closed 7 years ago

Jonathan-LeRoux commented 7 years ago

Kaldi now uses STL thread support library instead of pthread, see this commit. In particular, thread/kaldi-thread.a was removed, preventing kaldi_io from compiling.

dmitriy-serdyuk commented 7 years ago

Thank you!

Jonathan-LeRoux commented 7 years ago

I actually noticed that this does not work with the latest commits of kaldi. I believe the issue is on the kaldi side, but I wasn't able to find out how to fix it. I cannot import kaldi_io if I use a kaldi commit since this commit. kaldi_io_internal.so gets built, but only because the compilation command does not include -Wl,--no-undefined, which disallows undefined references. With that flag, I get the following error:

/remote/mm0/data1/leroux/kaldi_io_test/kaldi_python/../kaldi//src/util/kaldi-util.a(kaldi-holder.o): In function `kaldi::ExtractObjectRange(kaldi::GeneralMatrix const&, std::string const&, kaldi::GeneralMatrix*)':
/remote/mm0/data1/leroux/kaldi_io_test/kaldi_github/src/util/kaldi-holder.cc:95: undefined reference to `kaldi::GeneralMatrix::Type() const'
/remote/mm0/data1/leroux/kaldi_io_test/kaldi_github/src/util/kaldi-holder.cc:96: undefined reference to `kaldi::GeneralMatrix::GetFullMatrix() const'
/remote/mm0/data1/leroux/kaldi_io_test/kaldi_github/src/util/kaldi-holder.cc:98: undefined reference to `kaldi::GeneralMatrix::Type() const'
/remote/mm0/data1/leroux/kaldi_io_test/kaldi_github/src/util/kaldi-holder.cc:99: undefined reference to `kaldi::GeneralMatrix::GetCompressedMatrix() const'
/remote/mm0/data1/leroux/kaldi_io_test/kaldi_github/src/util/kaldi-holder.cc:102: undefined reference to `kaldi::GeneralMatrix::Type() const'
/remote/mm0/data1/leroux/kaldi_io_test/kaldi_github/src/util/kaldi-holder.cc:106: undefined reference to `kaldi::GeneralMatrix::GetMatrix(kaldi::Matrix<float>*) const'
/remote/mm0/data1/leroux/kaldi_io_test/kaldi_github/src/util/kaldi-holder.cc:109: undefined reference to `kaldi::GeneralMatrix::Clear()'
/remote/mm0/data1/leroux/kaldi_io_test/kaldi_github/src/util/kaldi-holder.cc:110: undefined reference to `kaldi::GeneralMatrix::SwapFullMatrix(kaldi::Matrix<float>*)'
collect2: error: ld returned 1 exit status

I personally don't need the latest version of kaldi, so my workaround is to just build kaldi after checking out this kaldi commit, the last one before the bug/incompatibility was introduced: git checkout 40620fca867b6f0215ecb7414c6b8c0c4b714ac8