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/10/08 14:12]
rqurashi [Debug Build]
build_fx_plan [2020/06/22 11:47] (current)
sbelanger
Line 14: Line 14:
  
  
-===== Setup =====+===== Setup - Windows ​=====
  
   - Start by installing[[https://​cmake.org/​download/​ | CMake]]   - Start by installing[[https://​cmake.org/​download/​ | CMake]]
     * Note the install path, you will need to add it to the PATH later.     * Note the install path, you will need to add it to the PATH later.
-  - Next install GCC. Get a mingw64 installer from [[https://​sourceforge.net/​projects/​mingw-w64/​ |source forge]].+  - Next install GCC. Get a mingw64 installer from [[https://​sourceforge.net/​projects/​mingw-w64/​files/​Toolchains%20targetting%20Win32/​Personal%20Builds/​mingw-builds/​installer/​mingw-w64-install.exe ​|source forge]].
     * Use the following setting when installing mingw64 {{gcc7_3_install.png}}.     * Use the following setting when installing mingw64 {{gcc7_3_install.png}}.
     * 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     * 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
Line 31: Line 31:
       -  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)       -  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=====+=====Setup - Linux/​Raspberry Pi===== 
 + 
 +These are all the packages needed for Linux/​Raspberry Pi 
 +<​code>​sudo apt-get install gcc 
 +sudo apt-get install g++ 
 +sudo apt-get install cmake 
 +sudo apt-get install ninja-build</​code>​ 
 + 
 +=====How to build the fx_plan_stack ​libraries=====
   - From your git bash console   - From your git bash console
-  - Start from a fresh version of Plan GUI <​code>​ git clone --recursive https://​github.com/​DephyInc/​plan_3_0.git </​code>​ +  - Start from a fresh version of the FlexSEA repo (currently on develop branch). For best results, ensure you have access to all FlexSEA submodules. You should anyway because if you change the fx_plan_stack you should copy the resulting libraries to Actuator-Package and plan_3_0 repos<​code>​git clone --recursive https://​github.com/​DephyInc/​FlexSEA.git </​code>​ 
-  - Change directory ​to the cloned Plan GUI repo <​code>​ cd plan_3_0/ ​</​code>​ +  - Change directory ​into FlexSEA ​<​code>​cd ​FlexSEA</​code>​ 
-  - Make sure all your submodules are up to date <​code>​ git submodule update --init --recursive </​code>​ +  - Make sure all the required ​submodules are up to date <​code>​git submodule update --init --recursive ​flexsea-core 
-  - Change directory into fx_plan_stack and run stackBuilder.sh <​code>​ cd fx_plan_stack && ./​stack_builder.sh ​&& cd ..</​code>​ +git submodule update --init --recursive flexsea-dephy 
-  - A successful build will print a message similar to <​code>​[83/84] Linking CXX static library libs\libfx_plan_stack_static.a +git submodule update --init --recursive fx_plan_stack 
-[84/84] Linking CXX shared library libs\libfx_plan_stack.dll+git submodule update --init --recursive Actuator-Package 
 +git submodule update --init --recursive plan_3_0</​code>​ 
 +  - Checkout empty submodules (only necessary if FlexSEA clone fails due to not having access to all FlexSEA repos) <​code>​cd flexsea-dephy && git checkout && cd .. 
 +cd flexsea-core && git checkout && cd .. 
 +cd Actuator-Package && git checkout && cd ..</​code>​ 
 +  - Change directory into fx_plan_stack and run stack_builder.sh <​code>​cd fx_plan_stack && ./​stack_builder.sh </​code>​ 
 +  - A successful build will print a message similar to <​code>​[65/66]Linking CXX static library libs\libfx_plan_stack_static.a 
 +[66/66] Linking CXX shared library libs\libfx_plan_stack.dll
 </​code>​ </​code>​
 +  - If you are going to commit your library builds (i.e after a code change to the fx_plan_stack),​ please be sure to build for all supported platforms (currently Windows, Linux, and Raspberry Pi).  
 +    - **Linux**: To build for Linux on Windows 10, install [[https://​ubuntu.com/​tutorials/​tutorial-ubuntu-on-windows#​1-overview|Ubuntu emulator]]. 
 +      - Once installed, go to Bash command line and install dos2unix. ​ It's needed to change stack_builder.sh line endings to Unix style: <​code>​sudo apt-get update 
 +sudo apt-get install dos2unix 
 +sudo dos2unix <​path_to_stack_builder.sh></​code>​ 
 +      - Now navigate to folder [FlexSEA/​fx_plan_stacks] and run: <​code>​./​stack_builder.sh</​code>​ 
 +        - Make sure you've installed the [[build_fx_plan#​Setup - Linux/​Raspberry Pi|required packages]] 
 +      - If you get a large number of error messages not related to missing packages, you might need to run with elevated privileges: <​code>​sudo ./​stack_builder.sh</​code>​ 
 +    - **Raspberry Pi**: To build for Raspberry Pi 4 on Windows or Linux: 
 +      - Open a Git Bash shell. 
 +      - Download the [[https://​gnutoolchains.com/​raspberry|Raspberry Pi toolchain]]. 
 +      - Update the paths in your CMAKE_RASPBERRY_PI_TOOLCHAIN_FILE to point to your local Raspberry Pi compilers. 
 +      - Run: <​code>​./​stack_builder.sh -pi </​code>​ 
 +      - A successful build will print a message similar to <​code>​[65/​66]Linking CXX static library libs\libfx_plan_stack_static.a 
 +[66/66] Linking CXX shared library libs\libfx_plan_stack.so 
 +</​code>​ 
 +  - Successful builds automatically copy over to the Actuator Package and plan_3_0 repos within FlexSEA (this is to ensure Actuator Package is completely independent from fx_plan_stack)
 ====Debug Build==== ====Debug Build====
  
Line 51: Line 82:
 To enforce release build: To enforce release build:
 <​code>​ set(CMAKE_BUILD_TYPE RELEASE) </​code>​ <​code>​ set(CMAKE_BUILD_TYPE RELEASE) </​code>​
- 
-Note: assuming that you have added your variables to the path, mentions of missing compilers can typically be resolved by restarting your computer. 
  
 ====Test the library:​==== ====Test the library:​====
Line 61: Line 90:
 python fxMain.py python fxMain.py
 </​code>​ </​code>​
 +
 +===== CLion IDE =====
 +
 +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.
 +
 +  - Open CLion
 +  - File > Open...
 +  - Select fx_plan_stack (top directory). If you already had another project open, select New Window.
 +    * Important: you need to have the submodules in the right location (side by side).
 +    * Easiest way to do this is to clone ''​FlexSEA''​ and to open ''​FlexSEA\fx_plan_stack''​ as your project.
 +  - Confirm that the CMake project was loaded (lower console). You may have to remove some environment variable to make it work.
 +
 +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:​
 +{{ :​compile.png?​200 |}}
 +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.
 +
 +
 +
  
 =====How to cross-compile the libraries===== =====How to cross-compile the libraries=====
build_fx_plan.1570543947.txt.gz · Last modified: 2019/10/08 14:12 by rqurashi