Advanced Operating Systems (LV 7680)
seL4 Build Dependencies
The following instructions describe how to set up the required dependencies on your local OS. This page assumes you are building in a Linux OS. We however encourage site contributions for building in alternative OSes (e.g. macOS).
To build seL4-based projects, ensure you have installed the dependencies described in the Base Build Dependencies and Python Dependencies sections below.
Base Build Dependencies
To establish a usable development environment it is important to install your distributions basic build packages.
Ubuntu
The following instructions cover the build dependencies tested on Ubuntu 18.04 LTS. Note that earlier versions of Ubuntu (e.g. 16.04) may not be sufficient for building as some default development packages are stuck at older versions (e.g CMake 3.5.1, GCC 5.4 for 16.04). As dependencies and packages may be frequently changed, deprecated or updated these instructions may become out of date. If you discover any missing dependencies and packages we welcome new contributions to this page.
The basic build package on Ubuntu is the build-essential
package. To install run:
sudo apt-get update
sudo apt-get install build-essential
Additional base dependencies for building seL4 projects on Ubuntu include installing:
sudo apt-get install cmake ccache ninja-build cmake-curses-gui
sudo apt-get install python-dev python-pip python3-dev python3-pip
sudo apt-get install libxml2-utils ncurses-dev
sudo apt-get install curl git doxygen device-tree-compiler
sudo apt-get install u-boot-tools
sudo apt-get install protobuf-compiler python-protobuf
To build for ARM targets you will need a cross compiler. In addition, to run seL4 projects on a simulator you will need qemu
. Installation of these additional base dependencies include running:
sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
sudo apt-get install qemu-system-arm qemu-system-x86 qemu-system-misc
(you can install the hardware floating point versions as well if you wish)
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
Note that we require a minimum CMake version of 3.12.0 while Ubuntu 18.04 contains 3.10.2. In order to correct this, a custom installation of CMake may be required. If that is the case, you can install cmake directly from its home page, e.g.
Uninstall any stale cmake package:
sudo apt-get remove cmake
Download this self-extracting file
Make it executable:
chmod +x cmake-3.17.0-Linux-x86_64.sh
Run it to extract it (accept the license):
sudo ./cmake-3.17.0-Linux-x86_64.sh
Install everything under
/usr/local
cd cmake-3.17.0-Linux-x86_64 cd sudo tar cf - . | (cd /usr/local;sudo tar xvf -)
CMake should now be unter /usr/local/bin
, which should be in your $PATH
$ which cmake
/usr/local/bin/cmake
$ cmake --version
cmake version 3.17.0
CMake suite maintained and supported by Kitware (kitware.com/cmake).
Debian
For Debian Buster or later, the dependencies listed above for Ubuntu will work for a Debian installation.
For Debian stretch, well you can get this to run on Debian Stretch (I did!), but this will not be easy.
- The version of
cmake
in Debian stretch is way too old to build seL4 projects. - The Python3 environment is too old (3.5): must be >= 3.6.
- The ARM cross compiler toolchain is too old: gcc must be >= version 8.
None of these packages is currently available on stretch-backports, so you must find them somewhere else.
- For
cmake
see the instructions above - For Python 3.6, see for example here
- For gcc-8, you can try your luck here
Just for reference, here are some generic instructions to install a package
from stretch-backports:
Add the stretch-backports repository like this (substitute a local mirror for ftp.debian.org
if you like)
sudo sh -c "echo 'deb http://ftp.debian.org/debian stretch-backports main' > /etc/apt/sources.list.d/backports.list"
Then install package
with
sudo apt-get update
sudo apt-get -t stretch-backports install package
Devuan Linux (32-bit)
Devuan is a fork of Debian using the traditional SysVinit system rather than systemd. I'm using the 32-bit version on one of my older PCs and, surprisingly, the 3.0 Release (codenamed Beowulf) works out of the box.
Other Linux
Sorry, you're on your own. It may be easier for you to use the Virtualbox image.
Python Dependencies
Regardless of your Linux distribution, python dependencies are required to build seL4 and the manual. To install you can run:
pip3 install --user setuptools
pip3 install --user sel4-deps
Currently we duplicate dependencies for python2 and python3 as a python3 upgrade is in process
pip install --user setuptools
pip install --user sel4-deps
We need at least version 5.1 of Package PyYAML, to check:
pip3 list | grep PyYAML
pip list | grep PyYAML
To update (if necessary):
pip3 install -U PyYAML
pip install -U PyYAML
(Some distributions use pip
for python3 and pip2
for python2; others use pip
for python2 and pip3
for python3. Use the Python 3 version for your distribution)