0 Comments

Compiling the Ethereal Chess Engine with MinGW-w64 on Windows (SSSE3 Version): A Novice-Friendly, SEO-Optimised Guide


Introduction

Compiling a chess engine may sound daunting, especially for those without a programming background. However, with the right tools and a clear, step-by-step guide, even a complete beginner can compile the Ethereal chess engine on Windows using MinGW-w64. This tutorial covers every stage—from setting up your environment to running the SSSE3-optimised build.

By following these instructions, you will:

  • Install MinGW-w64 (the Windows port of GCC)
  • Clone the Ethereal source code from GitHub
  • Configure and build the SSSE3 version of Ethereal
  • Test the compiled engine

Let’s embark on this journey to bring the powerful Ethereal engine to your Windows machine.


What Is the Ethereal Chess Engine?

Ethereal is an open-source chess engine created by Andy Grant. It is known for its strong playing strength, modular design, and support for modern CPU instructions such as SSSE3 (Supplemental Streaming SIMD Extensions 3). SSSE3 optimisations can significantly speed up the engine’s static evaluation, making Ethereal run faster on compatible processors.

Key features of Ethereal:

  • Open source: freely available on GitHub
  • Modular codebase: easy to understand and modify
  • SSSE3 support: takes advantage of advanced CPU instructions
  • Cross-platform: compiles on Unix-like systems and Windows

This guide focuses on compiling the SSSE3-enabled version of Ethereal on Windows using MinGW-w64.


Why MinGW-w64?

MinGW-w64 stands for “Minimalist GNU for Windows,” and it provides a native port of the GNU Compiler Collection (GCC) on Windows. It allows you to compile C and C++ programs—like chess engines—without emulation or virtual machines.

Advantages of MinGW-w64:

  • Lightweight: minimal overhead, installs quickly
  • Native performance: generates fast, native Windows executables
  • Open source: no licence restrictions
  • Broad support: compatible with many open-source projects

By using MinGW-w64, you avoid the complexity of Microsoft Visual Studio and can leverage familiar GCC build processes.


Overview of Steps

  1. Check System Requirements
  2. Download and Install MinGW-w64
  3. Set Up Environment Variables
  4. Install Git
  5. Clone the Ethereal Repository
  6. Install Make (if required)
  7. Configure the Build for SSSE3
  8. Compile Ethereal
  9. Verify the SSSE3 Build
  10. Run and Test the Engine
  11. Troubleshooting Tips

Each step is explained in detail below, ensuring clarity for those without programming knowledge.


1. Check System Requirements

Before beginning, ensure your Windows PC meets these minimum requirements:

  • Operating System: Windows 7, 8, 10 or 11 (64 bit recommended)
  • Processor: Intel or AMD CPU with SSSE3 support (most CPUs manufactured since 2008)
  • RAM: at least 2 GB (4 GB or more recommended)
  • Disk Space: 500 MB free
  • Administrator Access: to install software and modify system variables

To check if your CPU supports SSSE3, follow these steps:

  1. Press Windows Key + R, type cmd, and press Enter.
  2. In the Command Prompt, type: wmic cpu get Name, Caption, DeviceID, Manufacturer, Architecture
  3. Look up your CPU model online to confirm SSSE3 support. Most modern Intel Core i3/i5/i7 and AMD Ryzen CPUs include SSSE3.

2. Download and Install MinGW-w64

  1. Open your web browser and navigate to the MinGW-w64 download page: https://mingw-w64.org/doku.php/download/mingw-builds
  2. Under the “Mingw-w64 online Installer” section, click the link to download the installer (e.g., mingw-w64-install.exe).
  3. Run the downloaded installer. You may need to allow the programme to make changes to your computer—click Yes when prompted.
  4. In the installer window:
    • Architecture: select x86_64 (for 64 bit systems)
    • Threads: choose posix
    • Exception: choose seh
    • Build revision: leave the default
  5. Choose an installation directory, for example: C:\mingw-w64\
  6. Click Install and wait for the process to complete (this may take a few minutes).
  7. Once finished, click Finish.

3. Set Up Environment Variables

Windows needs to know where to find the GCC compiler. To add MinGW-w64 to your PATH:

  1. Press Windows Key, type Environment Variables, and select Edit the system environment variables.
  2. In the System Properties window, click Environment Variables….
  3. Under System variables, scroll to Path and click Edit.
  4. Click New and enter the path to the MinGW-w64 bin directory, typically: C:\mingw-w64\mingw64\bin
  5. Click OK on all dialogues to close them.

To verify:

  1. Open a new Command Prompt window (important: it must be new).
  2. Type: gcc --version
  3. You should see output showing the GCC version number. If so, MinGW-w64 is correctly configured.

4. Install Git

Ethereal’s source code is hosted on GitHub. To download it, you need Git:

  1. Visit the Git downloads page: https://git-scm.com/download/win
  2. Download and run the Git installer.
  3. Accept the licence agreement and leave settings at their defaults, unless you have specific preferences.
  4. Finish the installation.

