MacOS build Instructions

Contents:


Prerequisites

  • Compiler: C++20 support required

    • macOS: Xcode 12+ or Clang 10+

  • Git: Any recent version

  • CMake: 3.16 or newer

  • pkg-config: Library configuration tool

If you do not have these on your system, you can install them with:

# Install Xcode Command Line Tools (includes git, clang):
xcode-select --install

# Install CMake and pkg-config via Homebrew:
brew install cmake pkg-config

Note For conda Users: If you use the conda environment approach described below (recommended) you can install many of these prerequisites using conda instead of your system package manager (which often requires sudo access). While it is preferred to use the system compilers, if you do not have access, you can install them into the vira_env environment (see Building Using conda) using:

conda install -c conda-forge cmake git pkg-config cxx-compiler make


Building Using vcpkg

vcpkg is a free open source package manager available on Windows, Linux, and MacOS. vcpkg builds libraries from source and so first time builds of Vira can seem excessive if using vcpkg. We will assume you already have the required system prerequisites.

  1. Setup vcpkg:

    git clone https://github.com/microsoft/vcpkg.git ~/vcpkg
    ~/vcpkg/bootstrap-vcpkg.sh
    ~/vcpkg/vcpkg integrate install
    
  2. Build:

    mkdir build && cd build
    cmake -DCMAKE_TOOLCHAIN_FILE=~/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release ../
    cmake --build . -j
    

Building Using conan

conan is a free and open source package manager available on Windows, Linux, and MacOS. We do NOT regularly test builds with this but provide some basic support because we recognize some teams use conan for package management. We will assume you already have the required system prerequisites, and that you already have conan setup.

  1. Install dependencies:

    conan install dependencies/conanfile.py --build=missing --output-folder=.
    cd build
    
  2. Build:

    cmake -DCMAKE_TOOLCHAIN_FILE=./Release/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release ../
    cmake --build . -j