Skip to content

Building MAGE

Sam Kumar edited this page Apr 2, 2021 · 7 revisions

MAGE is written in C++20. To build it, use g++ version 9 or clang++ version 6 or later.

Attention OSDI 2021 artifact reviewers: To reproduce our results, you'll need to follow the README in the mage-scripts repository. To avoid the hassle of setting up a build environment locally, you're encouraged to use the magebench.py script provided in that repository to create Azure instances with a build environment for MAGE ready to go. To do so, run ./magebench.py spawn -a 1 to create a single Azure instance with the appropriate environment. SSH into the created machine; in the ~/work/mage directory, you'll find the contents of this repository. In this directory, running make should just work. When you're done for the day, remember to run ./magebench.py deallocate to deallocate the Azure instance. See the README in the mage-scripts repository for more details. If you use an Azure instance managed by magebench.py, then feel free to skip to the next page. You don't need to install dependencies as described below. Just check that running make works as expected.

Building MAGE on Ubuntu

I've tested this on Ubuntu 16.04 and Ubuntu 20.04. On Ubuntu 16.04 you'll need to manually install the above compilers; for Ubuntu 20.04, the pre-installed compilers should work fine.

First, install the dependencies as follows:

  1. Run apt install build-essential clang cmake libssl-dev libaio-dev.
  2. Install version 0.63 of the the yaml-cpp library (https://github.com/jbeder/yaml-cpp), using the -DYAML_BUILD_SHARED_LIBS=ON option when running cmake.
  3. Install the tfhe library (https://github.com/tfhe/tfhe).
  4. Install version 3.6.0 of the Microsoft SEAL library (https://github.com/Microsoft/SEAL), using the -DSEAL_USE_ZLIB=OFF -DBUILD_SHARED_LIBS=ON option when running cmake.
  5. You may need to run sudo ldconfig to refresh the shared library cache.

Once you've done this, you should be able to run make. Running make will produce a new directory called bin/, and a set of executables (including mage, planner, and disassemble) will be in that directory. If you see these executables and they run without crashing, then you've built MAGE successfully.

Not on Ubuntu?

You're welcome to try adapting the above build procedure to the particular system that you're using. If you're on the OSDI 2021 AEC, then see the note at the top of this page. It's likely that I'll also put together a Docker image with the appropriate build environment in the near future.

Clone this wiki locally