-
Notifications
You must be signed in to change notification settings - Fork 2
/
BUILD-HOWTO
64 lines (43 loc) · 3.01 KB
/
BUILD-HOWTO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
INTRODUCTION
------------
This file describes what tools you need to build this prototype software synthesiser for Raspberry Pi, and how to perform the build.
The current version of the cmake script does not perform full configuration of the build, nor does it check for dependencies.
Hopefully this document should give you the information you need to get those dependencies; at some time in the future the build script should be made more capable to address this.
REQUIRED TOOLS
--------------
* cmake 2.8.x.
* Either native gcc and build essentials on Pi, or Pi-compatible ARM gcc cross compiler.
* git (to obtain some Pi specific files).
DEPENDENCIES
------------
The following libraries are required - either natively installed on the Pi, or in a Pi root file system copy on a cross-compilation machine.
They should be installable using packages from the Raspbian repositories. Make sure you install the actual package and any "dev" package.
You can use http://www.debian.org/distrib/packages to search for the package names, or use the suggested ones below:
* libasound2
* libpng12
* libconfig9
* libsndfile1
* libexpat1
* liblog4c3
You will need to obtain a build of Wiring Pi (used for PiGlow support): see http://wiringpi.com/download-and-install. If you are cross compiling the Pithesiser, I recommend you get and build Wiring Pi on a Pi, then copy across the headers and libraries to your cross-compilation environment.
The Google perf tools are used for profiling; a build of the library that works on Pi is included in the Pithesiser repository.
The Pi userland source files are also needed - these can be obtained from the Pi GitHub (https://github.com/raspberrypi/userland)
BUILDING ON A PI
----------------
In this package's source directory, run the following:
USERLANDPATH=<path-to-pi-userland-source-files> cmake .
make
For example, assuming that the userland source files have been cloned via git into the default user's home directory:
USERLANDPATH=/home/pi/userland cmake .
make
CROSS-COMPILING
---------------
You'll need an ARM cross compilation toolchain that supports the Pi's ARM architecture - you could get that from the Pi GitHub (https://github.com/raspberrypi/tools) into the local folder /opt/cross/Pi.
You'll also need a copy of /lib, /opt and /usr from the Pi's Raspbian root file system with the above dependencies installed - rsync is good to use for copying these, but may take some time.
Cross-compilation requires some additional environment variables to be provided when cmake is run:
TOOLPREFIX ARM cross-compiler tool name prefixes - e.g. arm-linux-gnueabi-hf-
TOOLPATH Path to cross compiler root - e.g. /opt/cross/Pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian
ROOTFSPATH Path to copy of Pi root file system on cross compilation system, e.g. /opt/cross/Pi/rootfs
So an example execution might be:
USERLANDPATH=/home/pi/userland TOOLPREFIX=arm-linux-gnueabi-hf- TOOLPATH=/opt/cross/Pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian ROOTFSPATH=/opt/cross/Pi/rootfs cmake .
make