Windows下编译kaldi遇到的一些问题--openfst(一)

按照kaldi/windows/INSTALL.md中的教程来。

首先,系统上要装有cmake,vs2017,git等

执行下面代码,安装编译openfst

    $ git clone https://github.com/kkm000/openfst.git
    $ cd openfst
    $ mkdir build64
    $ cd build64
    $ cmake -G "Visual Studio 15 2017 Win64" ../

然后,原文说,最后一条指令通常将会输出看起来像下面一样的内容,不要进行过多的解读

-- The C compiler identification is MSVC 19.11.25547.0
    -- The CXX compiler identification is MSVC 19.11.25547.0
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x64/cl.exe
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x64/cl.exe -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x64/cl.exe
    -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x64/cl.exe -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- The following ICU libraries were not found:
    --   data (required)
    --   i18n (required)
    --   io (required)
    --   test (required)
    --   tu (required)
    --   uc (required)
    -- Failed to find all ICU components (missing: ICU_INCLUDE_DIR ICU_LIBRARY _ICU_REQUIRED_LIBS_FOUND)
    -- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/Users/jtrmal/Documents/openfst/build64

但是,我运行却是这样的

-- Configuring done
CMake Error at src/test/CMakeLists.txt:1 (add_executable):
  Cannot find source file:

    fst_test.h

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx

CMake Error at src/test/CMakeLists.txt:9 (add_executable):
  Cannot find source file:

    weight-tester.h

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx

CMake Error at src/test/CMakeLists.txt:33 (add_executable):
  Cannot find source file:

    algo_test.h

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx

CMake Error at src/test/CMakeLists.txt:1 (add_executable):
  No SOURCES given to target: fst_test

CMake Error at src/test/CMakeLists.txt:9 (add_executable):
  No SOURCES given to target: weight_test

CMake Error at src/test/CMakeLists.txt:33 (add_executable):
  No SOURCES given to target: algo_test_minmax

CMake Error at src/test/CMakeLists.txt:17 (add_executable):
  No SOURCES given to target: algo_test_log

CMake Error at src/test/CMakeLists.txt:25 (add_executable):
  No SOURCES given to target: algo_test_tropical

CMake Error at src/test/CMakeLists.txt:41 (add_executable):
  No SOURCES given to target: algo_test_lexicographic

CMake Error at src/test/CMakeLists.txt:49 (add_executable):
  No SOURCES given to target: algo_test_power

-- Build files have been written to: D:/mc/kaldi-1/openfst/build64

//发现几个.h文件找不到

打开CMakeLists.txt所在test文件,发现里面只有.cc文件没有CMakeList.txt中需要的几个.h

去src/include/fst/test文件夹下,找到这几个库,复制过来,再次编译

