Skip to content

Instantly share code, notes, and snippets.

@bm3n
Created September 23, 2020 21:17
Show Gist options
  • Save bm3n/0a9d318e0294660d7614ba1c6566cf23 to your computer and use it in GitHub Desktop.
Save bm3n/0a9d318e0294660d7614ba1c6566cf23 to your computer and use it in GitHub Desktop.

Instructions for Building Gentle on Windows 10 via Windows Subsystem for Linux (WSL)

These instructions were writting for for lowerquality/gentle commit ce6873d8d Jan 7, 2019

Prepare Windows

From https://docs.microsoft.com/en-us/windows/wsl/install-win10

  • Install Windows Subsystem for Linux
  • Install Ubuntu 18.04 LTS from Windows Store

Prepare Ubuntu

  • Start Ubuntu, initial setup will begin.
  • Set userid and password as desired.

Get Gentle

git clone https://github.com/lowerquality/gentle.git
cd ./gentle

Install Gentle

From ~/gentle/install.sh

git submodule init
git submodule update
sudo bash ./install_deps.sh
sudo bash ./install_models.sh

NOTE:

This is where break I from gentle's build process.
Gentle's build script attempts to run install_kaldi.sh which appears
to replicate kaldis' build scripts but it always fails. Instead I 
follow kaldi's instructions, with some modifiations detailed below.

Install/Build Kaldi

From ~/gentle/ext/kaldi/INSTALL

Kaldi tells us to:

  1. go to tools/ and follow INSTALL instructions there.
  2. go to src/ and follow INSTALL instructions there.

So based on that, here's what we're going to do...

Build kaldi/tools

From ~/gentle/ext/kaldi/tools/INSTALL

cd ext/kaldi/tools
sudo bash extras/check_dependencies.sh
  • This tool outputs some instructions, follow them.
  • For example, I had to $sudo apt-get install python2.7
  • Run it again and follow instructions until it says: extras/check_dependencies.sh: all OK.
$make
  • wait a long time...
  • Ends with the following, this is OK:
  Warning: IRSTLM is not installed by default anymore. If you need IRSTLM
  Warning: use the script extras/install_irstlm.sh
  All done OK.

Build kaldi/src

From ~/gentle/ext/kaldi/src/INSTALL
With ~/gentle/ext/install_kaldi.sh

cd ~/gentle/ext/kaldi/src
./configure --static --static-math=yes --static-fst=yes --use-cuda=no
  • This command will result in an error like:
** Failed to configure ATLAS libraries ***
** ERROR **
** Configure cannot proceed automatically.
** If you know that you have ATLAS installed somewhere on your machine, you
** may be able to proceed by replacing [somewhere] in kaldi.mk with a directory.

To fix this...

cp kaldi.mk /mnt/c/Users/bm3n/Desktop/
  • replace bm3n with YOUR username
  • Edit kaldi.mk from your desktop using notepad
  • Replace ATLASLIBS ... with:
ATLASLIBS = /usr/lib/x86_64-linux-gnu/libatlas.so.3 /usr/lib/x86_64-linux-gnu/libf77blas.so.3 /usr/lib/x86_64-linux-gnu/libcblas.so.3 /usr/lib/x86_64-linux-gnu/liblapack_atlas.so.3 -Wl,-rpath=/usr/lib/x86_64-linux-gnu

Resume with build...

cp /mnt/c/Users/bm3n/Desktop/kaldi.mk kaldi.mk
make depend -j 8
make -j 8

Build Gentle (finally)

From ~/gentle/install.sh

cd ~/gentle/ext
make depend
make
  • There will be a lot of output with warnings, it's probably ok.
  • When done there should be a k3 and m3 file in ext directory.

Setup Python Application

From ~/gentle/install_deps.sh

cd ~/gentle
sudo python3 setup.py develop
  • There seems to be a logical error in that gentle's setup script runs this command long before kaldi or the rest of the exectubles are built and therefore it doesn't seem to work.

Test Gentle

To run the web server

cd ~/gentle
python3 serve.py

To run the command line aligner

cd ~/gentle
python3 ~/gentle/align.py ~/gentle/examples/data/lucier.mp3 ~/gentle/examples/data/lucier.txt
Copy link

ghost commented Nov 9, 2020

I am trying to install gentle.
I did till

sudo bash extras/check_dependencies.sh

but when i use the make command i get this error

Makefile:87: recipe for target 'openfst-1.6.5.tar.gz' failed
make: *** [openfst-1.6.5.tar.gz] Error 4

can i know what is happening here?

these were the pre-error info

--2020-11-09 13:53:00--  (try: 2)  http://www.openslr.org/resources/2/openfst-1.6.5.tar.gz
Connecting to www.openslr.org (www.openslr.org)|46.101.158.64|:80... connected.
HTTP request sent, awaiting response... Read error (Connection timed out) in headers.
Retrying.

--2020-11-09 13:53:14--  (try: 3)  http://www.openslr.org/resources/2/openfst-1.6.5.tar.gz
Connecting to www.openslr.org (www.openslr.org)|46.101.158.64|:80... connected.
HTTP request sent, awaiting response... Read error (Connection timed out) in headers.
Giving up.

@bm3n
Copy link
Author

bm3n commented Nov 10, 2020

The pre-error information suggests this was a network issue, either temporary or perhaps due to a firewall or proxy issue. Try downloading it directly and if it works, give the make command another try.

curl http://www.openslr.org/resources/2/openfst-1.6.5.tar.gz -o openfst-1.6.5.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment