/
Dockerfile-CPU
56 lines (48 loc) · 2.51 KB
/
Dockerfile-CPU
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# ==================================================================
# module list
# ------------------------------------------------------------------
# flashlight master (git, CPU backend)
# ==================================================================
FROM wav2letter/wav2letter:cpu-base-latest
RUN mkdir /root/wav2letter
COPY . /root/wav2letter
ARRAY FIRE
sudo apt-get install -y build-essential git cmake libfreeimage-dev
sudo apt-get install -y cmake-curses-gui
wget https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.gz
tar xf boost_1_70_0.tar.gz
cp -r boost_1_70_0/boost /usr/local/include
sudo apt-get install libopenblas-dev libfftw3-dev liblapacke-dev
sudo apt-get install libatlas3gf-base libatlas-dev libfftw3-dev liblapacke-dev
git clone --recursive https://github.com/arrayfire/arrayfire.git
cd arrayfire
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
sudo make -j8
# ==================================================================
# flashlight https://github.com/facebookresearch/flashlight.git
# ------------------------------------------------------------------
export MKLROOT=/opt/intel/mkl && \
cd /root && git clone --recursive https://github.com/facebookresearch/flashlight.git && \
cd flashlight && mkdir -p build && cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release -DFLASHLIGHT_BACKEND=CPU && \
make -j8 && make install && \
# ==================================================================
# ==================================================================
# kenlm rebuild with max order 20 and install python wrapper
# ------------------------------------------------------------------
# RUN apt-get install libsndfile-dev libopenblas-dev libfftw3-dev libgflags-dev libgoogle-glog-dev && \
# RUN apt-get install liblzma-dev libbz2-dev libzstd-dev && \
RUN cd /root && git clone https://github.com/kpu/kenlm.git && \
cd kenlm && mkdir -p build && cd build && \
cmake .. -DKENLM_MAX_ORDER=20 && make -j8 && make install && \
cd /root/kenlm && \
sed -i 's/DKENLM_MAX_ORDER=6/DKENLM_MAX_ORDER=20/g' setup.py && \
pip install . && \
# ==================================================================
# wav2letter with CPU backend
# ------------------------------------------------------------------
export MKLROOT=/opt/intel/mkl && export KENLM_ROOT_DIR=/root/kenlm && \
cd /root/wav2letter && mkdir -p build && \
cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DW2L_LIBRARIES_USE_CUDA=OFF && -DKENLM_MAX_ORDER=20 && \
make -j8