在Ubuntu 16.04上为HTK 3.4.1安装HTS 2.3有错误

时间:2016-06-09 07:49:58

标签: linux ubuntu

我想安装HTS 2.3,但是当我尝试制作所有错误时

> (cd HTKLib && make HTKLib.a) \   || case "" in *k*) fail=yes;; *) exit
> 1;; esac; make[1]: Entering directory '/home/ahad/Desktop/htk/HTKLib'
> gcc  -Wall -Wno-switch -g -O2 -I. -DPHNALG   -c -o esignal.o esignal.c
> In file included from /usr/include/string.h:630:0,
>                  from esignal.h:34,
>                  from esignal.c:29: esignal.c: In function ‘ReadHeader’: esignal.c:974:29: error: ‘ARCH’ undeclared (first use in
> this function)
>     if (strcmp(architecture, ARCH) == 0)    /* native architecture */
>                              ^ esignal.c:974:29: note: each undeclared identifier is reported only once for each function it appears in
> esignal.c: In function ‘WriteHeader’: esignal.c:1184:25: error: ‘ARCH’
> undeclared (first use in this function)
>           architecture = ARCH;
>                          ^ esignal.c: In function ‘GetLine’: esignal.c:1760:4: warning: ignoring return value of ‘fgets’, declared
> with attribute warn_unused_result [-Wunused-result]
>     fgets(buf, len+1, file);
>     ^ esignal.c: In function ‘GetLong’: esignal.c:1808:4: warning: ignoring return value of ‘fgets’, declared with attribute
> warn_unused_result [-Wunused-result]
>     fgets(buf, len+1, file);
>     ^ <builtin>: recipe for target 'esignal.o' failed make[1]: *** [esignal.o] Error 1 make[1]: Leaving directory
> '/home/ahad/Desktop/htk/HTKLib' Makefile:141: recipe for target
> 'HTKLib/HTKLib.a' failed make: *** [HTKLib/HTKLib.a] Error 1

问题是什么?

我已经安装了libx11-dev。

2 个答案:

答案 0 :(得分:2)

解决这两个错误我在./configure中指定ARCH,如下所示:

./configure CFLAGS="-DARCH=linux" 

它为我工作。

我像Knud Larsen指示一样一步一步地执行此操作:

   % tar -zxvf HTK-3.4.1.tar.gz
   % tar -zxvf HDecode-3.4.1.tar.gz

   % cd htk
   % patch -p1 -d . < HTS-2.3_for_HTK-3.4.1.patch
   % sudo apt-get install g++-4.7
   % export CC=gcc-4.7 CXX=g++-4.7 
   % ./configure CFLAGS="-DARCH=linux" 
   % make all
   % make hlmtools install-hlmtools
   % make hdecode install-hdecode
   % sudo make install

答案 1 :(得分:1)

Ubuntu 16.04和2014年代码HTK-3.4.1等:

HTS2.3补丁HTK-3.4.1(HTKLib /)无法使用默认的gcc = gcc-5进行编译。

解决方案:sudo apt-get install g++-4.7

cd htk/
export CC=gcc-4.7 CXX=g++-4.7 
./configure
make all