Skip to content

0. Preliminaries

Before starting with writing C++ code with have to make sure to set up the basic development environment which allows us to write, compile, and run our code. Furthermore, programming has a lot to do with mathematics. So, we should take a look at basics mathematics and its notions.

Basic Development Environment

The basic toolchain consists of all tools that are needed on a daily basis when programming C++ code. Hence, we should strive for a deep understanding of all those tools. Especially, we should take the time to learn and configure them in a way that will help us to improve our workflow and efficiency when developing applications. Furthermore, after the comprehension of those tools, it would even help us to consider to optimize their interaction processes. Please take a look at the basic toolchain for more information.

Operating System and Shell

In our experience any Linux distribution seems to be a really good candidate. Most Linux distributions are lightweight, easy to install, fast to boot and shutdown, and free to use. With nearly every distribution coding and installing tools can be done without problems. Upgrading and updating a Linux distribution can be done manually. Choosing a specific Linux distribution is a matter of taste. But we recommend one of the following.

  • Ubuntu/Debian-based (Ubuntu, Debian, Mint)
  • Arch-based (Arch, Manjaro)

For Readers using Windows:

For a consistent learning experience, every code snippet will refer to one or more clearly defined Linux distributions. It is possible to do everything in Windows as well. But in our experience, Windows operating systems tend to introduce a major overhead to the development process. Hence, we strongly recommend to use a Linux distribution at least inside a virtual machine. Use the following instructions do set it up.

  1. Download and install VirtualBox for Windows hosts
  2. Download an ISO for Manjaro Gnome (or another Linux distribution of your choice)
  3. Initialize a new virtual machine for a 64bit Arch-Linux
  4. Run the ISO of Manjaro in the new virtual machine and install it
  5. Shutdown the virtual machine and remove the ISO
  6. Restart the virtual machine

You should now have a working Linux system. From this point on, we will only work inside this virtual machine to develop and run the code.

Build Essentials and Version Control

Ubuntu/Debian-based Linux

$ sudo apt-get update && sudo apt-get install build-essential clang cmake git

Arch-based Linux

$ sudo pacman -S gcc clang cmake make git

Build System

The course projects will use the build2 toolchain to build them and manage their dependencies. Please install it by following the installation instructions for UNIX. To be not asked for approval while installing, use the following command instead of the last command given in the instructions. Please, interchange X.Y.Z with the current version of build2.

$ sh build2-install-X.Y.Z.sh --yes --sudo false --no-check --trust yes

Text Editor

To actually write C++ source code, we need a text editor. We recommend to use Sublime Text. The installation instructions for a specific Linux operating system can be found here. Please, choose the appropriate package manager of your operating system and follow the instructions.

Mathematical Background

References


Last update: October 22, 2020