3 \page development_environment Development Environment
7 This page describes the requirements in order to build the library.
9 \subsection subsec_devenv_requirements Requirements
10 Compiler supported (older/others may work, but not tested):
29 Tools needed to build the library:
32 Tools needed to develop the library:
36 Tools needed to build the documentation:
39 - LaTeX (there are formulas!)
41 optional (used for development only):
42 - lcov / genhtml, c++filt
44 - clang-tools (analyzer)
48 optional (no core dependency):
49 - Boost.ASIO (used only for some examples)
50 - Qt 5 (used only for some examples)
52 There are no other dependencies despite the standard library (C++11) to build this library.
54 Other compilers may work, however untested.
56 \subsection subsec_devenv_build Build
57 For normal, debug and release builds use the standard cmake CMAKE_BUILD_TYPE variable.
58 For example a debug build:
60 Full information developpers build:
64 cmake -DCMAKE_BUILD_TYPE=Coverage ..
66 make coverage doc cppcheck
73 cmake -DCMAKE_BUILD_TYPE=Debug ..
77 If you like to perform code coverage using the unit tests, do:
81 cmake -DCMAKE_BUILD_TYPE=Coverage ..
86 As packaging system, cpack is used. Do after build:
91 or for individual package types:
106 After proper building and execution:
107 - [Code Coverage](../coverage/index.html)
108 - [cppcheck](../cppcheck.txt)
109 - [Doxygen Warnings](../doxygen-warnings.txt)
112 \subsection subsec_devenv_buildoptions Build Options
113 The following build types (-DCMAKE_BUILD_TYPE=x) are possible:
119 - `ENABLE_STATIC` : enables static build, if `OFF`, a shared library is being built.
121 - `ENABLE_PROFILING` : enables profiling for `gprof`
122 - `ENABLE_BENCHMARK` : enables benchmarking (disables some optimization)
123 - `ENABLE_SANITIZER` : enables address and undefined sanitizers
126 - `ENABLE_IO` : enables IO support. Default: `ON`
129 - `ENABLE_EXAMPLES`: enables examples. Default: `ON`
130 - `ENABLE_TESTS`: enables unit tests, integration tests and benchmarks. Default: `ON`
131 - `ENABLE_TOOLS`: enables tools. Default: `ON`
134 \subsection subsec_devenv_clang_static_analysis Static Analysis with Clang
135 There is a script ```bin/static-analysis-clang``` for doing this, or do it manually:
139 cmake -DCMAKE_CXX_COMPILER=/usr/share/clang/scan-build-3.9/libexec/c++-analyzer ..
140 scan-build-3.9 -o doc/analysis --use-analyzer=/usr/bin/clang++-3.9 make
143 After the build, ```scan-build``` will tell you what to do in order to inspect
147 \subsection subsec_devenv_benchmarks Perform Benchmarks
148 Build in ```Release``` mode, perform individual benchmarks:
152 cmake -DCMAKE_BUILD_TYPE=Release ..
154 test/benchmark_nmea_split
157 Using `perf` to do performance analysis:
161 cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_BENCHMARK=ON ..
163 perf record -g test/benchmark_nmea_split
164 perf report -g 'graph,0.5,caller'