Building wav2letter++ 安装依赖(GPU version)

Build Requirements

sudo apt install cmake

cmake version 3.5.1 or late

sudo apt-get update

sudo apt-get install \

    # Audio encoding libs for libsndfile \

    libasound2-dev \

    libflac-dev \

    libogg-dev \

    libtool \

    libvorbis-dev \

    # FFTW for Fourier transforms \

    libfftw3-dev \

    # Compression libraries for KenLM \

    zlib1g-dev \

    libbz2-dev \

    liblzma-dev \

    libboost-all-dev \

    # gflags \

    libgflags-dev \

    libgflags2v5 \

    # glog \

    libgoogle-glog-dev \

    libgoogle-glog0v5 \

NVIDIA driver: suao apt install nvidia-410   #by your nvidia display card

download CUDA10.0,then install it

download cuDNN & NCLL ,then install

安装MKL

到官网下载Intel® Math Kernel Library for Linux安装包

采用tar -xvzf l_mkl_xxx.tgz命令解压安装包,进入解压后的安装包,运行./install.sh脚本执行安装过程

根据提示一路接受,默认安装路径是/opt/intel

在目录/opt/intel/mkl/bin下执行./mklvars.sh intel64

编辑vi ~/.bashrc设置环境变量

在末尾加入代码:

export PATH=/opt/intel/bin:$PATH

export LD_LIBRARY_PATH= /opt/intel/lib/intel64:/opt/intel/mkl/lib/intel64:$LD_LIBRARY_PATH

$ source ~/.bashrc

如果没有报错,则path生效


安装kenlm

wget https://kheafield.com/code/kenlm.tar.gz

tar -xvzf kenlm.tar.gz

cd kenlm

mkdir build && cd build

cmake ..

make -j 4

这样还无法在python环境中执行

cd kenlm

python setup.py install

python #进入python环境

import kenlm

kenlm root DIR is kenlm

安装libsndfile:

git clone git://github.com/erikd/libsndfile.git

sudo apt install autoconf autogen automake build-essential libasound2-dev \

libflac-dev libogg-dev libtool libvorbis-dev pkg-config python


cd libsndfile

./autogen.sh

./configure --enable-werror

make

make check

为了产生wav2letter++需要的.cmake配置文件

mkdir CMakeBuild

cd CMakeBuild

cmake ..

make

sudo make install

安装ArrayFire

直接下载:ArrayFire-v3.6.1_Linux_x86_64.sh

bash ArrayFire-v3.6.1_Linux_x86_64.sh

之后wav2letter++在cmake时加入选项:

-DArrayFire_DIR=/xxx/arrayfire/share/ArrayFire/cmake


安装flashlight

注意安装flashlight之前需要安装好arrayfire和nccl [flashlight还需要CUDA>=9.2,CUDNN>=7.2.1

sudo apt-get install openmpi-bin openmpi-common libopenmpi-dev


git clone https://github.com/facebookresearch/flashlight.git

mkdir -p build #in the flashlight project directory:

cd build

cmake .. -DCMAKE_BUILD_TYPE=Release -DFLASHLIGHT_BACKEND=CUDA

报错找不到ArrayFire,加上-D ArrayFire_DIR=/data/zd/arrayfire/share/ArrayFire/cmake选项;

make -j 4 #(or any number of threads)

make test


sudo make install


安装wav2letter++

需要在~/.bashrc中加上环境变量

export KENLM_ROOT_DIR=[your kenlm directory]

export MKLROOT=/opt/intel/mkl


git clone --recursive https://github.com/facebookresearch/wav2letter.git

mkdir -p build

cd build

cmake .. -DCMAKE_BUILD_TYPE=Release -DArrayFire_DIR=/home/xxx/arrayfire/share/ArrayFire/cmake

make -j4

你可能感兴趣的:(Building wav2letter++ 安装依赖(GPU version))