3 \page development_environment Development Environment
7 \section sec_devenv_intro Introduction
8 This page describes the requirements in order to build the library.
10 \section sec_devenv_requirements Requirements
12 The primary target architecture is `x86_64`, Linux on ARM is supposed to work
13 as well though. It is possible to run unit tests through `qemu-arm` or use `binfmt_misc`
16 Compiler supported (older/others may work, but not tested):
37 - VC++ 14.34 (_MSC_VER=1934, Visual Studio 2022)
39 Tools needed to build the library:
42 Tools needed to develop the library:
46 Tools needed to build the documentation:
49 - LaTeX (there are formulas!)
51 optional (used for development only):
52 - lcov / genhtml, c++filt
54 - clang-tools (analyzer)
57 optional (no core dependency):
58 - Boost.ASIO (used only for some examples)
59 - Qt 5 (used only for some examples)
65 There are no other dependencies despite the standard library (C++17) to build this library.
67 Other compilers may work, however untested.
69 \section sec_devenv_build Build
70 For normal, debug and release builds use the standard cmake CMAKE_BUILD_TYPE variable.
71 For example a debug build:
73 Full information developpers build:
77 cmake -DCMAKE_BUILD_TYPE=Coverage ..
79 make coverage doc cppcheck
86 cmake -DCMAKE_BUILD_TYPE=Debug ..
90 If you like to perform code coverage using the unit tests, do:
94 cmake -DCMAKE_BUILD_TYPE=Coverage ..
99 As packaging system, cpack is used. Do after build:
104 or for individual package types:
119 After proper building and execution:
120 - [Code Coverage](../coverage/index.html)
121 - [cppcheck](../cppcheck.txt)
122 - [Doxygen Warnings](../doxygen-warnings.txt)
125 \section sec_devenv_buildoptions Build Options
126 The following build types (-DCMAKE_BUILD_TYPE=x) are possible:
132 - `ENABLE_STATIC` : enables static build, if `OFF`, a shared library is being built.
134 - `ENABLE_PROFILING` : enables profiling for `gprof`
135 - `ENABLE_BENCHMARK` : enables benchmarking (disables some optimization)
136 - `ENABLE_SANITIZER` : enables address and undefined sanitizers
139 - `ENABLE_EXAMPLES`: enables examples. Default: `ON`
140 - `ENABLE_TOOLS`: enables tools. Default: `ON`
141 - `ENABLE_TESTS`: enables unit tests, integration tests and benchmarks. Default: `ON`
142 - `ENABLE_TESTS_BENCHMARK`: enables benchmark tests, enabled only if `ENABLE_TESTS` is also enabled. Default: `ON`
145 \section sec_devenv_clang_static_analysis Static Analysis with Clang
146 There is a script ```bin/static-analysis-clang``` for doing this, or do it manually:
150 cmake -DCMAKE_CXX_COMPILER=/usr/share/clang/scan-build-3.9/libexec/c++-analyzer ..
151 scan-build-3.9 -o doc/analysis --use-analyzer=/usr/bin/clang++-3.9 make
154 After the build, ```scan-build``` will tell you what to do in order to inspect
158 \section sec_devenv_benchmarks Perform Benchmarks
159 Build in ```Release``` mode, perform individual benchmarks:
163 cmake -DCMAKE_BUILD_TYPE=Release ..
165 test/benchmark_nmea_split
168 Using `perf` to do performance analysis:
172 cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_BENCHMARK=ON ..
174 perf record -g test/benchmark_nmea_split
175 perf report -g 'graph,0.5,caller'