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):
21 Tools needed to build the library:
24 Tools needed to develop the library:
28 Tools needed to build the documentation:
31 - LaTeX (there are formulas!)
33 optional (used for development only):
34 - lcov / genhtml, c++filt
40 optional (no core dependency):
41 - Boost.ASIO (used only for some examples)
42 - Qt 5 (used only for some examples)
44 There are no other dependencies despite the standard library (C++11) to build this library.
46 Other compilers may work, however untested.
48 \subsection subsec_devenv_build Build
49 For normal, debug and release builds use the standard cmake CMAKE_BUILD_TYPE variable.
50 For example a debug build:
52 Full information developpers build:
56 cmake -DCMAKE_BUILD_TYPE=Coverage ..
58 make coverage doc cppcheck
65 cmake -DCMAKE_BUILD_TYPE=Debug ..
69 If you like to perform code coverage using the unit tests, do:
73 cmake -DCMAKE_BUILD_TYPE=Coverage ..
78 As packaging system, cpack is used. Do after build:
83 or for individual package types:
98 After proper building and execution:
99 - [Code Coverage](../coverage/index.html)
100 - [cppcheck](../cppcheck.txt)
101 - [Doxygen Warnings](../doxygen-warnings.txt)
104 \subsection subsec_devenv_buildoptions Build Options
105 The following build types (-DCMAKE_BUILD_TYPE=x) are possible:
111 - `ENABLE_STATIC` : enables static build, if `OFF`, a shared library is being built.
113 - `ENABLE_WARNING_HELL` : enables _much_ more warnings, used for development purposes.
114 Currently implemented only for GCC. Default is `OFF`
115 - `ENABLE_PROFILING` : enables profiling for `gprof`
116 - `ENABLE_BENCHMARK` : enables benchmarking (disables some optimization)
117 - `ENABLE_SANITIZER` : enables address and undefined sanitizers
120 - `ENABLE_AIS ` : enables AIS support. Default: `ON`
121 - `ENABLE_SEATALK` : enables SeaTalk support. Default: `ON`
122 - `ENABLE_IO` : enables IO support. Default: `ON`
125 - `ENABLE_EXAMPLES`: enables examples. Default: `ON`
126 - `ENABLE_TESTS`: enables unit tests, integration tests and benchmarks. Default: `ON`
127 - `ENABLE_TOOLS`: enables tools. Default: `ON`
130 \subsection subsec_devenv_clang_static_analysis Static Analysis with Clang
131 There is a script ```bin/static-analysis-clang``` for doing this, or do it manually:
135 cmake -DCMAKE_CXX_COMPILER=/usr/share/clang/scan-build-3.9/libexec/c++-analyzer ..
136 scan-build-3.9 -o doc/analysis --use-analyzer=/usr/bin/clang++-3.9 make
139 After the build, ```scan-build``` will tell you what to do in order to inspect
143 \subsection subsec_devenv_benchmarks Perform Benchmarks
144 Build in ```Release``` mode, perform individual benchmarks:
148 cmake -DCMAKE_BUILD_TYPE=Release ..
150 test/benchmark_nmea_split
153 Using `perf` to do performance analysis:
157 cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_BENCHMARK=ON ..
159 perf record -g test/benchmark_nmea_split
160 perf report -g 'graph,0.5,caller'