[[PageOutline]] = Toolchains installation = 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. 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. __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) == You need at least this one, as it used for compiling FlairGCS and other tools. {{{ $ cd ~ $ wget https://uav.hds.utc.fr/src/toolchain/x86_64-meta-toolchain-flair-x86_64.sh $ chmod +x x86_64-meta-toolchain-flair-x86_64.sh $ sudo ./x86_64-meta-toolchain-flair-x86_64.sh $ rm x86_64-meta-toolchain-flair-x86_64.sh }}} == Cross toolchain for armv7a-neon (ardrone2, bebop, hds x8) == {{{ $ cd ~ $ wget https://uav.hds.utc.fr/src/toolchain/x86_64-meta-toolchain-flair-armv7a-neon.sh $ chmod +x x86_64-meta-toolchain-flair-armv7a-neon.sh $ sudo ./x86_64-meta-toolchain-flair-armv7a-neon.sh $ rm x86_64-meta-toolchain-flair-armv7a-neon.sh }}} == Cross toolchain for armv5e (mambo) == {{{ $ cd ~ $ wget https://uav.hds.utc.fr/src/toolchain/x86_64-meta-toolchain-flair-armv5e.sh $ chmod +x x86_64-meta-toolchain-flair-armv5e.sh $ sudo ./x86_64-meta-toolchain-flair-armv5e.sh $ rm x86_64-meta-toolchain-flair-armv5e.sh }}} == Setup files == 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'' 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 == 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 }}} 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.