Prerequisites

Before you can start working on your first simulator, there are a few things you need to do.

Install Bazel

MPACT-Sim uses the Bazel build system version 6.1.1, so in order to work through the tutorials, you need to install Bazel. The easiest way to install and manage bazel is to install Bazelisk, which is a wrapper for Bazel written in Go. Installation instructions are provided at its github site.

Install Git

The MPACT-Sim infrastructure and tutorials is hosted on github.com, so a working installation of git is required. Any reasonable version of git should work, so choose the one that is suitable for your system.

If you don't already have git, and you are on linux, you you can usually install git from the command line as follows:

$ sudo apt-get update
$ sudo apt-get install git

On other systems you can download an installer from git downloads.

Download MPACT-Sim tutorials repository

All the code needed for these tutorials are contained in the github mpact-sim-codelabs repository. Clone this repository using the command: git clone https://github.com/google/mpact-sim-codelabs.

To verify that all is working properly, change to the mpact-sim-codelabs directory and type in the command bazel build ...:all. This will download all required dependencies and build every target. The first time around this will take a few minutes, but the results are cached, and subsequent builds will finish much more quickly. The command will print out progress, including DEBUG messages and a couple of compiler warnings. The last part of the output should look similar to:

INFO: Elapsed time: 308.268s, Critical Path: 279.57s
INFO: 991 processes: 314 internal, 677 linux-sandbox.
INFO: Build completed successfully, 991 total actions