The main difficulty in compiling kaldi in Visual Studio 2013 lies in the correct compilation of the kaldi dependency library, mainly including openfst, Atlas, and pthreadvc2, which are the most difficult to compile Atlas. Therefore, in order to make the entire compilation logic clear and concise, compilation of all the dependent libraries of kaldi will be ignored here. If there is time, I will provide the libraries on which it depends.
Compiling environment:
- Operating System: Windows 8 (recommended)
- Compilation tool: Visual studio2013
- Others: Install the complete cygwin Environment
Compilation steps:
- Create solution: Open Visual Studio 2013 and create a Win32 project. The solution name is kalid_vs13. You can write a simple helloworld program to test whether the project is successfully created.
- Create a project: in solution kalid_vs13, use the DLL Project template to add a new project kalid-lib.
- Add source file: Set * under kaldi-trunk/src *. add the CC file to the project kalid-Lib. Note that test files in the * bin directory and other file names that contain the keyword "test" are not allowed here *. add the CC file to kalid-lib
- Configure the relevant attributes of kalid-lib, including: 1) configure the reference directory of the header file, 2) pre-processor-defined macros (have_atlas), and 3) reference of the dependent Library (openfst. lib, Atlas. lib, pthreadvc2.lib)
- Other configuration: Because the nnet1 and nnet2 directories have the same file name: nnet-nnet.cc and nnet-componet.cc, You need to configure the "object file name" in their respective "output file", for example, you can set the object file name of the nnet-nnet.cc in nnet1 to $ (intdir) nnet1 \, the object file name of the nnet-nnet.cc in nnet2 to $ (intdir) nnet2 \, and other duplicate files, and so on.
Note:
1. To compile the program smoothly, you still need to modify some kaldi source files. I will submit some patches to the official team so that you can compile the program smoothly.
2. The above compiling environment is my own. I'm not sure if other environments can work.
3. This article mainly describes the overall compilation idea of kaldi and does not focus on compilation details for the time being!