Changes between Initial Version and Version 1 of compile_all


Ignore:
Timestamp:
Jan 31, 2019, 11:53:41 AM (22 months ago)
Author:
Sanahuja Guillaume
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • compile_all

    v1 v1  
     1[[PageOutline]]
     2
     3= Build system
     4
     5__NOTE__: For Flair version <= 0.2.1, see [wiki:compile_all_old this page].
     6
     7Only Flair sources are provided. You need to compile everything by yourself to get development files, demos and tools.
     8
     9== Helper scripts ==
     10
     11Some scripts are provided to help configuration and compilation of projects. Using it you can compile everything easily.
     12* [source:flair-dev/trunk/scripts/flair_compile_all.sh flair_compile_all.sh]: compile libs, tools and demos with all available toolchains
     13* [source:flair-dev/trunk/scripts/cmake_codelite_outofsource.sh cmake_codelite_outofsource.sh]: configure a project for !CodeLite for all available toolchains
     14
     15== CMake & !CodeLite==
     16
     17Flair uses CMake as project descriptor. One recommended IDE is !CodeLite. The helper scripts will produce projects for !CodeLite from ''CMakeLists.txt'' but you can adapt it to your favourite IDE.
     18
     19== Out of source build ==
     20
     21The recommended usage is to build everything out of source, in order to keep your svn repositories clean. Helper scripts will build everything in ''$FLAIR_ROOT/flair-build'' directory.
     22
     23== Compile Flair libraries, tools and demos ==
     24
     25To compile all Fl-AIR stuffs, you can execute the dedicated script:
     26{{{
     27$ $FLAIR_ROOT/flair-dev/scripts/flair_compile_all.sh
     28}}}
     29
     30If it is the first time you execute this script, you must answer yes to the question ''Compile all from scratch''. This will create every projects using cmake.
     31
     32== Compilation with debug (optional) ==
     33
     34If you have to debug surprising segfaults (you know what I mean, do you? :D ) you will need to compile your code in debug mode (see below).
     35Then you'll have to activate the core dump generation (in each terminal) with
     36{{{
     37$ ulimit -c unlimited
     38}}}
     39To be sure that the kernel will generate those migthy core file you should issue this command
     40{{{
     41echo core > /proc/sys/kernel/core_pattern (en sudo)
     42}}}
     43Then when your program crashes, it will generate a "core" file. Use gdb with your binary as the first parameter (again, compiled in debug mode) and the core file as the second parameter (use your cross compiled gdb in case of cross development, arm-poky...-gdb for instance to debug an arm code from your PC).
     44It should load your program symbols. Then the "bt" command will show the backtrace, which is the sequence of function calls that resulted in the crash, allowing you to know exactly where is the problem.
     45
     46
     47=== Full framework ===
     48If you want to debug the framework itself, you may find beneficial to compile the full framework in debug mode you need to edit the file
     49{{{
     50$ /opt/robomap3/<version>/<arch>/toochain.cmake
     51}}}
     52and add "-g -O0" to the CMAKE_CXX_FLAGS variable. As of this writing, and for an x86 architecture, the file to edit is "/opt/robomap3/2.1.3/core2-64/toolchain.cmake".
     53Then you shall rebuild the whole framework with a call to flair_compile_all.
     54
     55=== Flair based app ===
     56If you want to debug your flair based application code, but don't need to debug the framework itself, you need to edit the file
     57{{{
     58<app>/build/CMakeFiles/<app>.dir/flags.cmake
     59}}}
     60and add the command add_definitions("-g -O0").