FlexSEA Wiki

A WEARABLE ROBOTICS TOOLKIT

User Tools

Site Tools


build_fx_plan

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
build_fx_plan [2019/01/23 16:21]
flabelle
build_fx_plan [2019/07/25 16:21] (current)
jfduval [How to build the libraries]
Line 1: Line 1:
-===== Building from Source ​=====+====== Building ​fx_plan_stack ​from sources ======
  
 +===== Requirements =====
 +  * Git (version >= 1.47, we recommend using the latest stable version available on your platform)
 +  * Bash (Git bash works on Windows , just make sure it is the default to run .sh files)
 +  * CMake (version >= 3.13, can be either 32 or 64 bit version based on your system'​s [[https://​support.microsoft.com/​en-us/​help/​827218/​how-to-determine-whether-a-computer-is-running-a-32-bit-version-or-64|architecture]] )
 +    * Get the latest version of[[https://​cmake.org/​download/​ | CMake]] and add it to your path.
 +  * Ninja (version >= 1.3, can be either 32 or 64 bit version based on your system'​s [[https://​support.microsoft.com/​en-us/​help/​827218/​how-to-determine-whether-a-computer-is-running-a-32-bit-version-or-64|architecture]]) ​
 +    * We use version 1.90, which can be found at [[https://​github.com/​ninja-build/​ninja/​releases]]
 +  * GCC 7.3
  
-=====Tools required===== 
-Before you start, install the following tools: 
  
-__Ubuntu:​__ +===== Setup =====
-  * CMake +
-  * git +
-  * g++ (should come pre-installed) +
-  * python3 (32 / 64 bit should match your g++ version. default is 32 bit)+
  
-__Windows:__ +  - Start by installing[[https://​cmake.org/​download/​ | CMake]] 
-  CMake (Note: Do not use Cygwin'​s CMake) +    * Note the install path, you will need to add it to the PATH later. 
-  ​* git +  ​- Next install GCC. Get a mingw64 installer from [[https://​sourceforge.net/​projects/​mingw-w64/​ |source forge]]. 
-  MinGW_w64 (install ​the 32 bit version) +    Use the following setting when installing mingw64 {{gcc7_3_install.png}}. 
-  python3 ​(32 bit version+    Note the installation path and navigate to it. Go into the mingw32 folder and then the bin folder. Note this path, you will need to add it to the PATH later. That path should look like this: C:\Program Files (x86)\mingw-w64\i686-7.3.0-posix-dwarf-rt_v5-rev2\mingw32\bin 
- +  - Next install ninja 
-Here are detailed instructions on how to [[installbuildtoolswindows|install ​the build tools on Windows]].+    - Get the latest ​[[https://​github.com/​ninja-build/​ninja/​releases ​release]] (We use 1.90) and download it 
 +    - Unzip the file 
 +    - Place it the folder containing the ninja executable to your program files directory ​on Windows ​or your /usr/bin/ directory on Linux {{2019-04-03_14_05_00-c__program_files_ninja-win.png}} 
 +    - Add it to your path, this allows you to access any executables (such as Ninja, CMake and GCC) from the command line 
 +      - On Windows this is done using the advanced setting in the environment variables {{path.png}} 
 +      -  Navigate to advanced settings and select environment variables {{system_properties.png}}  
 +      -  Select the PATH variable in system variables {{env_variables.png}} 
 +      -  Then add the paths from the previous installs {{add_path.png}} (note: MingW is not visible in the screenshot, but it needs to be listed)
  
 =====How to build the libraries===== =====How to build the libraries=====
-These instructions are for compiling the libraries for your system. To cross compile, read the section [[build_fx_plan#​How to cross-compile the libraries|below]].  +  ​From your gitBash console 
- +  - Start from a fresh version of Plan GUI <​code>​ git clone --recursive ​https://​github.com/​DephyInc/​plan_3_0.git </​code>​ 
-First, navigate to an empty directory where you will clone the git. +  Change directory to the cloned Plan GUI repo <​code>​ cd plan_3_0</code> 
- +  ​Make sure all your submodules are up to date <​code> ​git submodule update --init ​--recursive ​</code> 
-**Clone the code repositories:​** +  - Change directory into fx_plan_stack and run stackBuilder.sh <​code>​ cd fx_plan_stack && ./stack_builder.sh && cd ..</code> 
-<​code>​ +  ​A successful build will print a message similar to <​code>​[83/​84] Linking CXX static library libs\libfx_plan_stack_static.
-git clone https://​github.com/​DephyInc/​serial.git +[84/84] Linking CXX shared library libs\libfx_plan_stack.dll
-git clone --recursive https://github.com/​DephyInc/​FlexSEA-Stack-SharedLib.git +
-git clone --recursive ​https://github.com/DephyInc/​Actuator-Package.git+
 </​code>​ </​code>​
  
-**Compile the serial library:** +Noteassuming that you have added your variables ​to the path, mentions of missing compilers ​can typically ​be resolved by restarting your computer.
-<​code>​ +
-cd serial +
-git checkout dev +
-mkdir build && cd build +
- +
-cmake .. #See note 1) +
-make #See note 2) +
-</​code>​ +
- +
-**Compile FlexSEA-Stack-SharedLib (see note 3):** +
-<​code>​ +
-cd ../​../​FlexSEA-Stack-SharedLib +
-mkdir build && cd build +
-cmake .. +
-make +
-</​code>​ +
- +
-The libraries are built in either a '​win'​ directory on windows or a '​unix'​ directory on unix. Copy the libraries from the build directory ​to the folder where they'​ll be used. You can do that graphically,​ or via command line. The libserialc.a and libFlexSEA-Stack-Plan.a libraries must be in the fx_plan_stack\lib folder. +
- +
-<​code>​ +
-cp serial/​build/​unix/​libserialc.a Actuator-Package/​fx_plan_stack/​lib/​ +
-cp FlexSEA-Stack-SharedLib/​Release_static/​libFlexSEA-Stack-Plan.a Actuator-Package/​fx_plan_stack/​lib/​ +
-</​code>​ +
- +
-**Compile fx_plan_stack:​** +
-<​code>​ +
-cd Actuator-Package/​fx_plan_stack +
-mkdir build && cd build +
-cmake .. +
-make +
-</​code>​+
  
-**Test the library:**+====Test the library:====
   - First, make sure that Actuator-Package\Python\flexseapython\com.txt has the right COM port.   - First, make sure that Actuator-Package\Python\flexseapython\com.txt has the right COM port.
   - Navigate to the Actuator-Package\Python folder.   - Navigate to the Actuator-Package\Python folder.
Line 79: Line 55:
   * STM32: GNU ARM compiler version 5 or 6   * STM32: GNU ARM compiler version 5 or 6
   * Raspberry Pi: GNU Raspi compiler (http://​gnutoolchains.com/​raspberry/​tutorial/​)   * Raspberry Pi: GNU Raspi compiler (http://​gnutoolchains.com/​raspberry/​tutorial/​)
 +  * Raspberry Pi: Raspberry Pi Toolchain for Unix systems (https://​github.com/​raspberrypi/​tools)
  
-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. ​+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  
 + 
 +<​code>​ 
 +${source_folder}/​arm-bcm2708/​arm-rpi-4.9.3-linux-gnueabihf/​bin/​arm-linux-gnueabihf-gcc 
 +</​code>​
  
 **Note:** Make sure the paths in these files are correct. **Note:** Make sure the paths in these files are correct.
build_fx_plan.1548260512.txt.gz · Last modified: 2019/01/23 16:21 by flabelle