Skip to content
Kolja Dummann edited this page Feb 9, 2017 · 9 revisions

Building mbeddr is pretty easy. It requires only a working Java 8 installation on your machine. Except, if you want to build and run the tests, but more on that later.

After cloning the repository, the only thing you need to do is to run:

# on Mac/Linux
./gradlew

# on Windows
gradlew.bat

This will start the build; it will build the complete mbeddr platform and the mbeddr C languages on top of it. It will NOT run any of the tests!

Setting up your local MPS

As you might have noticed, the build will download its own MPS version to run the build. It will not touch any of your locally installed MPS version(s), unless you tell it to do so.

In order to use mbeddr, some plugins need to be deployed into your local MPS.

To do so you need to run:

# On Mac/Linux
./gradlew install "-PMPS_Installation=<path to MPS>"
# Don't forget that on MAC this has to point to the Contents subdirectory instead of the MPS.app directory!

# On Windows
gradlew.bat install "-PMPS_Installation=<path to MPS>"

Currently, this will rebuild some of the plugins no matter whether they have been built before or not, and it takes about 4 minutes.

Installing additional tools

Running tests and using all of mbeddr like the debugger and Makefile execution requires some additional tools. There are different ways to get theses tool depending on the platform that you work on. We currently officially support Windows and macOS. Linux support is provided on a best effort basis (Pull requests are always welcome!). On Linux, simply use the normal way of your distribution to install the tool mentioned above.

Windows

If you have already used mbeddr with the Windows installer the only thing you need to install is ant!

We recommend to use mingw to install the needed tools. The packages to install are as follows:

  • mingw32-gcc (v 4.8.1)
  • mingw32-make (v 3.82.90-2)
  • mingw32-gdb (v 7.6.1)
  • msys-base (v 2013072300)
  • msys-coreutils (v 5.97-3)

Additionally, you will need to install Ant and Graphviz

macOS

On macOS, you will need XCode, which you can get for free from Apple. After you have download it, you need to run the following command to install the command line tools:

xcode-select --install

This will download some additional components and install them.

To install our other dependencies (like Ant), we recommend to use Homebrew.

You will need to install these packages:

  • ant
  • graphviz

Unfortunately, you can't use the GDB version that homebrew would install out of the box because we rely on a specific version on macOS. But, we provide a custom repository for homebrew that will allow you to install it:

brew tap mbeddr/mbeddr
brew update
brew install gdb76

** homebrew will print some additional instructions to be performed, please follow them otherwise GDB will not work and mbeddr will not be able to debug!**

Running tests

To run all of the tests, especially the analyses tests, you will need CBMC as a additional tool. CBMC can be obtained from here.

After CBMC has been installed, run the tests with the following commands:

# On macOS/Linux
./gradlew test_mbeddr

# On Windows
gradlew.bat test_mbeddr

These commands will build and execute all mbeddr tests on the particular platform.

Tool versions

The minimum versions of the required tools are as follows. Beware that this default list may slightly differ based on platform-specific requirements (see above).

  • Ant: 1.9
  • CBMC: 5.6
  • GCC: 4.8
  • GDB: 7.6
  • Graphviz: 2.30
  • Java: 1.8
  • Make: 3.81
  • MPS: 3.4.3