Skip to content

Commit edd76ac

Browse files
committed
Add guide on compiling Qt from sources. Add README.
1 parent e45aeed commit edd76ac

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Knowledge base of the Robotics and AI research group
2+
====================================================
3+
4+
## Installation
5+
Install `mdbook` by downloading it from [here](https://github.com/rust-lang/mdBook/releases). Alternatively, it can be installed using `cargo install mdbook`.
6+
7+
## Usage
8+
Run `mdbook serve` to locally create a web server publishing your changes as you write them. When done, commit the changes and the CI will build and publish the book.

src/SUMMARY.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
- [Introduction](./intro.md)
44
- [Software](./software/intro.md)
5+
- [Qt](./software/qt/intro.md)
6+
- [Qt on Raspberry Pi](./software/qt/raspberry.md)
57
- [Hardware](./hardware/intro.md)
68
- [Arduino](./hardware/arduino/intro.md)
79
- [Arduino Leonardo](./hardware/arduino/leonardo.md)

src/software/qt/intro.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# QT

src/software/qt/raspberry.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Getting Qt to work on Raspberry Pi
2+
3+
## Installing from repositories
4+
5+
## Building from source
6+
This tutorial was inspired by the tutorial [here](https://www.tal.org/tutorials/building-qt-512-raspberry-pi).
7+
We will be using Qt 5.15 and skipping useless modules. Also gamepad and multimedia with GStreamer should be working out of the box.
8+
9+
Install preprequisities by running
10+
```bash
11+
sudo apt-get update
12+
sudo apt-get install git gdb cmake gcc build-essential libfontconfig1-dev libdbus-1-dev libfreetype6-dev libicu-dev libinput-dev libxkbcommon-dev libsqlite3-dev libssl-dev libpng-dev libjpeg-dev libglib2.0-dev libraspberrypi-dev
13+
sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-plugins-bad libgstreamer-plugins-bad1.0-dev gstreamer1.0-pulseaudio gstreamer1.0-tools gstreamer1.0-alsa libasound2-dev pulseaudio libpulse-dev libsdl2-dev libgles2-mesa-dev libgbm-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libx11-dev
14+
15+
Download the sources from [here](http://download.qt.io/official_releases/qt/) in our case we'll be using `wget` and downloading the 5.15.1 version
16+
```bash
17+
wget http://download.qt.io/official_releases/qt/5.15/5.15.1/single/qt-everywhere-src-5.15.1.tar.xz
18+
```
19+
20+
Decompress the archive by running
21+
```bash
22+
tar xf qt-everywhere-src-5.15.1.tar.xz
23+
```
24+
25+
Setup build configurations for the Raspberry Pi
26+
```bash
27+
git clone https://github.com/oniongarlic/qt-raspberrypi-configuration.git
28+
cd qt-raspberrypi-configuration && make install DESTDIR=../qt-everywhere-src-5.15.1
29+
cd ..
30+
```
31+
32+
Prepare the build environment
33+
```bash
34+
mkdir -p build
35+
cd build
36+
PKG_CONFIG_LIBDIR=/usr/lib/arm-linux-gnueabihf/pkgconfig:/usr/share/pkgconfig ../qt-everywhere-src-5.15.1/configure -platform linux-rpi4-v3d-g++ -v -opengl es2 -eglfs -no-gtk -no-xcb -opensource -confirm-license -release -reduce-exports -force-pkg-config -nomake examples -no-compile-examples -skip qtwayland -skip qtwebengine -skip qt3d -skip qtlocation -skip qtscript -skip qtsensors -skip qtserialport -skip qtspeech -skip qtcharts -skip qtvirtualkeyboard -skip qtquick3d -qt-pcre -no-pch -ssl -evdev -system-freetype -fontconfig -glib -prefix /opt/Qt5.15 -qpa eglfs
37+
```
38+
39+
And build it!
40+
```bash
41+
make -j4
42+
sudo make install
43+
```
44+
45+
### Notes
46+
It is recommended to use swap - at least 1 GB.
47+
It is also recommended to use `tmux` for running the build for cases of SSH disconnections.
48+
You should also cool the Raspberry Pi properly, a small fan is enough to lower the CPU temperature by 20 C!.

0 commit comments

Comments
 (0)