User Tools

Site Tools


getting_started:host_and_target

This is an old revision of the document!


Host and Target

It is important to distinguish between the machine where the development is done (the host) and the machine where the program will be running (the target). These two can be the same but very often you write the program on one machine and execute it on another. And very often the target machine is not identical to the host machine, which means that the program cannot be simply copied from the host to the target. If the architecture of target and host don't match, cross compilation is necessary.

Find the Architecture of your Machine

On a Linux system the following command displays the hardware plattform of your machine:

$ uname -i

On a PC the result is usually:

x86_64

On the target machine it's probably different. Some examples are: x86, x86_64, armv7l, powerpc, …

Cross Compilation

A compiler that runs on one plattform and generates code for another plattform is called a cross compiler . A cross compiler can be obtained from the official package repositories of your Linux distribution or from third party sources.

EEROS uses CMake to build the code. By default CMake does not use a cross compiler. To tell CMake to use a cross compiler you have to supply the CMAKE_TOOLCHAIN_FILE option when generating the build files:

$ cmake -DCMAKE_TOOLCHAIN_FILE=path/to/toolchain-file.cmake path/to/source/directory

An example of a toolchain file can be found on the github page of the EEDURO project: https://github.com/eeduro/eeduro-scripts/blob/master/toolchain.cmake

getting_started/host_and_target.1443880694.txt.gz · Last modified: 2015/10/03 15:58 by abajric