From c32b235795ab0dd2867c6a8342ca23d420cdc44c Mon Sep 17 00:00:00 2001 From: Tim Hutt Date: Mon, 11 Jan 2016 10:49:01 +0000 Subject: [PATCH 1/3] Tabs to spaces There were some stray tabs in the Windows INSTALL file. --- windows/INSTALL | 78 ++++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/windows/INSTALL b/windows/INSTALL index d743129498b..58955ca60a5 100644 --- a/windows/INSTALL +++ b/windows/INSTALL @@ -37,7 +37,7 @@ be taken in the tools dir Example: $ cd (kaldi)/tools - (kaldi)/tools$ pwd + (kaldi)/tools$ pwd 2a) Use git to clone the OpenFST(win) from @@ -49,38 +49,38 @@ 2b) Download pthread-win32 (or wget or curl) https://sourceforge.net/projects/pthreads4w/ (kaldi)/tools$ wget http://downloads.sourceforge.net/project/pthreads4w/pthreads-w32-2-9-1-release.zip - (kaldi)/tools$ mkdir pthreads; cd pthreads - (kaldi)/tools/pthreads$ unzip ../pthreads-w32-2-9-1-release.zip + (kaldi)/tools$ mkdir pthreads; cd pthreads + (kaldi)/tools/pthreads$ unzip ../pthreads-w32-2-9-1-release.zip 2c) Use patch (or you can use git patch) to patch the OpenFST(win) patch location tools/extras/openfstwin-1.3.4.patch, Example: (kaldi)/tools$ cd openfst - (kaldi)/tools/openfst$ patch -p1 <../extras/openfstwin-1.3.4.patch + (kaldi)/tools/openfst$ patch -p1 <../extras/openfstwin-1.3.4.patch 2d-1) Download the OpenBLAS binary packages https://sourceforge.net/projects/openblas - (kaldi)/tools$ wget http://sourceforge.net/projects/openblas/files/v0.2.14/OpenBLAS-v0.2.14-Win64-int32.zip - (kaldi)/tools$ wget http://sourceforge.net/projects/openblas/files/v0.2.14/mingw64_dll.zip - (kaldi)/tools$ unzip OpenBLAS-v0.2.14-Win64-int32.zip - (kaldi)/tools$ unzip mingw64_dll.zip - - NOTE: Be carefull to download "Win64-int32" and not "Win64-int64"! - + (kaldi)/tools$ wget http://sourceforge.net/projects/openblas/files/v0.2.14/OpenBLAS-v0.2.14-Win64-int32.zip + (kaldi)/tools$ wget http://sourceforge.net/projects/openblas/files/v0.2.14/mingw64_dll.zip + (kaldi)/tools$ unzip OpenBLAS-v0.2.14-Win64-int32.zip + (kaldi)/tools$ unzip mingw64_dll.zip + + NOTE: Be carefull to download "Win64-int32" and not "Win64-int64"! + 2d-2) Install MKL 2e) If you want enabled CUDA support, download and install NVidia CUDA SDK. Be careful and strive for as standard install as possible. The installer - set certain environment variables on which the MSVC Build rules rely. - If you call "set" in the command line, you should see: + set certain environment variables on which the MSVC Build rules rely. + If you call "set" in the command line, you should see: - (kaldi)/tools $ set | grep CUDA + (kaldi)/tools $ set | grep CUDA CUDA_PATH='C:\Users\Yenda\Downloads\cuda' CUDA_PATH_V7_0='C:\Users\Yenda\Downloads\cuda' NVCUDASAMPLES7_0_ROOT='C:\Users\Yenda\Downloads\cuda' NVCUDASAMPLES_ROOT='C:\Users\Yenda\Downloads\cuda' - + The first one (CUDA_PATH) is particulary important. - + 3) Open the OpenFST solution in VS -- for VS 2013, the correct solution is in VS2012 directory for VS 2014, the correct solution is in VS2014 directory @@ -90,40 +90,40 @@ 4) Enter the (kaldi)/windows directory Example: - (kaldi)/tools/openfst$ cd ../../windows - (kaldi)/windows $ pwd - + (kaldi)/tools/openfst$ cd ../../windows + (kaldi)/windows $ pwd + 4a) modify the file variables.props to reflect the correct paths, using your favorite text editor. - Don't worry, it's a text file, even though you have to be - careful to keep the structure itself intact - (kaldi)/windows $ vim variables.props - - If you plan to use MKL, you can ignore the OPENBLASDIR path - If you plan to use OpenBLAS, you can ignore the MKLDIR path - No matter what you plan to use, set both the OPENFST* and PTHREADW - variables correctly - + Don't worry, it's a text file, even though you have to be + careful to keep the structure itself intact + (kaldi)/windows $ vim variables.props + + If you plan to use MKL, you can ignore the OPENBLASDIR path + If you plan to use OpenBLAS, you can ignore the MKLDIR path + No matter what you plan to use, set both the OPENFST* and PTHREADW + variables correctly + 4b-1) For OpenBLAS support, copy the file "kaldiwin_openblas.props" to "kaldiwin.props" 4b-2) For MKL support, you don't have to do anything, it should work out of the box. When you need to switch from OpenBLAS to MKL, copy the "kaldiwin_mkl.props" - to "kaldiwin.props" + to "kaldiwin.props" 4c) call the script that generates the MSVC solution - i.e. - generate_solution.pl --vsver - i.e. for example - generate_solution.pl --vsver vs2013 - - For CUDA support, add switch --enable-cuda to the command line, - i.e. for example - generate_solution.pl --vsver vs2013 --enable-cuda - + i.e. + generate_solution.pl --vsver + i.e. for example + generate_solution.pl --vsver vs2013 + + For CUDA support, add switch --enable-cuda to the command line, + i.e. for example + generate_solution.pl --vsver vs2013 --enable-cuda + 5) Open the generated solution in the visual studio and switch to Debug|x64 (or Release|x64) and build Expect 10 projects to fail, majority of them will fail because of missing include "portaudio.h" ------- +------ NOTE: I'm leaving the information about ATLAS here, for reference (also do not forget to consult the README.ATLAS) (B) either (i) compile ATLAS under cygwin [see INSTALL.atlas] and copy From cc50db74aac49a7dbfaa98365bf3f670f62e6165 Mon Sep 17 00:00:00 2001 From: Tim Hutt Date: Mon, 11 Jan 2016 10:53:32 +0000 Subject: [PATCH 2/3] Add note about patch failing due to line endings Annoyingly, github's zip download doesn't seem to preserve line endings. See http://stackoverflow.com/questions/17347611/downloading-a-zip-from-github-removes-newlines-from-text-files --- windows/INSTALL | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/windows/INSTALL b/windows/INSTALL index 58955ca60a5..99ffa7b7723 100644 --- a/windows/INSTALL +++ b/windows/INSTALL @@ -31,6 +31,7 @@ https://github.com/kaldi-asr/kaldi.git Example: $ git clone https://github.com/kaldi-asr/kaldi.git kaldi + It is not recommended to download the respository as a zip (see step 2c). 2) enter the (kaldi)/tools directory in the freshly checked-out kaldi repo. All following actions should @@ -57,6 +58,9 @@ Example: (kaldi)/tools$ cd openfst (kaldi)/tools/openfst$ patch -p1 <../extras/openfstwin-1.3.4.patch + If you get this error: `Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354` + it is because the `patch.c` file should have Windows line endings (CRLF) rather than Unix ones (LF). + This can happen if you download the respository as a zip from Github, rather than cloning the repository. 2d-1) Download the OpenBLAS binary packages https://sourceforge.net/projects/openblas From 40136da120b5758f2323a8dfe67c12e42b3c41fc Mon Sep 17 00:00:00 2001 From: Tim Hutt Date: Mon, 11 Jan 2016 11:22:51 +0000 Subject: [PATCH 3/3] Removed note about git archive mangling patch line endings Should be fixed in the windows_line_endings branch. --- windows/INSTALL | 2 -- 1 file changed, 2 deletions(-) diff --git a/windows/INSTALL b/windows/INSTALL index 99ffa7b7723..452919ab3be 100644 --- a/windows/INSTALL +++ b/windows/INSTALL @@ -31,7 +31,6 @@ https://github.com/kaldi-asr/kaldi.git Example: $ git clone https://github.com/kaldi-asr/kaldi.git kaldi - It is not recommended to download the respository as a zip (see step 2c). 2) enter the (kaldi)/tools directory in the freshly checked-out kaldi repo. All following actions should @@ -60,7 +59,6 @@ (kaldi)/tools/openfst$ patch -p1 <../extras/openfstwin-1.3.4.patch If you get this error: `Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354` it is because the `patch.c` file should have Windows line endings (CRLF) rather than Unix ones (LF). - This can happen if you download the respository as a zip from Github, rather than cloning the repository. 2d-1) Download the OpenBLAS binary packages https://sourceforge.net/projects/openblas