Skip to content

RustSetup

Anson edited this page Jan 8, 2026 · 1 revision

How to use Gravity with rust

Using rust with gravity is a different but straightforward process. Right now, it is currently only available to be added from a git repository here.

Simply add this repository to the dependencies section in your Cargo.toml and cargo will automatically build gravity for you.

In order for the build to be successful, you must download cmake (version 3.17 or later), but not version 4.xx or later since Gravity does not support this.

You also must have bison, flex, and a C++ compiler (i.e. g++).

You can follow the first step of the Linux cmake instructions to do this, although you only need the bison and flex from the list.

Linux cmake instructions

This was tested on a fresh Ubuntu 18 VM, after just installing cmake 3.22 from cmake.org. The '$' represents a command prompt.

  • $ sudo apt-get install default-jdk python python-dev python-setuptools bison flex swig build-essential

Clone this wiki locally