build - morinim/ultra GitHub Wiki
Build requirements
Ultra is designed to have minimal requirements for building and integrating with your projects, though some dependencies are necessary. Currently, we support Linux and Windows. We will also make our best effort to support other platforms (e.g. macOS, BSD). However, since core members of the Ultra project have no access to these platforms, there may be unresolved issues. If you encounter problems on your platform, please report them via the issue tracker; patches to fix them are especially welcome!
Mandatory
- A C++22-standard-compliant compiler
- CMake
Optional
- Python v3 for additional functionalities
Setting up the build
In most cases, simply running:
cd ultra
cmake -B build/ src/
is sufficient. For more information, refer to the platform specific details sections below.
You can now build the project using the underlying build 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 specify a compiler explicitly, run:
CXX=clang++ cmake -B build/ src/
Windows
Prerequisites
There are many possibilities:
Visual Studio 2022 (or newer) and CMake
This is our preferred method for building and testing Ultra on Windows.
Visual Studio does not require any special setup beyond the general instructions above.
Windows Subsystem for Linux
-
Install the Windows Subsystem for Linux, preferably with the Ubuntu distribution.
-
Update your WSL environment:
sudo apt update sudo apt upgrade -
Install the development tools:
sudo apt install build-essential g++ sudo apt install cmake -
Clone the Ultra repository:
git clone https://github.com/morinim/ultra.git
Follow the general instructions for building the project.
MinGW and CMake
-
Download and install a full MinGW. Install it in a non-system folder (e.g.
C:\MinGW\). -
Download and install CMake. During installation, ensure you check the option to add CMake to the system PATH.
-
Download and install Git (if not already installed).
-
Run CMake:
cd C:\ultra cmake -G "MinGW Makefiles" -B build/ src/Note: the default generator for Windows is set to
NMake. The"MinGW Makefiles"generator produces makefiles that usecmd.exeas shell and don't require a Unix shell (see cmake command line-Goption).
Additional tips:
- we recommend the MinGW distribution available at nuwens.net, which is easy to install and kept up to date. However, any recent MinGW distribution should work.
- if you experience long delays when running
make, trymake -r(avoids implicit rules).
WinLibs and CMake
-
Download the full distribution of Winlibs and install it in a non-system folder (e.g.
C:\WinLibs\). -
Download and install CMake. make sure to enable the option to add CMake to the system PATH.
-
Download and install Git (if not already installed).
-
Run the standard build setup:
cd ultra cmake -B build/ src/ cmake --build build/Note: this method works similarly to the general instructions and does not require special generators or Unix shells.