<commit_before>Windows build instructions
==========================

Static libraries
----------------

To simplify distribution, Boost and Qt must be built as static 
libraries on Windows.  It is recommended to download compiled Boost 
binaries for your compiler if they are available, which typically include 
static libraries.  Most likely Qt will need to be built from 
scratch; see detailed instructions below.

**IMPORTANT: Make sure that you build Qt with the same compiler you
will use for building the application (e.g. all MSVC 32 bit, or all MSVC 64 bit).**

Building static Qt on Windows
-----------------------------

1\. Make sure that the Windows SDK is installed along with Visual Studio.
    This project uses C++11 features which are only fully implemented on 
    Visual Studio 2015 or later.

2\. Clone the [Qt5 repository][QtRepo] from github.

3\. By default, the dev branch will be checked out.  Change the version to
    v5.8.0:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.sh}
git checkout v5.8.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

4\. Navigate to the top level repository directory and type:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.sh}
git submodule update --init
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This will clone all the submodules of Qt and check out the branch
corresponding to your current branch.

5\. Install the following script languages:

* [Perl][Perl]
* [Python][Python]
* [Ruby][Ruby]

6\. In the subdirectory qtbase\mkspecs\common, change msvc-desktop.conf
    such that all occurrences of MD are replaced with MT.

7\. Type the following from the top level directory:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.sh}
configure.bat -static -release -prefix "your\working\dir\qtbase"
-platform win32-msvc2015 -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype
-opengl desktop -no-openssl -opensource -confirm-license -make libs -nomake
tools -nomake examples -nomake tests -sql-odbc -plugin-sql-odbc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

8\. Type:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.sh}
nmake
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The Qt5 static libraries should now be built.

Boost Binaries on Windows
------------------------------------
1\. Download the prebuilt binaries for [Boost 1.62][BoostBinaries].

2\. Run the installer.

FFMPEG Binaries on Windows
--------------------------
1\. Download the prebuilt binaries for [FFMPEG 3.3.2][FFMPEGBinaries], 
    both the developer and shared versions.

2\. Extract both.  Copy the contents of the lib directory in the shared
    version into the lib directory of the developer version.  Discard 
    the shared version and use the developer version.

Building the application on Windows
-----------------------------------

1\. It is recommended on Windows to use the CMake GUI to configure the
    build.  Open the CMake GUI, set the source directory to the top level
    FishAnnotator repository directory, and set the build directory to a
    subdirectory of this called *build*.  Something like:

    Where is the source code: C:/local/FishAnnotator
    Where to build the binaries: C:/local/FishAnnotator/build

2\. Press configure, allow CMake to create the build directory, and select<commit_msg>Fix error in ffmpeg documentation<commit_after>Windows build instructions
==========================

Static libraries
----------------

To simplify distribution, Boost and Qt must be built as static 
libraries on Windows.  It is recommended to download compiled Boost 
binaries for your compiler if they are available, which typically include 
static libraries.  Most likely Qt will need to be built from 
scratch; see detailed instructions below.

**IMPORTANT: Make sure that you build Qt with the same compiler you
will use for building the application (e.g. all MSVC 32 bit, or all MSVC 64 bit).**

Building static Qt on Windows
-----------------------------

1\. Make sure that the Windows SDK is installed along with Visual Studio.
    This project uses C++11 features which are only fully implemented on 
    Visual Studio 2015 or later.

2\. Clone the [Qt5 repository][QtRepo] from github.

3\. By default, the dev branch will be checked out.  Change the version to
    v5.8.0:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.sh}
git checkout v5.8.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

4\. Navigate to the top level repository directory and type:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.sh}
git submodule update --init
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This will clone all the submodules of Qt and check out the branch
corresponding to your current branch.

5\. Install the following script languages:

* [Perl][Perl]
* [Python][Python]
* [Ruby][Ruby]

6\. In the subdirectory qtbase\mkspecs\common, change msvc-desktop.conf
    such that all occurrences of MD are replaced with MT.

7\. Type the following from the top level directory:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.sh}
configure.bat -static -release -prefix "your\working\dir\qtbase"
-platform win32-msvc2015 -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype
-opengl desktop -no-openssl -opensource -confirm-license -make libs -nomake
tools -nomake examples -nomake tests -sql-odbc -plugin-sql-odbc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

8\. Type:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.sh}
nmake
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The Qt5 static libraries should now be built.

Boost Binaries on Windows
------------------------------------
1\. Download the prebuilt binaries for [Boost 1.62][BoostBinaries].

2\. Run the installer.

FFMPEG Binaries on Windows
--------------------------
1\. Download the prebuilt binaries for [FFMPEG 3.3.2][FFMPEGBinaries], 
    both the developer and shared versions.

2\. Extract both.  Copy the contents of the bin directory in the shared
    version into the lib directory of the developer version.  Discard 
    the shared version and use the developer version.

Building the application on Windows
-----------------------------------

1\. It is recommended on Windows to use the CMake GUI to configure the
    build.  Open the CMake GUI, set the source directory to the top level
    FishAnnotator repository directory, and set the build directory to a
    subdirectory of this called *build*.  Something like:

    Where is the source code: C:/local/FishAnnotator
    Where to build the binaries: C:/local/FishAnnotator/build

2\. Press configure, allow CMake to create the build directory, and select
{'fraction_non_alphanumeric': 0.25857595848947823, 'fraction_numerical': 0.012683770539060248, 'mean_word_length': 3.704406779661017, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6498004', 'n_tokens_mistral': 1853, 'n_tokens_neox': 1648, 'n_words': 777}