Artifact 8ae54b257135e791a9200048126897a07bd63446:
Wiki page
[
Build instructions] by
schelte
2018-02-03 12:46:21.
D 2018-02-03T12:46:21.688
L Build\sinstructions
N text/x-markdown
P b4fa652d3df9bd4c1ea0c827004d5ec78afe6af9
U schelte
W 1755
# Build instructions #
## Regular build ##
To be able to build the library on a Raspberry Pi itself, you need to do the following:
- Install the packages tcl8.5-dev, libi2c-dev, and autoconf, if necessary: `sudo apt-get install tcl8.5-dev libi2c-dev autoconf`
- Download the [piio sources](http://chiselapp.com/user/schelte/repository/piio/tarball/piio.tar.gz).
- Unpack the tarball: `tar xvf piio.tar.gz`
- Go to the source directory: `cd piio`
- Get the standard tclconfig files: `wget -qO- http://core.tcl.tk/tclconfig/tarball/tclconfig.tar.gz | tar xzv`
- Create the configure script from configure.in: `autoconf`
- I prefer to build in a separate directory: `mkdir build;cd build`
- Run configure: `../configure --with-tcl=/usr/lib/tcl8.5`
- Build the library: `make`
- Optionally install it: `sudo make install`
## Cross compiling ##
Compiling on the Raspberry Pi itself is slow. Since the code of the piio library isn't very big, it's not a big problem. But of course, it's also possible to cross compile the library on a more powerful linux system. To do that, you need a cross compile environment. One way to create that is using [the build-cc script](http://build-cc.rkeene.org/). Make sure you have installed all necessary development packages before running the script.
You'll also need a stubs library compiled for a Raspberry Pi. You can generate that by cross compiling Tcl first.
Next, run the following commands:
wget -qO- http://core.tcl.tk/tclconfig/tarball/tclconfig.tar.gz | tar xzv
autoconf
mkdir build
cd build
eval $(~/root/cross-compilers/setup-cc armv6-hardfloat-linux-gnueabi)
../configure -host=armv6-hardfloat-linux-gnueabi --with-tcl=~/rpi/tcl8.5.15/build
make
Z 058c776e4b7cf7e5880f2efd49896e80