-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.18362.
-- The following ICU libraries were not found:
--   data (required)
--   i18n (required)
--   io (required)
--   test (required)
--   tu (required)
--   uc (required)
-- Failed to find all ICU components (missing: ICU_INCLUDE_DIR ICU_LIBRARY _ICU_REQUIRED_LIBS_FOUND)
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- D:/mc/kaldi-1/openfst/src/script/../include/fst/script/arc-class.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/arciterator-class.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/arcsort.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/arg-packs.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/closure.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/compile-impl.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/compile.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/compose.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/concat.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/connect.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/convert.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/decode.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/determinize.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/difference.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/disambiguate.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/draw-impl.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/draw.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/encode.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/encodemapper-class.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/epsnormalize.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/equal.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/equivalent.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/fst-class.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/fstscript-decl.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/fstscript.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/getters.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/info-impl.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/info.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/intersect.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/invert.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/isomorphic.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/map.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/minimize.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/print-impl.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/print.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/project.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/prune.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/push.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/randequivalent.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/randgen.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/register.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/relabel.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/replace.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/reverse.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/reweight.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/rmepsilon.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/script-impl.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/shortest-distance.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/shortest-path.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/stateiterator-class.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/synchronize.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/text-io.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/topsort.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/union.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/verify.h;D:/mc/kaldi-1/openfst/src/script/../include/fst/script/weight-class.h
-- D:/mc/kaldi-1/openfst/src/extensions/far/../../include/fst/extensions/far/compile-strings.h;D:/mc/kaldi-1/openfst/src/extensions/far/../../include/fst/extensions/far/create.h;D:/mc/kaldi-1/openfst/src/extensions/far/../../include/fst/extensions/far/equal.h;D:/mc/kaldi-1/openfst/src/extensions/far/../../include/fst/extensions/far/extract.h;D:/mc/kaldi-1/openfst/src/extensions/far/../../include/fst/extensions/far/far-class.h;D:/mc/kaldi-1/openfst/src/extensions/far/../../include/fst/extensions/far/far.h;D:/mc/kaldi-1/openfst/src/extensions/far/../../include/fst/extensions/far/farlib.h;D:/mc/kaldi-1/openfst/src/extensions/far/../../include/fst/extensions/far/farscript.h;D:/mc/kaldi-1/openfst/src/extensions/far/../../include/fst/extensions/far/getters.h;D:/mc/kaldi-1/openfst/src/extensions/far/../../include/fst/extensions/far/info.h;D:/mc/kaldi-1/openfst/src/extensions/far/../../include/fst/extensions/far/isomorphic.h;D:/mc/kaldi-1/openfst/src/extensions/far/../../include/fst/extensions/far/print-strings.h;D:/mc/kaldi-1/openfst/src/extensions/far/../../include/fst/extensions/far/script-impl.h;D:/mc/kaldi-1/openfst/src/extensions/far/../../include/fst/extensions/far/stlist.h;D:/mc/kaldi-1/openfst/src/extensions/far/../../include/fst/extensions/far/sttable.h
-- D:/mc/kaldi-1/openfst/src/extensions/linear/../../include/fst/extensions/linear/linear-fst-data-builder.h;D:/mc/kaldi-1/openfst/src/extensions/linear/../../include/fst/extensions/linear/linear-fst-data.h;D:/mc/kaldi-1/openfst/src/extensions/linear/../../include/fst/extensions/linear/linear-fst.h;D:/mc/kaldi-1/openfst/src/extensions/linear/../../include/fst/extensions/linear/linearscript.h;D:/mc/kaldi-1/openfst/src/extensions/linear/../../include/fst/extensions/linear/loglinear-apply.h;D:/mc/kaldi-1/openfst/src/extensions/linear/../../include/fst/extensions/linear/trie.h
-- D:/mc/kaldi-1/openfst/src/extensions/mpdt/../../include/fst/extensions/mpdt/compose.h;D:/mc/kaldi-1/openfst/src/extensions/mpdt/../../include/fst/extensions/mpdt/expand.h;D:/mc/kaldi-1/openfst/src/extensions/mpdt/../../include/fst/extensions/mpdt/info.h;D:/mc/kaldi-1/openfst/src/extensions/mpdt/../../include/fst/extensions/mpdt/mpdt.h;D:/mc/kaldi-1/openfst/src/extensions/mpdt/../../include/fst/extensions/mpdt/mpdtlib.h;D:/mc/kaldi-1/openfst/src/extensions/mpdt/../../include/fst/extensions/mpdt/mpdtscript.h;D:/mc/kaldi-1/openfst/src/extensions/mpdt/../../include/fst/extensions/mpdt/read_write_utils.h;D:/mc/kaldi-1/openfst/src/extensions/mpdt/../../include/fst/extensions/mpdt/reverse.h
-- D:/mc/kaldi-1/openfst/src/extensions/ngram/../../include/fst/extensions/ngram/bitmap-index.h;D:/mc/kaldi-1/openfst/src/extensions/ngram/../../include/fst/extensions/ngram/ngram-fst.h;D:/mc/kaldi-1/openfst/src/extensions/ngram/../../include/fst/extensions/ngram/nthbit.h
-- D:/mc/kaldi-1/openfst/src/extensions/pdt/../../include/fst/extensions/pdt/collection.h;D:/mc/kaldi-1/openfst/src/extensions/pdt/../../include/fst/extensions/pdt/compose.h;D:/mc/kaldi-1/openfst/src/extensions/pdt/../../include/fst/extensions/pdt/expand.h;D:/mc/kaldi-1/openfst/src/extensions/pdt/../../include/fst/extensions/pdt/getters.h;D:/mc/kaldi-1/openfst/src/extensions/pdt/../../include/fst/extensions/pdt/info.h;D:/mc/kaldi-1/openfst/src/extensions/pdt/../../include/fst/extensions/pdt/paren.h;D:/mc/kaldi-1/openfst/src/extensions/pdt/../../include/fst/extensions/pdt/pdt.h;D:/mc/kaldi-1/openfst/src/extensions/pdt/../../include/fst/extensions/pdt/pdtlib.h;D:/mc/kaldi-1/openfst/src/extensions/pdt/../../include/fst/extensions/pdt/pdtscript.h;D:/mc/kaldi-1/openfst/src/extensions/pdt/../../include/fst/extensions/pdt/replace.h;D:/mc/kaldi-1/openfst/src/extensions/pdt/../../include/fst/extensions/pdt/reverse.h;D:/mc/kaldi-1/openfst/src/extensions/pdt/../../include/fst/extensions/pdt/shortest-path.h
-- D:/mc/kaldi-1/openfst/src/extensions/special/../../include/fst/extensions/special/phi-fst.h;D:/mc/kaldi-1/openfst/src/extensions/special/../../include/fst/extensions/special/rho-fst.h;D:/mc/kaldi-1/openfst/src/extensions/special/../../include/fst/extensions/special/sigma-fst.h
-- Configuring done
-- Generating done
-- Build files have been written to: D:/mc/kaldi-1/openfst/build64

Done,应该没问题了,编译后的文件被写在build64文件夹下。

接下来照着他说的编译

In the directory build64, find the file openfst.sln and open it using Visual Studio 17.

Switch the configuration to Debug|x64 and build the solution. Do the same for configuration Release|x64.

If either of the two won‘t build, you should stop here and start figuring what‘s different!

