<commit_before>Building VW on Windows

Originally by <NAME> <<EMAIL>>
**************************************************************************************************************
Notes for building VW under Visual Studio 2013 on Windows 8.1
9/02/2014 <NAME> <EMAIL>


**************************************************************************************************************
(1) Get Tools
You'll need a Visual Studio 2013 installed that includes c# and c++
You'll also need the Windows SDK which you can download from Microsoft at
	http://msdn.microsoft.com/en-us/windows/desktop/bg162891.aspx


There's a patch for zlib to make it work.
There also some changes to Vowpal Wabbit in this commit.
Details are at the last section of this file

It's  handy to have a bash shell to run git
You can use a git bash shell fron the https://windows.github.com/ if you don't have it already.
Or you can just edit the changes using notepad to read the files. 

There are end of line problems with patching with git patch.
I used the GnuWin32 patch package binaries from
http://gnuwin32.sourceforge.net/packages/patch.htm which will run in a dos batch file.
This seems to be able to deal with patching without damaging the windows <CR><LF> pairs.

**************************************************************************************************************
(2) open a copy various command shells

	(a)	Open an x86 command shell: run the Visual Studio 2013 Tools /  VS2013 x86 Native Tools Command Prompt
			or 
			cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
	(b)	Open an x64 command shell: run the Visual Studio 2013 Tools / VS2013 x64 Cross Tools Command Prompt
			or 
			cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86_amd64
	(c)	Open the Git bash shell
		"C:\Program Files (x86)\Git\bin\sh.exe" --login -i
		or some other bash shell

**************************************************************************************************************
(3) Setup Directories

I use c:\src\vw as my %ROOT% directory; You could use another directory 
boost, vowpal_wabbit, and zlib-1.2.8 are directories inside that directory

        (a) mkdir c:\src
        (b) mkdir c:\src\vw

**************************************************************************************************************
(4) Get Vowpal Wabbit 

    (a) In a  command shell to %ROOT% : "cd c:\src\vw"
    (b) run "git clone https://github.com/JohnLangford/vowpal_wabbit.git"
	details of the changes are in bottom of this file.

**************************************************************************************************************
(5) Build zlib with Visual Studio 2013

	(a)Get the zlib 1.28.0 file from   http://zlib.net/zlib128.zip
	(b) unzip zlib-1.2.8.zip into the c:\src\vw\zlib-1.2.8  

	use contrib/vstudio/vc11 since there is no contrib/vstudio/vc12 as yet
	
	(c)Get the GnuWin32 Patch Utility http://gnuwin32.sourceforge.net/packages/patch.htm patch.exe
	and simply put it in the c:\src\vw

	(d)Unzip the zlibpatch.zip file and place the contained zlibpatch.txt file in vowpa_wabbit 



	(e) From a dos command shell run as administrator
	
	  patch --dry-run -p0 --directory=zlib-1.2.8 --input=../vowpal_wabbit/zlibpatch.txt -F3
		check output messages looks good then
	  patch  -p0 --directory=zlib-1.2.8 --input=../vowpal_wabbit/zlibpatch.txt -F3

	(f) Build the zlib libararies by either of the following steps. 

	Launch Visual Studio 2013
	Open the solution %ROOT%/zlib-1.2.8\contrib\vstudio\vc11\zlibvc.sln
	Batch build the configurations you want of x86 and x64 debut and release

    	 or from your Visual Studio Command shell 
	     cd c:\src\vw\zlib-1.2.0\contrib\vstudio\vc11
		run the following commands (can skip the last four if you only want 32bit binaries)

        "msbuild /p:Configuration=Debug;Platform=Win32 zlibstat.vcxproj"
        "msbuild /p:Configuration=Release;Platform=Win32 zlibvc.vcxproj"
        "msbuild /p:Configuration=Release;Platform=Win32 zlibstat.vcxproj"
        "msbuild /p:Configuration=Debug;Platform=x64 zlibstat.vcxproj"
        "msbuild /p:Configuration=Release;Platform=x64 zlibvc.vcxproj"
        "msbuild /p:Configuration=Release;Platform=x64 zlibstat.vcxproj"

	Ignore the warnings about Platform 'Itanium' referenced in the project file  since Itanium is no longer supported 

**************************************************************************************************************
(6) Building Boost

I build boost in c:\boost with the sources in a subdirectory
If you use another directory modify the vw solution and project macro definitions for BoostIncludeDir and BoostLibDir


	Get boost from http://www.boost.org/users/history/version_1_56_0.html
			
<commit_msg>update documentation to mention patched zlib git repository<commit_after>Building VW on Windows

Originally by <NAME> <<EMAIL>>
**************************************************************************************************************
Notes for building VW under Visual Studio 2013 on Windows 8.1
9/02/2014 <NAME> <EMAIL>