Verify Git:

  1. Open a new Command Prompt.
  2. Type: git --version
  3. You should see the Git version. If not, repeat the installation.

Ethereal

5. Clone the Ethereal Repository

Now, retrieve the Ethereal source code:

  1. Open the Command Prompt.
  2. Choose (or create) a directory to hold the source code. For example: cd %USERPROFILE%\Documents mkdir EtherealSource cd EtherealSource
  3. Clone the repository by typing: git clone https://github.com/AndyGrant/Ethereal.git
  4. Wait for the download to complete. A new folder named Ethereal will appear.

6. Install Make (if required)

Make is a build tool that automates compiling. On MinGW-w64, you may have mingw32-make installed instead of make.

Check for make:

mingw32-make --version

If you see a version number, you’re ready. If not, you can:

  1. Install MSYS2, which includes GNU Make, or
  2. Download a standalone make binary and place it in your MinGW bin folder.

For simplicity, this guide assumes you have mingw32-make.


7. Configure the Build for SSSE3

By default, Ethereal’s Makefile may not enable SSSE3. To ensure the SSSE3 version is built:

  1. Navigate to the source directory: cd Ethereal
  2. Open the file named Makefile in a text editor such as Notepad.
  3. Locate the CFLAGS and CXXFLAGS variables—these specify compiler options.
  4. Add the flag -mssse3 to each, for example: CFLAGS = -O3 -march=native -mssse3 CXXFLAGS = -O3 -march=native -mssse3
    • -O3 enables optimisations
    • -march=native lets GCC tune for your CPU
    • -mssse3 ensures SSSE3 instructions are used
  5. Save and close the Makefile.

Tip: If your CPU does not support SSSE3, the build will fail. In that case, remove -mssse3 and use -msse2 instead, which is more widely supported.


8. Compile Ethereal

With the Makefile configured, begin compilation:

  1. In the Command Prompt (still in the Ethereal directory), type: mingw32-make build
  2. The build process will commence, displaying lines that show which files are being compiled.
  3. Compilation may take several minutes. Be patient—optimisations increase compilation time.
  4. If errors appear, read them carefully. Common issues include:
    • Missing dependencies (rare for Ethereal)
    • Incorrect flags in the Makefile
    • PATH misconfiguration

If you encounter errors, revisit prior steps (environment variables, Makefile flags) to ensure accuracy.


9. Verify the SSSE3 Build

After a successful build, confirm that the executable was built with SSSE3 support:

  1. The compiled engine (e.g., ethereal.exe) should reside in a build or bin subfolder.
  2. To check for SSSE3 instructions, use the objdump tool (included in MinGW-w64): objdump -d build/ethereal.exe | grep ssse3
  3. If you see pshufb, pmulhuw, or other SSSE3 instructions, the SSSE3 build is confirmed.

10. Run and Test the Engine

With the SSSE3 version compiled, let’s run it:

  1. Open Command Prompt and navigate to the executable’s directory: cd Ethereal/build
  2. Launch the engine with a simple command: ethereal.exe
  3. You should see a prompt waiting for commands (e.g., uci).
  4. To test, use a chess graphical user interface (GUI) like Arena or Cute Chess:
    • Download and install one of these GUIs.
    • Add ethereal.exe as a new engine in the GUI’s settings.
    • Play a quick self-play match to confirm functionality.

If Ethereal responds to uci and plays moves, your compilation was successful.


11. Troubleshooting Tips

Even novice users may encounter issues. Here are solutions to common problems:

ProblemSolution
‘gcc’ is not recognisedEnsure C:\mingw-w64\mingw64\bin is added to the PATH. Open a new Command Prompt after editing.
‘git’ is not recognisedReinstall Git and select the option to add Git to the PATH during setup.
Compilation errors about SSSE3Verify your CPU supports SSSE3. If not, remove -mssse3 and use -msse2.
‘make’ not foundUse mingw32-make instead of make, or install GNU Make via MSYS2.
Engine crashes in GUITest the plain console version first. Update GUI or redownload the engine.
Slow compile or hangClose other applications to free RAM. Ensure antivirus isn’t scanning the build folder.

Conclusion

Congratulations! You have successfully compiled the SSSE3-enabled Ethereal chess engine on Windows using MinGW-w64. Despite no prior programming knowledge, this guide has walked you through each step in clear, novice-friendly language.

Recap of key steps:

  1. Install MinGW-w64 and Git
  2. Configure environment variables
  3. Clone Ethereal from GitHub
  4. Edit the Makefile for SSSE3 support
  5. Compile with mingw32-make build
  6. Verify SSSE3 instructions and test in a GUI

By harnessing SSSE3 optimisations, Ethereal will run faster and play stronger. Should you wish to explore further, consider experimenting with additional compiler flags or analysing the engine’s code—Ethereal’s modular design makes it accessible for learning and customisation.

We hope this step-by-step guide has empowered you to compile and run one of the world’s finest open-source chess engines on your Windows PC. Enjoy the games!

Jorge Ruiz

Jorge Ruiz Centelles

Filólogo y amante de la antropología social africana

Related Posts