Compiling HTK 3.4 on Mac OS 10.5

来源:互联网 发布:windows文件恢复大师 编辑:程序博客网 时间:2024/06/05 18:49

Compiling HTK 3.4 on Mac OS 10.5


HTK 3.4 does not compile out of the box on my MacBook (OS 10.5.7, 64-bit Intel Core 2 Duo).  There are two problems, one in the configure file, and one in the file HTKLib/strarr.c.

1) After unpacking the source code and running:

$ ./configure
$ make all

I get the following error during compilation:

gcc  -Wall -Wno-switch -g -O2 -I.    -c -o esignal.o esignal.c
esignal.c: In function ‘ReadHeader’:
esignal.c:974: error: ‘ARCH’ undeclared (first use in this function)
esignal.c:974: error: (Each undeclared identifier is reported only once
esignal.c:974: error: for each function it appears in.)
esignal.c: In function ‘WriteHeader’:
esignal.c:1184: error: ‘ARCH’ undeclared (first use in this function)
make[1]: *** [esignal.o] Error 1
make: *** [HTKLib/HTKLib.a] Error 1

After looking into the configure file, I see that the variable ARCH should be defined for my system on line 4983. However, this code isn’t executed, because the host variable isn’t being set. My solution was to add the following code:

i386)
host=darwin
trad_bin_dir=$host
;;

to the case “$host_cpu” in statement on line 4937.

2) After making this change and re-running:

$ ./configure
$ make all

I get the following error:

gcc -ansi -g -O2 -DNO_AUDIO -D’ARCH=”darwin”‘ -Wall -Wno-switch -g -O2 -I. -c -o strarr.o strarr.c
strarr.c:21:20: error: malloc.h: No such file or directory
make[1]: *** [strarr.o] Error 1
make: *** [HTKLib/HTKLib.a] Error 1

To fix this bug, I changed line 21 of HTKLib/strarr.c to:

#include <malloc/malloc.h>

After making this change, compilation completed successfully, and HTK was ready to be installed and used on my system.


0 0