由于我第一次安装 JUICER时遇到了很多问题,现在把这些问题都记录下来,给同样第一次安装使用的同学一点借鉴。
前面已经安装了Torch3和Tracter,这都是为安装Juicer做的准备,现在安装Juicer也容易了。
1,下载源码
wget http://juicer.amiproject.org/juicer/sources/juicer-1.0.tar.gz
2,编译准备
首次编译结果
-- checking for module 'tracter'
-- found tracter, version 1.0
-- checking for module 'torch'
-- package 'torch' not found
-- HTK not found
-- libresample not found
-- RtAudio not found
-- Found SPTK: /usr/lib/libSPTK.a
-- Configuring done
-- Generating done
-- Build files have been written to: /juicer/dep/juicer-1.0/build
修改FindTorch3.cmake文件,操作如下:
set(TORCH3_DIR "/juicer/dep/Torch3")
修改FindHTK.cmake文件,操作如下:
set(HTK_DIR "/juicer/dep/htk/")
修改FindLibResample.cmake文件,操作如下:
set(LIBRESAMPLE_DIR "/usr")
....
set(LIBRESAMPLE_LIBRARIES
${LIBRESAMPLE_DIR}/lib64/libresample.so
)
修改FindRtAudio.cmake文件,操作如下:
set(RTAUDIO_DIR "/juicer/dep/rtaudio-4.0.11/")
如果不这么修改的话,就设置环境变量,效果是一样的。
3,编译
cmake -D CMAKE_INSTALL_PREFIX=/usr/local/juicer/ ../
结果如下:
[root@localhost build]# cmake -D CMAKE_INSTALL_PREFIX=/usr/local/juicer/ ../
-- checking for module 'torch'
-- package 'torch' not found
-- Using HTK dir: /juicer/dep/htk/
-- Using libresample dir: /usr
-- Using RtAudio dir: /juicer/dep/rtaudio-4.0.11/
-- Configuring done
-- Generating done
-- Build files have been written to: /juicer/dep/juicer-1.0/build
[root@localhost build]#
torch没有关系,这是因为没有使用torch.pc的原因,我们指定了静态库文件。就是libtorch.a
继续。。。
[root@localhost build]# make
[ 2%] Generating htkparse.y.h, htkparse.y.cpp
/bin/sh: bison: command not found
make[2]: *** [src/htkparse.y.h] Error 127
make[1]: *** [src/CMakeFiles/static-lib.dir/all] Error 2
make: *** [all] Error 2
[root@localhost build]#
这个小问题,yum install bison
继续。。。
[root@localhost build]# make
[ 2%] Generating htkparse.y.h, htkparse.y.cpp
[ 5%] Generating htkparse.l.cpp
/bin/sh: flex: command not found
make[2]: *** [src/htkparse.l.cpp] Error 127
make[1]: *** [src/CMakeFiles/static-lib.dir/all] Error 2
make: *** [all] Error 2
这也是小问题,yum install flex
然后就很顺利了,几个主要的命令行都生成了,如下:
[root@localhost juicer]# cd bin/
[root@localhost bin]# ls
aux2eps.pl cdgen gramgen map-labels.pl
build-wfst do-star-closure.pl juicer untieModels.sh
build-wfst-mit fstRemoveAux.pl lexgen
build-wfst-openfst genwfstseqs logical2physical.pl