A cross toolchain is needed to compile on your computer a program for a target (different achitecture). A toolchain is needed to compile on your computer programs for your computer.
A cross toolchain is needed to compile on your computer a program for a target (different architecture). A toolchain is needed to compile on your computer programs for your computer.
All toolchains/cross toolchains only supports x86_64 hosts (32 bits hosts are not supported).
Toolchains have been built with [https://github.com/2rm-robotics/robomap3-rt robomap3] project, based on poky. They package everything you need for flair.
Toolchains have been built with [robomap3](https://github.com/2rm-robotics/robomap3-rt) project, based on poky. They package everything you need for flair.
__NOTE__: for sake of simplicity, the word compilation can be used in this documentation for both cross compilation and compilation
**NOTE**: for sake of simplicity, the word compilation can be used in this documentation for both cross compilation and compilation
== Toolchain for x86_64 (mandatory) ==
# Toolchain for x86_64 (mandatory)
You need at least this one, as it used for compiling FlairGCS and other tools.
Each toolchain install 2 important files needed for compilation:
*''environment-setup-arch-poky-linux-gnueabi'': a script to source if you need to compile something manually, without CMake. For example ''/opt/robomap3/2.1.3/armv5te/environment-setup-armv5e-poky-linux-gnueabi''
*''toolchain.cmake'': a file used by CMake to get all information needed to compile with this toolchain. For example ''/opt/robomap3/2.1.3/armv5te/toolchain.cmake''
**environment-setup-arch-poky-linux-gnueabi*: a script to source if you need to compile something manually, without CMake. For example */opt/robomap3/2.1.3/armv5te/environment-setup-armv5e-poky-linux-gnueabi*
**toolchain.cmake*: a file used by CMake to get all information needed to compile with this toolchain. For example */opt/robomap3/2.1.3/armv5te/toolchain.cmake*
The first one can be used to compile a kernel for example. The second one is needed for each CMake project, but is automatically used by the [wiki:compile_all#Helperscripts helper scripts], so you should not have to bother with it, unless you want to build a CMake project not in the flair build system.
== Environment variable ==
# Environment variable
Toolchain installation scripts add variables in *.bashrc*. If you need to use it directly in the same terminal or an already opened one, reload your *.bashrc*
Toolchain installation scripts add variables in ''.bashrc''. If you need to use it directly in the same terminal or an already opened one, reload your ''.bashrc''
{{{
$ source ~/.bashrc
}}}
`$ source ~/.bashrc`
These variables are:
* ''OECORE_CMAKE_TOOLCHAINS'': a list of installed toolchains (for example ''core2_64 armv7a_neon armv5te'')
* ''OECORE_CMAKE_arch_TOOLCHAIN'': where ''arch'' is from the previous list (for example ''OECORE_CMAKE_CORE2_64_TOOLCHAIN''). Location of the ''toolchain.cmake'' file for a specific architecture
* ''OECORE_HOST_SYSROOT'': used by ground control station to retrieve maps provider plugins (for gps)
* ''OECORE_HOST_NATIVE_SYSROOT'': used to retrieve host's cmake and doxygen tools.
\ No newline at end of file
**OECORE_CMAKE_TOOLCHAINS*: a list of installed toolchains (for example ''core2_64 armv7a_neon armv5te'')
**OECORE_CMAKE_arch_TOOLCHAIN*: where ''arch'' is from the previous list (for example *OECORE_CMAKE_CORE2_64_TOOLCHAIN*). Location of the ''toolchain.cmake'' file for a specific architecture
**OECORE_HOST_SYSROOT*: used by ground control station to retrieve maps provider plugins (for gps)
**OECORE_HOST_NATIVE_SYSROOT*: used to retrieve host's cmake and doxygen tools.