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 conda (RECOMMENDED)
Using conda is our recommended way to build and install Vira. We will assume you already have the required system prerequisites.
Setup conda (if you haven’t already):
cd ~ # For Apple Silicon Macs: curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh" chmod +x Miniforge3-MacOSX-arm64.sh ./Miniforge3-MacOSX-arm64.sh # For Intel Macs: curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh" chmod +x Miniforge3-MacOSX-x86_64.sh ./Miniforge3-MacOSX-x86_64.sh
Follow the prompts and ensure you can activate the conda
baseenvironment (You should see a(base)to the left of your username in the terminal)Create the vira_env environment:
conda env create -f dependencies/environment.yml conda activate vira_env
Build:
mkdir build && cd build cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/conda-toolchain.cmake -DCMAKE_BUILD_TYPE=Release ../ cmake --build . -j
OPTIONAL - Installing in conda Environment: Once you have successfully built the project, you can install Vira into your conda environment (while still in the
vira_envenvironment) using:cmake --install .
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.
Setup vcpkg:
git clone https://github.com/microsoft/vcpkg.git ~/vcpkg ~/vcpkg/bootstrap-vcpkg.sh ~/vcpkg/vcpkg integrate install
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.
Install dependencies:
conan install dependencies/conanfile.py --build=missing --output-folder=. cd build
Build:
cmake -DCMAKE_TOOLCHAIN_FILE=./Release/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release ../ cmake --build . -j
Building Using System Libraries (NOT RECOMMENDED)
In the event that you wish to use your system package manager (such as brew) or build the dependencies from source, that should in theory work, however it is not supported (we cannot guarantee to use versions of libraries commonly available on system package managers). You will need to install the following dependencies on your system manually:
Library |
Version |
Description |
|---|---|---|
assimp |
>=5.2,<6.0 |
3D model loading |
cfitsio |
>=3.49 |
FITS I/O |
cspice |
=67 |
NASA SPICE |
embree3 |
>=3.13,<4.0 |
Ray tracing kernels |
fftw |
>=3.3.10,<4.0 |
Fast Fourier Transform |
gdal |
>=3.10,<4.0 |
Geospatial Abstraction |
glm |
>=1.0.1 |
Linear Algebra |
libtiff |
>=4.7.0 |
TIFF I/O |
lz4 |
>=1.9 |
Compression |
tbb |
>=2021.0 |
Intel TBB |
yaml-cpp |
>=0.8.0,<1.0 |
YAML parser |
gtest |
>=1.15,<2.0 |
Google Test (Only required if enabling |
Assuming you have installed these dependencies, the build process will be straight forward. From within the cloned vira repository:
mkdir build
cd build
cmake ../ -DCMAKE_BUILD_TYPE=Release
cmake --build . -j