Skip to main content

System Requirements

Before building Marlin, ensure your system meets these requirements:
  • C++17 compiler (GCC 7+, Clang 5+, MSVC 2017+, or equivalent)
  • CMake 3.16 or higher
  • Git (to clone the repository)
On Windows, you’ll need MinGW Makefiles as the CMake generator. The build configuration specifically uses MinGW for compatibility.

Building from Source

1

Clone the repository

First, clone the Marlin repository to your local machine:
git clone https://github.com/yourusername/marlin.git
cd marlin
2

Generate build files

Use CMake to generate the build configuration. The project uses MinGW Makefiles on Windows:
cmake -B build -S . -G "MinGW Makefiles"
Platform-specific notes:
cmake -B build -S . -G "MinGW Makefiles"
This creates a build/ directory with all necessary build files.
3

Build the executable

Compile the project using CMake’s build command:
cmake --build build
This compiles all source files and produces the marlin executable in the build/ directory.
4

Verify installation

Test that Marlin was built successfully:
./build/marlin
You should see the Marlin welcome message:
Marlin Connect 4 Engine v0.1
Type 'help' for available commands.

>
Type quit to exit.

Build Configuration

Marlin’s CMakeLists.txt is configured with the following settings:
  • C++ Standard: C++17 (required)
  • Compiler Warnings: Enabled for code quality
    • MSVC: /W4
    • GCC/Clang: -Wall -Wextra -pedantic
  • Project Version: 0.1.0

Project Structure

The build system compiles these components: Main executable (marlin):
  • src/main.cpp - CLI interface
  • src/position.cpp - Bitboard position representation
  • src/solver.cpp - Negamax solver with alpha-beta pruning
  • src/transposition.cpp - Transposition table implementation
Test executable (marlin_tests):
  • tests/test_position.cpp - Unit tests for position logic
  • src/position.cpp - Position implementation

Running Tests

To run the test suite:
./build/marlin_tests
Tests verify the correctness of bitboard operations, move generation, and win detection.

Troubleshooting

Error: CMake 3.16 or higher is requiredSolution: Upgrade CMake:
# Ubuntu/Debian
sudo apt update
sudo apt install cmake

# macOS
brew install cmake

# Windows
# Download from https://cmake.org/download/
Error: unsupported option '-std=c++17'Solution: Update your compiler:
  • GCC: Version 7 or higher
  • Clang: Version 5 or higher
  • MSVC: Visual Studio 2017 or higher
Error: Generator 'MinGW Makefiles' not foundSolution: Install MinGW-w64:
  1. Download from mingw-w64.org
  2. Add MinGW’s bin/ directory to your PATH
  3. Verify with g++ --version

Next Steps

Now that Marlin is installed, learn how to use it:

Quick Start Guide

Run your first Connect 4 analysis

Build docs developers (and LLMs) love