Skip to content

Commit b7a35e2

Browse files
committed
Added a patch for pthreads and updated the INSTALL.md for windows
Updated guide to say it works on MSVS 2015. Fixed some grammar as well.
1 parent d8b1969 commit b7a35e2

File tree

2 files changed

+32
-11
lines changed

2 files changed

+32
-11
lines changed

tools/extras/pthread-2.9.1.patch

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--- a/Pre-built.2/include/pthread.h 2016-02-14 13:49:16.027430500 -0500
2+
+++ b/Pre-built.2/include/pthread_new.h 2016-02-14 13:53:40.729116100 -0500
3+
@@ -317,10 +317,12 @@
4+
#define HAVE_STRUCT_TIMESPEC
5+
#if !defined(_TIMESPEC_DEFINED)
6+
#define _TIMESPEC_DEFINED
7+
+#if defined(_MSC_VER) && _MSC_VER >= 1900 && defined(_CRT_NO_TIME_T)
8+
struct timespec {
9+
time_t tv_sec;
10+
long tv_nsec;
11+
};
12+
+#endif /* _CRT_NO_TIME_T */
13+
#endif /* _TIMESPEC_DEFINED */
14+
#endif /* HAVE_STRUCT_TIMESPEC */

windows/INSTALL.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ For cygwin installation, see the instructions in `../INSTALL`.
2222
bash script wouldn't most probably work)
2323
* While the 32bit project files will still be generated, we don't really
2424
care if they work or not. They will be removed in the near future.
25-
* The build process were validated using MSVS2013 and partially (MKL only) using MSVS2015-rc
25+
* The build process was validated using MSVS2013 and MSVS2015
2626
* We support only openfst-1.3.x for now.
2727
* I suggest to have git installed -- not only because we will
2828
use it to download the source codes (you could download archives
@@ -76,14 +76,21 @@ For cygwin installation, see the instructions in `../INSTALL`.
7676

7777
If you get this error: `Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354`
7878
it is because the `patch.c` file should have Windows line endings (CRLF) rather than Unix ones (LF).
79+
80+
6. Use patch to patch the pthreads
81+
82+
The patch location is `tools/extras/pthread-2.9.1.patch`
83+
84+
(kaldi)/tools$ cd pthreads
85+
(kaldi)/tools/pthreads$ patch -p1 <../extras/pthread-2.9.1.patch
7986

8087
There are two options to use for BLAS (linear algebra): [Intel® MKL](https://software.intel.com/en-us/intel-mkl) and OpenBLAS. [Intel® MKL](https://software.intel.com/en-us/intel-mkl) is made by Intel and is optimised
8188
for their processors. It isn't free, but you can get [Community Licensing for Intel® Performance Libraries
8289
](https://software.intel.com/sites/campaigns/nest/) or as part of Intel product suite if you [qualify as students, educators, academic researchers, and open source contributors](https://software.intel.com/en-us/qualify-for-free-software). OpenBLAS is free alternative with similar performance.
8390

84-
6. If using [Intel® MKL](https://software.intel.com/en-us/intel-mkl), [install it](https://software.intel.com/en-us/intel-mkl/try-buy).
91+
7. If using [Intel® MKL](https://software.intel.com/en-us/intel-mkl), [install it](https://software.intel.com/en-us/intel-mkl/try-buy).
8592

86-
7. If using OpenBLAS, download the binary packages.
93+
8. If using OpenBLAS, download the binary packages.
8794

8895
https://sourceforge.net/projects/openblas
8996

@@ -94,7 +101,7 @@ for their processors. It isn't free, but you can get [Community Licensing for In
94101

95102
**Be careful to download "Win64-int32" and not "Win64-int64"!**
96103

97-
8. If you want enabled [CUDA](http://www.nvidia.com/object/cuda_home_new.html) support, download and install [NVIDIA CUDA SDK](https://developer.nvidia.com/cuda-downloads).
104+
9. If you want enabled [CUDA](http://www.nvidia.com/object/cuda_home_new.html) support, download and install [NVIDIA CUDA SDK](https://developer.nvidia.com/cuda-downloads).
98105
Be careful and strive for as standard install as possible. The installer
99106
set certain environment variables on which the MSVC Build rules rely.
100107
If you call "set" in the command line, you should see:
@@ -107,7 +114,7 @@ for their processors. It isn't free, but you can get [Community Licensing for In
107114

108115
The first one (`CUDA_PATH`) is particularly important.
109116

110-
9. Open the OpenFST solution in Visual Studio
117+
10. Open the OpenFST solution in Visual Studio
111118

112119
* for [Visual Studio 2013](https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx), the correct solution is in `MSVC12` directory
113120
* for [Visual Studio 2015](https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx), the correct solution is in `MSVC14` directory
@@ -118,14 +125,14 @@ for their processors. It isn't free, but you can get [Community Licensing for In
118125

119126
If either of the two won't build, you should stop here and start figuring what's different!
120127

121-
10. Enter the `(kaldi)/windows` directory
128+
11. Enter the `(kaldi)/windows` directory
122129

123130
Example:
124131

125132
(kaldi)/tools/openfst$ cd ../../windows
126133
(kaldi)/windows $ pwd
127134

128-
11. Copy `variables.props.dev` to `variables.props`.
135+
12. Copy `variables.props.dev` to `variables.props`.
129136
Then modify the file `variables.props` to reflect
130137
the correct paths, using your favorite text editor.
131138
Don't worry, it's a text file, even though you have to be
@@ -138,10 +145,10 @@ for their processors. It isn't free, but you can get [Community Licensing for In
138145
No matter what you plan to use, set both the `OPENFST*` and `PTHREADW`
139146
variables correctly
140147

141-
12. For OpenBLAS support, copy the file `kaldiwin_openblas.props` to `kaldiwin.props`
142-
13. For MKL support, copy the `kaldiwin_mkl.props` to `kaldiwin.props`
148+
13. For OpenBLAS support, copy the file `kaldiwin_openblas.props` to `kaldiwin.props`
149+
14. For MKL support, copy the `kaldiwin_mkl.props` to `kaldiwin.props`
143150

144-
14. Call the script that generates the MSVC solution
151+
15. Call the script that generates the MSVC solution
145152

146153
./generate_solution.pl --vsver <default|vs2013|vs2015> [--enable-cuda] [--enable-openblas] [--enable-mkl]
147154

@@ -156,7 +163,7 @@ for their processors. It isn't free, but you can get [Community Licensing for In
156163

157164
(kaldi)/tools$ generate_solution.pl --vsver vs2013 --enable-cuda --enable-openblas
158165

159-
15. Open the generated solution in the visual studio and switch to **Debug|x64** (or **Release|x64**) and build.
166+
16. Open the generated solution in the visual studio and switch to **Debug|x64** (or **Release|x64**) and build.
160167
Expect 10 projects to fail, majority of them will fail because of missing include `portaudio.h`
161168

162169
------

0 commit comments

Comments
 (0)