Fixposition SDK 0.0.0-heads/main-0-g75e6614
Collection of c++ libraries and apps for use with Fixposition products on Linux
Loading...
Searching...
No Matches
fpsdk_build.hpp
Go to the documentation of this file.
1/**
2 * \verbatim
3 * ___ ___
4 * \ \ / /
5 * \ \/ / Copyright (c) Fixposition AG (www.fixposition.com) and contributors
6 * / /\ \ License: see the LICENSE file
7 * /__/ \__\
8 * \endverbatim
9 *
10 * @file
11 * @brief Fixposition SDK: Documentation
12 */
13
14#ifndef __FPSDK_BUILD_HPP__
15#define __FPSDK_BUILD_HPP__
16
17namespace fpsdk {
18/* ****************************************************************************************************************** */
19// clang-format off
20
21/*!
22
23 @page FPSDK_BUILD_DOC Fixposition SDK: Build and installation
24
25 @section FPSDK_BUILD_DOC_OVERVIEW Overview
26
27 This page describes how the Fixposition SDK can be built and installed. This is intended for users who are familiar
28 with developing c++ code and building software and who want to build their own applications using the @ref
29 FPSDK_COMMON_DOC.
30
31 For users interested in simply *using* the @ref FPSDK_APPS_DOC it is recommended to use the @ref FPSDK_RUN_DOC
32 instead of building and installing those themselves.
33
34
35 @section FPSDK_BUILD_DEPS Dependencies
36
37 The Fixposition SDK is made for **Linux**. To build it a **GCC** (C++-17) toolchain is required. You may have some
38 luck using clang, but you're on your own there. Besides a glibc and standard Linux tools, such as CMake, make, bash,
39 xxd, sed, awk, etc. are required to build. This is tested and known to work with Ubuntu 20.04, 22.04, 24.04 and
40 26.04, as well as Debian Trixie.
41
42 For building the libraries and apps the following dependencies are used. Some are required and some are optional.
43
44 | Dependency | Version | Required | CMake (1) | Optional use |
45 |--------------------|-----------|----------|---------------------|--------------------------|
46 | boost | ≥ 1.71.0 | required | | |
47 | BZip2 | ≥ 1.0.8 | optional | FPSDK_USE_BZ2 | fpsdk::common::ros1::BagWriter |
48 | curl | ≥ 7.68.0 | required | | |
49 | Eigen3 | ≥ 3.3.7 | required | | |
50 | yaml-cpp | ≥ 0.6.2 | required | | |
51 | zlib1g | ≥ 1.2.11 | required | | |
52 | OpenSSL (libssl) | ≥ 1.1.x | required | | |
53 | nlohmann-json3 | ≥ 3.7.3 | required | | |
54 | PROJ | ≥ 9.4.x | optional | FPSDK_USE_PROJ | fpsdk::common::trafo::Transformer |
55 | FFmpeg (2) | = 7.1.x | optional | FPSDK_USE_FFMPEG | fpsdk::common::video, @ref FPSDK_APPS_FPLTOOL |
56 | ROS1 (3) | Noetic | optional | | fpsdk::common::ros1 |
57 | ROS2 (3) | Humble, Jazzy or Lyrical | optional| | fpsdk::common::ros2, @ref FPSDK_APPS_FPLTOOL |
58 | clang-format (4) | ≥ 19 | optional | | for development |
59 | Doxygen (4) | ≥ 1.14.0 | optional | | for development |
60 | GTest (4) | ≥ 1.13.0 | optional | FPSDK_BUILD_TESTING | for development |
61
62 (1) These CMake arguments are available to control these dependencies. By default the dependency is automatically
63 used when a suitable library is found. To explicitly enable or disable the use of such a dependency one can set
64 the CMake argument accordingly. For example: `-DFPSDK_USE_PROJ=OFF` to disable the use of the PROJ library or
65 `-DFPSDK_USE_PROJ=ON` to required the use of the PROJ library. See also @ref FPSDK_BUILD_BUILD_MANUAL below.
66
67 (2) The FFmpeg libraries must be configured with --disable-gpl and --disable-nonfree in order to comply
68 with the Fixposition SDK license. The CMake tests for that and refuses to use non-free/gpl builds of the FFmpeg
69 libraries.
70
71 (3) ROS support is optional, and it's either ROS1 *or* ROS2. To enable, build in a ROS environment using catkin
72 resp. colcon and the availability of ROS is detected automatically.
73
74 (4) These are only needed for development. That is, they are not required for building the @ref FPSDK_COMMON_DOC
75 and @ref FPSDK_APPS_DOC.
76
77 See @ref FPSDK_BUILD_CIVERSIONS for the versions used in the CI builds.
78
79 <!-- trick doxygen -->
80
81 @page FPSDK_BUILD_DOC
82
83 @section FPSDK_BUILD_BUILD Building
84
85 @subsection FPSDK_BUILD_BUILD_TLDR tl;dr
86
87 @code{sh}
88 ./docker/docker.sh pull trixie-dev # Or "docker.sh build trixie-dev" to build the image locally
89 ./docker/docker.sh run trixie-dev bash
90 # Now inside Docker do:
91 make install
92 ./fpsdk/bin/fpltool -h
93 @endcode
94
95 <!-- trick doxygen -->
96
97 @subsection FPSDK_BUILD_BUILD_DEVCONTAINER VSCode devcontainer
98
99 Open the fpsdk.code-workspace, change to one of the provided devcontainers (recommended: trixie), and in a terminal
100 do:
101
102 @code{sh}
103 make install
104 ./fpsdk/bin/fpltool
105 @endcode
106
107 <!-- trick doxygen -->
108
109 @subsection FPSDK_BUILD_BUILD_DOCKER Docker container
110
111 Docker images are provided that include all the dependencies:
112
113 @code{sh}
114 ./docker/docker.sh pull trixie-dev # Or "docker.sh build trixie-dev" to build the image locally
115 ./docker/docker.sh run trixie-dev bash
116 make install
117 ./fpsdk/bin/fpltool
118 @endcode
119
120 Note that for the containers with ROS (Noetic, Lyrical, etc.) you'll have to source the ROS stuff. For example:
121
122 @code{sh}
123 ./docker/docker.sh pull noetic-dev # Or "docker.sh build noetic-dev" to build the image locally
124 ./docker/docker.sh run noetic-dev bash
125 . /opt/ros/noetic/setup.bash
126 make install
127 ./fpsdk/bin/fpltool
128 @endcode
129
130 <!-- trick doxygen -->
131
132 @subsection FPSDK_BUILD_BUILD_CI Run CI
133
134 @code{sh}
135 ./docker/docker.sh run trixie-ci ./docker/ci.sh
136 ./docker/docker.sh run noetic-ci ./docker/ci.sh
137 ./docker/docker.sh run humble-ci ./docker/ci.sh
138 ./docker/docker.sh run jazzy-ci ./docker/ci.sh
139 ./docker/docker.sh run lyrical-ci ./docker/ci.sh
140 @endcode
141
142 <!-- trick doxygen -->
143
144 @subsection FPSDK_BUILD_BUILD_MANUAL Manual build
145
146 This details the manual setup of the dependencies and building the SDK on a ROS1 system (for example, Ubuntu 20.04
147 with ROS Noetic). It works similarly for ROS2 (for example, Ubuntu 22.04 with ROS Humble) or non-ROS (for example,
148 Debian Trixie) based systems. Refer to the Docker configration files and scripts in the docker/ folder on installing
149 the required dependencies.
150
151 1. Setup build system, install dependencies
152
153 The exact steps required depend on your system. You'll need the dependencies mentioned above installed system
154 wide or otherwise tell CMake where to find them. Refer to the provided Docker configuration and helper scripts,
155 namely "install_apt_base.sh", to check which packages can be installed in Ubuntu or Debian.
156
157 Something like this should work:
158
159 @code{sh}
160 sudo apt install libyaml-cpp-dev libboost-all-dev zlib1g-dev libeigen3-dev linux-libc-dev xxd # For building
161 sudo apt install libgtest-dev clang-format doxygen pre-commit # For development
162 source /opt/ros/lyrical/setup.bash # If you have ROS2 Lyrical
163 @endcode
164
165 3. Configure
166
167 @code{sh}
168 cmake -B build -DCMAKE_INSTALL_PREFIX=~/fpsdk
169 @endcode
170
171 Additional parameters, such as `-DFPSDK_USE_PROJ=OFF`, can be given. See @ref FPSDK_BUILD_DEPS above.
172
173 The build type can be selected by `-DCMAKE_BUILD_TYPE=Debug` or `-DCMAKE_BUILD_TYPE=Release` (default).
174 Add `-DCMAKE_PREFIX_PATH=...` to hint at non-standard installation paths, such as `/path/to/ffmpeg-lgpl`.
175
176 4. Build
177
178 @code{sh}
179 cmake --build build
180 @endcode
181
182 5. Install
183
184 @code{sh}
185 cmake --install build
186 @endcode
187
188 6. Enjoy!
189
190 For example:
191
192 @code{sh}
193 ~/fpsdk/bin/fpltool -h
194 @endcode
195
196 <!-- trick doxygen -->
197
198 @subsection FPSDK_BUILD_DOC_DOXYGEN Documentation
199
200 @code{sh}
201 make doc
202 @endcode
203
204
205 <!-- trick doxygen -->
206
207 @subsection FPSDK_BUILD_PACKAGE Individual packages
208
209 For example to build the fpsdk_common package (library):
210
211 @code{sh}
212 cmake -B build -S fpsdk_common -DCMAKE_INSTALL_PREFIX=~/fpsdk
213 cmake --build build
214 cmake --install build
215 @endcode
216
217
218 <!-- trick doxygen -->
219
220 @subsection FPSDK_BUILD_ROS ROS workspace
221
222 The packages build in a ROS workspace using catkin (ROS1) resp. colcon (ROS2). For example:
223
224 @code{sh}
225 catkin build fpsdk_common
226 @endcode
227
228 Note that if you clone this repository directly to your `ros_workspace/src` directory, you may have to place
229 CATKIN_IGNORE resp. COLCON_IGNORE files in some places. For example:
230
231 @code{sh}
232 # ROS1 catkin workspace
233 touch src/fixposition-sdk/examples/CATKIN_IGNORE # Ignore all examples, or
234 touch src/fixposition-sdk/examples/parser_intro/CATKIN_IGNORE # Ignore only this example
235 @endcode
236
237 @code{sh}
238 # ROS2 colcon workspace
239 touch src/fixposition-sdk/examples/COLCON_IGNORE # Ignore all examples, or
240 touch src/fixposition-sdk/examples/parser_intro/COLCON_IGNORE # Ignore only this example
241 @endcode
242
243 <!-- trick doxygen -->
244
245 @subsection FPSDK_BUILD_DETAILS Details
246
247 Refer to the various CMakeList.txt files, the CI workflow configuration (`.github/workflows/ci.yml`)
248 and the CI script (`docker/ci.sh`) for details on how things are done.
249
250
251 @section FPSDK_BUILD_CIVERSIONS Dependency versions
252
253
254 The builds using Debian 13 "Trixie" currently use:
255
256 @include fpsdk_common_versions_trixie/fpsdk_common/fpsdk_common_versions.txt
257
258
259 The builds using ROS Noetic (Ubuntu 20.04.6 LTS "Focal") currently use:
260
261 @include fpsdk_common_versions_noetic/fpsdk_common/fpsdk_common_versions.txt
262
263
264 The builds using ROS Humble (Ubuntu 22.04 LTS "Jammy") currently use:
265
266 @include fpsdk_common_versions_humble/fpsdk_common/fpsdk_common_versions.txt
267
268
269 The builds using ROS Jazzy (Ubuntu 24.04 LTS "Noble") currently use:
270
271 @include fpsdk_common_versions_jazzy/fpsdk_common/fpsdk_common_versions.txt
272
273
274 The builds using ROS Lyrical (Ubuntu 26.04 LTS "Raccoon") currently use:
275
276 @include fpsdk_common_versions_lyrical/fpsdk_common/fpsdk_common_versions.txt
277*/
278
279// clang-format on
280/* ****************************************************************************************************************** */
281} // namespace fpsdk
282#endif // __FPSDK_BUILD_HPP__
Fixposition SDK.