Closed erksch closed 4 years ago
I cloned your kaldi fork alphacep/kaldi (or should I use the original repo?)
You can use original repo.
I could use cmake to generate proper windows compatible Makefiles. I could use the guide that is in kaldi/windows but that does not seem to have the result I want.
Both cmake and kaldi/windows perl based build should work.
Thank you for your lightning fast response!
Sorry one follow up question: after building with Visual Studio I end up with a lot of libs in a single folder.
I learned that .a files are the linux version of .lib files on windows. So to resolve the errors in the from my original post above, I would replace .a with .lib in the makefile and move all the required libs to the location specified in the makefile?
I would replace .a with .lib in the makefile and move all the required libs to the location specified in the makefile?
yes
I am just leaving some info here for others: When I ran make in the csharp directory I got the following error many times:
mutex in namespace std does not name a type
I researched a little bit and the fix was to replace my mingw installation with the mingw-x86_64-posix-seh
version from sourceforge. The posix versions of mingw have the neccessary runtime support for std::mutex
while many other versions have not.
You can read more about it in this stackoverflow answer.
I also had to remove this in kaldi/src/util/parse-options.h
:
#if !defined(_MSC_VER) && !defined(__CYGWIN__) // This is just a convenient place to set the stderr to line
setlinebuf(stderr); // buffering mode, since it's called at program start.
#endif // This helps ensure different programs' output is not mixed up.
Because otherwise, I got a 'setlinebuf' was not declared in this scope
error. This stackoverflow answer suggests that it is just not supported. As you can see there are already flags to disable the line but somehow they don't fire, maybe because I am building with MinGW and not cygwin or msc_ver (not sure what that is).
Hey there it's me again :D
I still have errors when I am running the Makefile (I get undefined reference to ...
many times although all libs have been found and should be linked correctly). Is there anything else in the Makefile that may not be compatible with windows? The errors occur in the libkaldiwrap.so
task, the vosk_wrap.c
seems to pass.
Hey there :)
First of all, thank you for your great work here! I would like to use the C# build for Windows programming and respectively need to compile everything on windows. But I am getting a little bit confused.
When I run make in the csharp directory, I expectedly get this error.
``` $ make g++ -fpermissive -std=c++11 -g -O2 -DPIC -fPIC -Wno-unused-function -I/kaldi/src -I/kaldi/tools/openfst/include -I../src -DFST_NO_DYNAMIC_LINKING -shared -o libkaldiwrap.so vosk_wrap.c ../src/kaldi_recognizer.cc ../src/kaldi_recognizer.h ../src/model.cc ../src/model.h ../src/spk_model.cc ../src/spk_model.h ../src/vosk_api.cc ../src/vosk_api.h /kaldi/src/online2/kaldi-online2.a /kaldi/src/decoder/kaldi-decoder.a /kaldi/src/ivector/kaldi-ivector.a /kaldi/src/gmm/kaldi-gmm.a /kaldi/src/nnet3/kaldi-nnet3.a /kaldi/src/tree/kaldi-tree.a /kaldi/src/feat/kaldi-feat.a /kaldi/src/lat/kaldi-lat.a /kaldi/src/lm/kaldi-lm.a /kaldi/src/hmm/kaldi-hmm.a /kaldi/src/transform/kaldi-transform.a /kaldi/src/cudamatrix/kaldi-cudamatrix.a /kaldi/src/matrix/kaldi-matrix.a /kaldi/src/fstext/kaldi-fstext.a /kaldi/src/util/kaldi-util.a /kaldi/src/base/kaldi-base.a /kaldi/tools/openfst/lib/libfst.a /kaldi/tools/openfst/lib/libfstngram.a /kaldi/tools/OpenBLAS/libopenblas.a -lgfortran -lstdc++ g++: error: /kaldi/src/online2/kaldi-online2.a: No such file or directory g++: error: /kaldi/src/decoder/kaldi-decoder.a: No such file or directory g++: error: /kaldi/src/ivector/kaldi-ivector.a: No such file or directory g++: error: /kaldi/src/gmm/kaldi-gmm.a: No such file or directory g++: error: /kaldi/src/nnet3/kaldi-nnet3.a: No such file or directory g++: error: /kaldi/src/tree/kaldi-tree.a: No such file or directory g++: error: /kaldi/src/feat/kaldi-feat.a: No such file or directory g++: error: /kaldi/src/lat/kaldi-lat.a: No such file or directory g++: error: /kaldi/src/lm/kaldi-lm.a: No such file or directory g++: error: /kaldi/src/hmm/kaldi-hmm.a: No such file or directory g++: error: /kaldi/src/transform/kaldi-transform.a: No such file or directory g++: error: /kaldi/src/cudamatrix/kaldi-cudamatrix.a: No such file or directory g++: error: /kaldi/src/matrix/kaldi-matrix.a: No such file or directory g++: error: /kaldi/src/fstext/kaldi-fstext.a: No such file or directory g++: error: /kaldi/src/util/kaldi-util.a: No such file or directory g++: error: /kaldi/src/base/kaldi-base.a: No such file or directory g++: error: /kaldi/tools/openfst/lib/libfst.a: No such file or directory g++: error: /kaldi/tools/openfst/lib/libfstngram.a: No such file or directory g++: error: /kaldi/tools/OpenBLAS/libopenblas.a: No such file or directory make: *** [Makefile:44: libkaldiwrap.so] Error 1 ```So I guess I need to build the kaldi libraries first. I cloned your kaldi fork
alphacep/kaldi
(or should I use the original repo?) but after that I was not sure what to do. I could either runmake
inkaldi/tools
andkaldi/base
but that would not work because the Makefiles do not work for windows. I could use cmake to generate proper windows compatible Makefiles. I could use the guide that is inkaldi/windows
but that does not seem to have the result I want.What is the right way to get to the required libraries at the correct location?
I am sorry if this is trivial or more a question on Kaldi's side.