Skip to content
Manlio Morini edited this page Jun 19, 2024 · 8 revisions

Build requirements

Ultra is designed to have minimal requirements for building and use with your projects, though some are necessary. Currently, we support Linux and Windows. We will also make our best effort to support other platforms (e.g. Mac OS X, BSD). However, since core members of the Ultra project have no access to these platforms, Ultra may have outstanding issues there. If you notice any problems on your platform, please use the issue tracking system; patches for fixing them are even more welcome!

Mandatory

  • A C++20-standard-compliant compiler
  • CMake

Optional

Setting up the build

Usually

cd ultra
cmake -B build/ src/

is enough. Take a look at platform specific details for additional information.

You're now ready to build using the underlying system tool:

  • everything: cmake --build build/
  • kernel library (libultra.a): cmake --build build/ --target ultra
  • the ABC example: cmake --build build/ --target ABC
  • for a list of valid targets: cmake --build build/ --target help

The output files are stored in sub-directories of build/ (out-of-source build).

Platform specific details

Unix

To suggest a specific compiler, you can write:

CXX=clang++ cmake -B build/ src/

Windows

Prerequisites

There are many possibilities:

Visual Studio 2022 (or newer) and CMake

This is the way we build and test the framework under Windows.

Visual Studio doesn't require special tricks. See the general instructions for setting up the build.

Windows Subsystem for Linux
  1. Install the Windows Subsystem for Linux. Choose the Ubuntu distribution and install only the command-line.

  2. Update your WSL environment to make sure it's pointing to the latest catalog of software:

    sudo apt update
    sudo apt upgrade
    
  3. Install the developer tools:

    sudo apt install build-essential g++
    sudo apt install cmake
    
  4. Clone Ultra:

    git clone https://github.com/morinim/ultra.git

Now see the general instructions for setting up the build.

MinGW and CMake
  1. Download the full distribution (including git) of MinGW. Install MinGW in a non-system folder (e.g. C:\MinGW\).

  2. Download and install CMake (when asked select the checkbox to add CMake to the system path).

  3. Run CMake:

    cd C:\ultra
    cmake -G "MinGW Makefiles" -B build/ src/
    

    The default generator for Windows is set to NMake. The "MinGW Makefiles" generator produces makefiles that use cmd.exe as shell and don't require a Unix shell (see cmake command line -G option).

Some additional information:

  • the MinGW distribution available at nuwens.net is the suggested one because it's easy to install and always up to date. It's not mandatory: any recent distribution should be enough.
  • if you're experiencing long delays after the make command, try make -r (avoids implicit rules).