用vs2017打开,配置成Debug|x64,然后build解决方案。

这里成功生成。项目没有主函数,只是一些库,所以不能运行。

关于Debug|x64 Release|x64的区别,见https://www.cnblogs.com/netserver/p/11106130.html

原文地址:https://www.cnblogs.com/yuecmz/p/12217528.html

时间: 2024-08-11 05:30:22

Windows下编译kaldi遇到的一些问题--openfst(一)的相关文章

【大话QT之十五】ctkPluginFrameWork插件系统Windows下编译

使用ctkPluginFramework作为插件系统框架的确有着众多开发上的优势.最近收到一些站内信,大家都想使用ctkPluginFramework但是不知道如何编译,这篇教程就来讲一讲ctkPluginFramework插件系统在Windows下的编译过程. 准备条件: 1. 安装Git,我们通过它来下载CTK的源码. 2. 安装CMake,我们用它来生成vs下的sln解决方案文件. 相关站点: 1. CTK的官网:http://www.commontk.org/index.php/Main

WIndows下编译libexif-0.6.21,生成VS下可用的dll和lib

1.下载libexif-0.6.21.zip 下载地址是http://sourceforge.net/projects/libexif/files/libexif/0.6.21/ 2.解压libexif-0.6.21.zip 我解压到了d:\opensources\下 3.安装Mingw 下载地址是http://www.mingw.org/ 点击右上角的Download Installer 记得安装Msys 我的安装路径是:C:\MinGW 下面依次有如下文件夹: bin include lib

在Windows下编译OpenSSL(VS2005和VC6)

需要说明的是请一定安装openssl-0.9.8a .  openssl-1.0.0我没有编译成功. 如何在Windows下编译OpenSSL (Vs2005使用Vc8的cl编译器)1.安装ActivePerl//初始化的时候,需要用到perl解释器2.使用VS2005下的Visual Studio 2005 Command Prompt进入控制台模式(这个模式会自动设置各种环境变量)3.解压缩openssl的包,进入openssl的目录4.perl configure VC-WIN32尽量在这

在Windows下编译WebRTC

前言这篇文章的目的在于为你节省生命中宝贵的10小时(甚至更多),或者浪费你10分钟.作为Google更新频繁的大型跨平台基础库,WebRTC的编译一直被人称为噩梦.如果恰巧你偏要在Windows下编译WebRTC,那么你最好提前对自己的耐心和智商做充分的评估.截止目前,我尝试过中文博客社区里几乎所有的文章,可以说全部失效了.我不知道这篇文章的有效期有多久,因为webrtc.org社区的家伙们更新实在太勤奋了!环境 OS:Microsoft Windows 7 Ultimate 6.1.7601

windows下编译配置libnet-1.2-rc3

官网:http://packetfactory.openwall.net/projects/libnet/ 下载(有zip和tar.gz两个版本):https://github.com/sam-github/libnet/releases 解压之后: 编译步骤: 将libnet-libnet-1.2-rc3复制到D盘 双击libnet目录下的msvcbuild.bat文件,之后就会在src目录下生成libnet.dll和libnet.lib ---------------------------

在Windows下编译FFmpeg详细说明

MinGW:一个可自由使用和自由发布的Windows特定头文件和使用GNC工具集导入库的集合,允许你生成本地的Windows程序而不需要第三方C运行时 MinGW,即 Minimalist GNU For Windows.它是一些头文件和端口库的集合,该集合允许人们在没有第三方动态链接库的情况下使用 GCC产生 Windows32 程序. 开发 MinGW 是为了那些不喜欢工作在 Linux(FreeBSD) 操作系统而留在 Windows 的人提供一套符合 GNU 的 GNU 工作环境. 所以

windows下编译qt的mysql驱动

windows下编译qt的mysql驱动cd %QTDIR%\src\plugins\sqldrivers\mysqlqmake –o Makefile INCLUDEPATH+="C:\MySQL\MySQL5.1\include" LIBS+="C:\MySQL\MySQL5.1\lib\opt\libmysql.lib" mysql.promingw32-make在C :\Qt\2010.05\qt\plugins\sqldrivers就有mysql驱动了my

Windows下编译MySQL 5.7源代码

Windows下编译MySQL 5.7源代码   前提准备 ====== Visual Studio 2013: MySQL 5.7源代码:可以从这里下载: http://dev.mysql.com/downloads/mysql/ 下载的时候,选择Source Code 安装CMake https://cmake.org/ 安装的时候,选择在PATH中加入 安装Bison: http://gnuwin32.sourceforge.net/packages/bison.htm 安装路径不要有空格

Crosswalk Cordova windows下编译出现:bin\node_modules\q\q.js:126 throw e问题解决方法

Crosswalk Cordova windows下编译出现:bin\node_modules\q\q.js:126   throw e问题解决方法 Crosswalk Cordova 编译出现以下问题 D:\code\crosswalk\crosswalk-cordova-10.39.235.15-arm\bin\node_modules\q\q.js:126 throw e; ^ Package name must look like: com.company.Name 原因是:create