<commit_before># Building with msys2 and Mingw64

The following are instructions for building Csound for 64-bit Windows (x86_64) using msys2 and mingw64.

These instructions come in two parts. The first is for building a "plain" Csound that the build will install into a "dist" directory. This build is simple, and Csound will run in the "dist" directory. The second is for building all features of Csound that are available for Windows 64 bit CPU architecture, then building an Inno Setup installer for them, then running the installer. This build is considerably more complex.

> Note that MSYS2 can also be used to create 32bit binaries. Simply use the MinGW-w64 Win32 Shell instead of the Win64 Shell. See below for details.

## Plain Build

1. Install the x86_64 version of [msys2](http://msys2.github.io/). Follow the pacman setup instructions carefully.
2. Using pacman, install (pacman -S package_name) the following additional development tools and libraries (not all of these tools are needed in order to build Csound. It depends on what 3rd party tools you require. For example, luajit, boost, fltk, eigen3, hdf5, fluidsynth, libwebsockets, etc. are all optional):
  * mingw-w64-x86_64-toolchain
  * make
  * autoconf
  * automake
  * libtool
  * flex
  * bison
  * doxygen
  * patch
  * dos2unix
  * subversion
  * mingw-w64-x86_64-cmake
  * mingw-w64-x86_64-docbook-xml
  * mingw-w64-x86_64-docbook-xsl
  * mingw-w64-x86_64-swig<commit_msg>Instructions for statically linking plugins for mingw64.<commit_after># Building with msys2 and Mingw64

The following are instructions for building Csound for 64-bit Windows (x86_64) using msys2 and mingw64.

These instructions come in two parts. The first is for building a "plain" Csound that the build will install into a "dist" directory. This build is simple, and Csound will run in the "dist" directory. The second is for building all features of Csound that are available for Windows 64 bit CPU architecture, then building an Inno Setup installer for them, then running the installer. This build is considerably more complex.

> Note that MSYS2 can also be used to create 32bit binaries. Simply use the MinGW-w64 Win32 Shell instead of the Win64 Shell. See below for details.

> If you want all Csound plugins to be built with static linkage to all library dependencies, you must set STK_LIBRARY and PTHREAD_LIBRARY in your build.sh or build-mkg.sh to specify the full pathname to the static version of the respective library.

## Plain Build

1. Install the x86_64 version of [msys2](http://msys2.github.io/). Follow the pacman setup instructions carefully.
2. Using pacman, install (pacman -S package_name) the following additional development tools and libraries (not all of these tools are needed in order to build Csound. It depends on what 3rd party tools you require. For example, luajit, boost, fltk, eigen3, hdf5, fluidsynth, libwebsockets, etc. are all optional):
  * mingw-w64-x86_64-toolchain
  * make
  * autoconf
  * automake
  * libtool
  * flex
  * bison
  * doxygen
  * patch
  * dos2unix
  * subversion
  * mingw-w64-x86_64-cmake
  * mingw-w64-x86_64-docbook-xml
  * mingw-w64-x86_64-docbook-xsl
  * mingw-w64-x86_64-swig
{'fraction_non_alphanumeric': 0.0603125, 'fraction_numerical': 0.04125, 'mean_word_length': 4.080952380952381, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1256547', 'n_tokens_mistral': 1049, 'n_tokens_neox': 948, 'n_words': 437}