Skip to main content

Getting Started

This page guides you through the process of building Momentum and running the examples.

Installing Momentum and PyMomentum

Momentum binary builds are available for Windows, macOS, and Linux via Pixi or the Conda package manager.

Pixi

# Momentum (C++)
pixi add momentum-cpp

# PyMomentum (Python)
pixi add pymomentum

# Both
pixi add momentum

Conda

conda install conda-forge::momentum-cpp
conda install conda-forge::pymomentum
conda install conda-forge::momentum

Micromamba

micromamba install -c conda-forge momentum-cpp
micromamba install -c conda-forge pymomentum
micromamba install -c conda-forge momentum

Building Momentum from Source

Prerequisite

Complete the following steps only once:

  1. Install Pixi by following the instructions on https://prefix.dev/

  2. Clone the repository and navigate to the root directory:

    git clone https://github.com/facebookincubator/momentum
    cd momentum

    Ensure that all subsequent commands are executed in the project's root directory unless specified otherwise.

Build and Test

  • Build the project with the following command (note that the first run may take a few minutes as it installs all dependencies):

    pixi run build
  • Run the tests with:

    pixi run test

To view all available command lines, run pixi task list.

Hello World Example

To run the hello_world example:

pixi run hello_world

Alternatively, you can directly run the executable:

# Linux and macOS
./build/hello_world

# Windows
./build/Release/hello_world.exe

Running Other Examples

To run other examples:

pixi run glb_viewer --help

For more examples, please refer to the Examples page.

Clean Up

If you need to start over for any reason:

pixi run clean

Momentum uses the build/ directory for CMake builds, .pixi/ for the Pixi virtual environment, and .deps/ for building dependencies. You can clean up everything by either manually removing these directories or by running the command above.