Introduction
Integrated Solutions
- Custom Development
This page will demonstrate how to compile the Windows libraries, and how to cross-compile the Raspberry Pi libraries from a Windows machine.
These are all the packages needed for Linux
sudo apt update sudo apt install build-essential gcc-10 g++-10 cmake ninja-build -y
These are all the packages needed for Raspberry Pi
sudo apt update sudo apt install gcc g++ cmake ninja-build -y
Also set the correct paths to gcc and g++ in the CMAKE_RASPBERRY_PI_TOOLCHAIN_FILE:
SET(CMAKE_C_COMPILER /path/to/toolchains/cross-pi-gcc-10.2.0-2/bin/arm-linux-gnueabihf-gcc) SET(CMAKE_CXX_COMPILER /path/to/toolchains/cross-pi-gcc-10.2.0-2/bin/arm-linux-gnueabihf-gcc)
git clone --recursive https://github.com/DephyInc/FlexSEA.git
cd FlexSEA
git submodule update --init --recursive flexsea-core flexsea-dephy fx_plan_stack Actuator-Package plan
cd flexsea-dephy && git checkout && cd .. cd flexsea-core && git checkout && cd .. cd Actuator-Package && git checkout && cd ..
cd fx_plan_stack && ./stack_builder.sh
[65/66]Linking CXX static library libs\libfx_plan_stack_static.a [66/66] Linking CXX shared library libs\libfx_plan_stack.dll
sudo apt-get update sudo apt-get install dos2unix sudo dos2unix <path_to_stack_builder.sh>
./stack_builder.sh
sudo ./stack_builder.sh
./stack_builder.sh -pi
[65/66]Linking CXX static library libs\libfx_plan_stack_static.a [66/66] Linking CXX shared library libs\libfx_plan_stack.so
If you wish to build a plan stack with debug info you can add one of these to the CMakeLists.txt:
set(CMAKE_BUILD_TYPE DEBUG)
set(CMAKE_BUILD_TYPE RELWITHDEBINFO)
To enforce release build:
set(CMAKE_BUILD_TYPE RELEASE)
python fxMain.py
It is possible to use CLion for your fx_plan_stack development. As of now, it supports file navigation and syntax highlighting, as well as basic compilation.
FlexSEA
and to open FlexSEA\fx_plan_stack
as your project.You can now use CLion as your IDE. As a quick test, open src/device.cpp. Ctrl+click on circ_buff_init() as a test; it will bring you to the flexsea-comm submodule.
Build and release configurations should be available automatically:
Selecting fx_plan_stack and clicking build will compile your libraries.
Please keep in mind that stack_builder.sh
does more than simply compile: it moves necessary files to where they belong. Exercise caution if you decide to build with CLion.
To be succinct, this section will only cover the differences compilation and cross compilation. For more detailed instructions on compilation, read the previous section.
To cross compile, you will need to have installed and configured the appropriate cross-compiler. Here are the cross compilers for:
After installing these toolchains, the appropriate toolchain file must be used. This file specifies where the toolchain is located and other build settings. These can be found in the git repositories root directory and are specific to the target system.
For the Raspberry Pi Toolchain for Unix systems, the appropriate toolchain path is
${source_folder}/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
Note: Make sure the paths in these files are correct.
To use the toolchain with an existing Cmake list, just add the DCMAKE_TOOLCHAIN_FILE flag.
cmake .. -DCMAKE_TOOLCHAIN_FILE=CMAKE_RASPBERRY_PI_TOOLCHAIN_FILE ${OTHER_FLAGS}
There are also batch files (i.e. cross_compile_RPI.bat) that automate the build process.
Notes:
cmake ..
call
cmake .. -G "MinGW Makefiles"