Installing ifm3d from source
Note: Following Instruction are for ifm3d-v1.0.0 and above which provide full support for O3R devices. if you are using O3D/O3X device please use ifm3d-v0.20.3 and follow these instructions
Overview of the available build flags
Flag name |
Description |
Default value |
---|---|---|
|
Build the |
ON |
|
Build the command-line utility |
ON |
|
Build the |
ON |
|
Build the ifm3dpy Python package (it can also be installed directly through |
OFF |
|
Use the legacy coordinates (ifm3d <= 0.92.x) with swapped axis |
OFF |
|
Build the |
ON |
|
Build install packages for development purposes |
ON |
|
Build modules as shared libraries |
ON |
|
Build the examples |
OFF |
|
Build documentation |
OFF |
|
Build the |
OFF |
|
Download, build and install required dependencies with ifm3d (for ifm3d v0.93.0 and above) |
ON |
Build Dependencies
The ifm3d library depends on the libraries listed below. Only CMake and pybind11 (if building the Python library) need to be installed on the user’s machine. The other dependencies will be pulled automatically.
Dependency |
Dependent ifm3d module |
Notes |
---|---|---|
CMake |
|
Meta-build framework |
curl |
|
Used to help enable command-line based firmware flashing. |
GoogleTest |
|
Unit testing framework |
libxmlrpc |
|
XMLRPC client used call into the camera configuration interface |
pybind11 |
|
A header-only library that exposes C++ types in Python and vice versa, mainly to create Python bindings of existing C++ code. |
Building From Source
Start with cloning the code from the ifm3d GitHub repository here.
⚠ The code on the branch main is updated nightly and contains the latest changes to the library. It is typically a work in progress.
⚠ We recommend using tagged versions for your builds, to ensure consistency between builds. The latest tagged version can be found here.
The default build
By default, the ifm3d
build enables the device
, framegrabber
, deserializer
, swupdater
,
and tools
modules. Building the software follows the usual CMake idiom of:
$ mkdir build
$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX=/usr ..
$ cmake --build .
$ sudo cmake --build . --target install
This will build and install ifm3d along with its dependencies.
Note: you can speed up the build by using
ninja
, withcmake -GNinja -DCMAKE_INSTALL_PREFIX=/usr ..
.
Build Debian packages from source
Dependencies
If you plan to build the Debian packages and have the
dependencies computed for you dynamically (see the note below on the
repackage
target), you will also need:
We note that, if you are running on a supported Linux, all of these packages
are available through the official Debian repositories and should be a simple
apt-get
away from being installed on your machine.
This additional section provides instructions to build Debian packages from ifm3d source.
To install the existing ifm3d Debian packages please refer to this section.
Building Debian packages
Alternatively, to build debs to be distributed to multiple runtime machines, you can use the following:
$ mkdir build
$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX=/usr ..
$ cmake --build .
$ cmake --build . --target package
$ cmake --build . --target repackage
$ sudo dpkg -i ifm3d_*_amd64-common.deb
$ sudo dpkg -i ifm3d_*_amd64-deserialize.deb
$ sudo dpkg -i ifm3d_*_amd64-device.deb
$ sudo dpkg -i ifm3d_*_amd64-framegrabber.deb
$ sudo dpkg -i ifm3d_*_amd64-swupdater.deb
$ sudo dpkg -i ifm3d_*_amd64-tools.deb
(The version number embedded in the deb file will be dependent upon which
version of the ifm3d
software you are building)
Note: Experienced users may be puzzled by the
repackage
step. This step is used to dynamically compute the Debian dependencies for the particular module. Due to how we are partitioning out the software, this approach is necessary vs. the more traditionalCPACK_DEBIAN_PACKAGE_SHLIBDEPS
wrapper arounddpkg-shlibdeps
. We basically created a version of that tool that exploits a-priori information about theifm3d
environment to properly compute the Debian dependencies. If you are building debs on a build machine to be distributed out to various runtime computers, you will certainly want to execute therepackage
target so that you are ensured the runtime machines have the proper dependency chain in place.