0 Comments

Compile Obsidian

A Step-by-Step Guide for Non-Programmers


Introduction

The Obsidian chess engine is a powerful open-source tool for chess analysis. This guide walks you through compiling Obsidian on Windows using Mingw64—no programming knowledge needed! Follow these steps to transform Obsidian’s source code into a ready-to-use .exe file.


Prerequisites

  1. Windows PC (64-bit recommended).
  2. Internet connection (to download tools and source code).

Step 1: Install Required Tools

Git

  • Why needed: Downloads Obsidian’s source code.
  • How to install:
  1. Visit Git for Windows.
  2. Click “Download” and run the installer.
  3. Accept all default settings.

Mingw64

  • Why needed: Compiles C code into a Windows executable.
  • How to install:
  1. Download the Mingw-w64 installer.
  2. Pick the latest version (e.g., x86_64-13.2.0-release-win32-seh-msvcrt-rt_v11-rev1.7z).
  3. Extract the .7z file to C:\mingw64.
  4. Add Mingw64 to your system PATH:
    • Press Win + S → type Environment Variables → select “Edit the system environment variables”.
    • Click Environment Variables → Under “System variables”, select Path → Click Edit.
    • Add C:\mingw64\bin → Click OK.

Verify Installation

  1. Open Command Prompt (press Win + R → type cmd).
  2. Run:
    “`bash
    gcc –version
   If you see version details (e.g., `gcc (GCC) 13.2.0`), Mingw64 is installed correctly.  

---

#### **Step 2: Download Obsidian’s Source Code**  
1. Open **Command Prompt**.  
2. Run:  

bash
git clone https://github.com/gab8192/Obsidian

   This creates a folder `Obsidian` with all source files.  
3. Navigate into the folder:  

bash
cd Obsidian

---

#### **Step 3: Compile the Chess Engine**  
1. In the same Command Prompt, run:  

bash
gcc -o obsidian.exe bitboard.c board.c main.c movegen.c perft.c search.c uci.c util.c -O3 -flto

   - **What this does**: Combines all Obsidian’s `.c` files into `obsidian.exe`.  
   - **Flags explained**:  
     - `-O3`: Optimises for speed.  
     - `-flto`: Enhances performance further.  

2. Wait 10-30 seconds. If successful, you’ll see **no error messages**.  

---

#### **Step 4: Test the Executable**  
1. Run the compiled engine:  

bash
obsidian.exe

2. **Expected output**:  


Obsidian v0.1 by gab8192
uciok
`` Typequit` to exit.


 Compile Obsidian

Troubleshooting

  • “gcc not recognised”:
  • Recheck Mingw64’s bin folder path in Environment Variables.
  • Compilation errors:
  • Ensure you ran gcc inside the Obsidian folder.
  • Update Mingw64/Git and retry.

Using Obsidian in Chess GUIs

  1. Install a UCI-compatible GUI (e.g., Arena Chess).
  2. Add obsidian.exe as a new engine in the GUI settings.

Conclusion

You’ve successfully compiled the Obsidian chess engine on Windows using Mingw64! This process unlocks advanced chess analysis without expensive software. For updates, revisit Obsidian’s GitHub repository.

Pro Tip: Replace -O3 with -O2 in the gcc command if you encounter stability issues.


Keywords: Compile Obsidian chess engine, Mingw64 Windows, Obsidian chess tutorial, build chess engine, open-source chess, UCI engine, Windows chess programming.

Jorge Ruiz

Jorge Ruiz Centelles

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

Related Posts