**************************************************************************************************************
(1) Get Tools
You'll need a Visual Studio 2013 installed that includes c# and c++
You'll also need the Windows SDK which you can download from Microsoft at
	http://msdn.microsoft.com/en-us/windows/desktop/bg162891.aspx


There's a patch for zlib to make it work.
There also some changes to Vowpal Wabbit in this commit.
Details are at the last section of this file

It's  handy to have a bash shell to run git
You can use a git bash shell fron the https://windows.github.com/ if you don't have it already.
Or you can just edit the changes using notepad to read the files. 

There are end of line problems with patching with git patch.
I used the GnuWin32 patch package binaries from
http://gnuwin32.sourceforge.net/packages/patch.htm which will run in a dos batch file.
This seems to be able to deal with patching without damaging the windows <CR><LF> pairs.

**************************************************************************************************************
(2) open a copy various command shells

	(a)	Open an x86 command shell: run the Visual Studio 2013 Tools /  VS2013 x86 Native Tools Command Prompt
			or 
			cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
	(b)	Open an x64 command shell: run the Visual Studio 2013 Tools / VS2013 x64 Cross Tools Command Prompt
			or 
			cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86_amd64
	(c)	Open the Git bash shell
		"C:\Program Files (x86)\Git\bin\sh.exe" --login -i
		or some other bash shell

**************************************************************************************************************
(3) Setup Directories

I use c:\src\vw as my %ROOT% directory; You could use another directory 
boost, vowpal_wabbit, and zlib-1.2.8 are directories inside that directory

        (a) mkdir c:\src
        (b) mkdir c:\src\vw

**************************************************************************************************************
(4) Get Vowpal Wabbit 

    (a) In a  command shell to %ROOT% : "cd c:\src\vw"
    (b) run "git clone https://github.com/JohnLangford/vowpal_wabbit.git"
	details of the changes are in bottom of this file.

**************************************************************************************************************
(5) Build zlib with Visual Studio 2013

	The patched version of the sources for zlib are up on https://github.com/nicknussbaum/zlibpatched.git
	They can also be made as follows.
	

	(a)Get the zlib 1.28.0 file from   http://zlib.net/zlib128.zip
	(b) unzip zlib-1.2.8.zip into the c:\src\vw\zlib-1.2.8  

	use contrib/vstudio/vc11 since there is no contrib/vstudio/vc12 as yet
	
	(c)Get the GnuWin32 Patch Utility http://gnuwin32.sourceforge.net/packages/patch.htm patch.exe
	and simply put it in the c:\src\vw

	(d)Unzip the zlibpatch.zip file and place the contained zlibpatch.txt file in vowpa_wabbit 



	(e) From a dos command shell run as administrator
	
	  patch --dry-run -p0 --directory=zlib-1.2.8 --input=../vowpal_wabbit/zlibpatch.txt -F3
		check output messages looks good then
	  patch  -p0 --directory=zlib-1.2.8 --input=../vowpal_wabbit/zlibpatch.txt -F3
	  
	  
	  
	  
	  

	 From the patched sources build the zlib libararies by either of the following steps. 

	Launch Visual Studio 2013
	Open the solution %ROOT%/zlib-1.2.8\contrib\vstudio\vc11\zlibvc.sln
	Batch build the configurations you want of x86 and x64 debut and release

    	 or from your Visual Studio Command shell 
	     cd c:\src\vw\zlib-1.2.0\contrib\vstudio\vc11
		run the following commands (can skip the last four if you only want 32bit binaries)

        "msbuild /p:Configuration=Debug;Platform=Win32 zlibstat.vcxproj"
        "msbuild /p:Configuration=Release;Platform=Win32 zlibvc.vcxproj"
        "msbuild /p:Configuration=Release;Platform=Win32 zlibstat.vcxproj"
        "msbuild /p:Configuration=Debug;Platform=x64 zlibstat.vcxproj"
        "msbuild /p:Configuration=Release;Platform=x64 zlibvc.vcxproj"
        "msbuild /p:Configuration=Release;Platform=x64 zlibstat.vcxproj"

	Ignore the warnings about Platform 'Itanium' referenced in the project file  since Itanium is no longer supported 
	
	
	

**************************************************************************************************************
(6) Building Boost

I build boost in c:\boost with the sources in a subdirectory
If you use another directory modify the vw solution and project macro definitions for BoostIncludeDir and BoostLibDir


	Get boost from http://www.boost.org/users/history/version_1_56_0.html
			

{'fraction_non_alphanumeric': 0.22548719518416488, 'fraction_numerical': 0.03040506070809101, 'mean_word_length': 4.370958904109589, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 5, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1155834', 'n_tokens_mistral': 3107, 'n_tokens_neox': 2695, 'n_words': 1039}