MeTA can be built on Windows using the MinGW-w64 toolchain with gcc. We currently only support using MSYS2 as this makes fetching the compiler and related libraries significantly easier than it would be otherwise, and it tends to have very up-to-date packages relative to other similar MinGW distributions.

This visual guide will help you get the MSYS2 environment installed and updated, and then will show you how to compile and run the MeTA and its unit tests. Do note that some of the steps might look slightly different for you (different terminal output or prompts), but you should still be able to follow this guide.

### Setting up MSYS2

To start, download the installer for MSYS2 from the linked website. Be sure to grab the x86_64 version:

Now, run the installer. Click next at the prompt:

Use the default installation directory of C:\msys64. Click next:

Set up shortcuts if you want. Click next:

Leave the Run MSYS2 64-bit now option checked, and click finish:

You should now see a MSYS2 terminal. You can tell that it is the MSYS2 terminal because it includes the purple text “MSYS” in the command prompt.

Run the following command:

pacman -Sy --needed bash pacman msys2-runtime

Type Y at the yes/no prompt for installation, then hit enter:

Once the installation finishes, close the terminal by clicking the red X in the corner:

Now, open a File Explorer window, and navigate to your C: drive:

Find the msys64 folder, and double click:

Find the msys2_shell command and double click:

You should be back at a MSYS terminal (notice the purple “MSYS” in the prompt). Run the following command:

pacman -Syuu

Type Y at the yes/no installation prompt and hit enter:

When the install finishes, close the terminal by clicking the red X in the corner:

If you get a warning like this, just click OK:

Launch the MSYS2 shell again by double clicking on msys2_shell in C:\msys64. Run the following command:

pacman -Syu

If you see any prompts about replacing certain packages with another package (like pictured below), type Y and hit enter:

Type Y at the yes/no installation prompt and hit enter:

Once the install finishes, close the terminal by either clicking the red X or by typing exit:

Congratulations! MSYS2 should be set up and updated to the latest version now.

### Getting MeTA’s Build Dependencies

Now, let’s get everything set up for MeTA. Navigate to C:\msys64 and double click on the mingw64 application:

This will launch the “MINGW64” shell. You can tell that you are in the MINGW64 shell by the purple “MINGW64” in the command prompt. You will want to use the MINGW64 shell for everything from now on.

Just to be sure you’ve got everything up to date, run the following command, typing Y and hitting enter at any prompts along the way:

pacman -Syu

Now, copy and paste the following command into your MINGW64 shell and then hit enter:

pacman -Syu git make patch mingw-w64-x86_64-{gcc,cmake,icu,jemalloc,zlib} --force

At the yes/no installation prompt, type Y and hit enter:

Congratulations! The MinGW-w64 toolchain is now installed, along with all the libraries and command-line tools that MeTA’s build system uses.

### Getting and Compiling MeTA

Finally, we can download and compile MeTA and its unit tests. Copy and paste the following command into a MINGW64 shell, and then press enter:

git clone https://github.com/meta-toolkit/meta.git

Move into the newly created meta directory by running the following command:

cd meta

Now, fetch the submodules for MeTA by running the following command:

git submodule update --init --recursive

Now, make a build directory with the following command:

mkdir build

Move into this new directory with the following command:

cd build

Copy the sample configuration file into your build directory with the following command:

cp ../config.toml .

Now, we will use cmake to generate our Makefiles by running the following command (every part of this is important, so please copy/paste it):

cmake .. -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release

Once the Makefiles have been generated by cmake, we can run make to do the actual building of MeTA:

Once the build process completes (with no errors!), you should be able to run the unit tests:

./unit-test --reporter=spec

If everything passes, congratulations! MeTA seems to be working on your system.