安装juicer

由于我第一次安装 JUICER时遇到了很多问题,现在把这些问题都记录下来,给同样第一次安装使用的同学一点借鉴。

前面已经安装了Torch3Tracter,这都是为安装Juicer做的准备,现在安装Juicer也容易了。

1,下载源码

wget  http://juicer.amiproject.org/juicer/sources/juicer-1.0.tar.gz

2,编译准备

首次编译结果

  1. -- checking for module 'tracter'  
  2. --   found tracter, version 1.0  
  3. -- checking for module 'torch'  
  4. --   package 'torch' not found  
  5. -- HTK not found  
  6. -- libresample not found  
  7. -- RtAudio not found  
  8. -- Found SPTK: /usr/lib/libSPTK.a  
  9. -- Configuring done  
  10. -- Generating done  
  11. -- Build files have been written to: /juicer/dep/juicer-1.0/build  

修改FindTorch3.cmake文件,操作如下:

  1. set(TORCH3_DIR "/juicer/dep/Torch3")  

修改FindHTK.cmake文件,操作如下:

  1. set(HTK_DIR "/juicer/dep/htk/")  

修改FindLibResample.cmake文件,操作如下:

  1. set(LIBRESAMPLE_DIR "/usr")  
  2. ....  
  3. set(LIBRESAMPLE_LIBRARIES  
  4.     ${LIBRESAMPLE_DIR}/lib64/libresample.so  
  5.     )  

修改FindRtAudio.cmake文件,操作如下:

  1. set(RTAUDIO_DIR "/juicer/dep/rtaudio-4.0.11/")  

如果不这么修改的话,就设置环境变量,效果是一样的。

3,编译

  1. cmake -D CMAKE_INSTALL_PREFIX=/usr/local/juicer/ ../  

结果如下:

  1. [root@localhost build]# cmake -D CMAKE_INSTALL_PREFIX=/usr/local/juicer/ ../  
  2. -- checking for module 'torch'  
  3. --   package 'torch' not found  
  4. -- Using HTK dir: /juicer/dep/htk/  
  5. -- Using libresample dir: /usr  
  6. -- Using RtAudio dir: /juicer/dep/rtaudio-4.0.11/  
  7. -- Configuring done  
  8. -- Generating done  
  9. -- Build files have been written to: /juicer/dep/juicer-1.0/build  
  10. [root@localhost build]#   

torch没有关系,这是因为没有使用torch.pc的原因,我们指定了静态库文件。就是libtorch.a

继续。。。

  1. [root@localhost build]# make  
  2. [  2%] Generating htkparse.y.h, htkparse.y.cpp  
  3. /bin/sh: bison: command not found  
  4. make[2]: *** [src/htkparse.y.h] Error 127  
  5. make[1]: *** [src/CMakeFiles/static-lib.dir/all] Error 2  
  6. make: *** [all] Error 2  
  7. [root@localhost build]#  

这个小问题,yum install bison

继续。。。

  1. [root@localhost build]# make  
  2. [  2%] Generating htkparse.y.h, htkparse.y.cpp  
  3. [  5%] Generating htkparse.l.cpp  
  4. /bin/sh: flex: command not found  
  5. make[2]: *** [src/htkparse.l.cpp] Error 127  
  6. make[1]: *** [src/CMakeFiles/static-lib.dir/all] Error 2  
  7. make: *** [all] Error 2  

这也是小问题,yum install flex

然后就很顺利了,几个主要的命令行都生成了,如下:

    1. [root@localhost juicer]# cd bin/  
    2. [root@localhost bin]# ls  
    3. aux2eps.pl          cdgen               gramgen              map-labels.pl  
    4. build-wfst          do-star-closure.pl  juicer               untieModels.sh  
    5. build-wfst-mit      fstRemoveAux.pl     lexgen  
    6. build-wfst-openfst  genwfstseqs         logical2physical.pl  
原文地址:https://www.cnblogs.com/tibetanmastiff/p/3962428.html