/
tutorial-install-fedora.doc
512 lines (413 loc) · 18.6 KB
/
tutorial-install-fedora.doc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
/**
\page tutorial-install-fedora Tutorial: Installation from source for Linux Fedora
\tableofcontents
In this tutorial you will learn how to install ViSP from source on Linux Fedora. These steps have been tested for Fedora 21, Fedora 26 (64 bit), Fedora 28 (64 bits), Fedora 29 (64 bits) and Fedora 30 (64 bits) distributions, but should work with any other distribution as well.
\note Concerning ViSP installation, we provide also other \ref tutorial.
\section install_fedora_required Install prerequisites
Prior to build and install ViSP from source, you may install GNU g++ compiler, CMake, git and subversion. This can be achieved running:
\code
$ sudo dnf install gcc-c++ make cmake git subversion wget
\endcode
\section install_fedora_ws Create a workspace
First create a workspace that will contain all ViSP source, build, data set and optional 3rd parties. This workspace is here set to `$HOME/visp-ws` folder, but it could be set to any other location.
In a terminal, run:
\code
$ echo "export VISP_WS=$HOME/visp-ws" >> ~/.bashrc
$ source ~/.bashrc
$ mkdir -p $VISP_WS
\endcode
\section install_fedora_quick Quick ViSP installation
In this section, we give minimal instructions to build ViSP from source just to try ViSP without entering in \ref install_fedora_advanced.
- Install a small number of recommended 3rd parties
\code
$ sudo dnf install opencv-devel libX11-devel lapack-devel eigen3-devel libdc1394-devel libv4l-devel zbar-devel libxcb-devel libjpeg-devel libpng-devel
\endcode
- Get ViSP source code
\code
$ cd $VISP_WS
$ git clone https://github.com/lagadic/visp.git
\endcode
- Create a build folder and build ViSP
\code
$ mkdir -p $VISP_WS/visp-build
$ cd $VISP_WS/visp-build
$ cmake ../visp
$ make -j4
\endcode
- Set `VISP_DIR` environment variable
\code
$ echo "export VISP_DIR=$VISP_WS/visp-build" >> ~/.bashrc
$ source ~/.bashrc
\endcode
To have a trial, just jump to \ref install_fedora_dataset before running some binaries that you just build or jump to \ref install_fedora_next. You can later come back to the \ref install_fedora_advanced.
\section install_fedora_advanced Advanced ViSP installation
\subsection install_fedora_3rdparty Install 3rd parties
ViSP is interfaced with several optional 3rd party libraries. The <a href="http://visp.inria.fr/software-architecture">complete list is provided here</a>.
\note ViSP can be used without any third-party since all of them are optional. But obviously in this case, as we do not want to reinvent the wheel, some features implemented in third-party libraries will not be exploitable through ViSP. It is therefore possible to skip in a first time this section and start directly to \ref install_fedora_quick. Later, if you realize that a third-party library is missing, you can still install it, go back to the build folder, configure ViSP with CMake to detect the newly installed third-party library and build ViSP again as explained in \ref install_fedora_tips_new_3rdparty.
\subsubsection install_fedora_3rdparty_recommended Recommended 3rd parties
We recommend to install the following:
- OpenCV
- libX11 to be able to open a window to display images
- lapack and eigen to benefit from optimized mathematical capabilities
- libdc1394 to grab images from firewire cameras
- libv4l to grab images from usb or analogic cameras
- libzbar to be able to detect QR codes
- pthread library
Installation of recommended 3rd parties could be performed running:
\code
$ sudo dnf install opencv-devel libX11-devel lapack-devel eigen3-devel libdc1394-devel libv4l-devel zbar-devel libxcb-devel
\endcode
\subsubsection install_fedora_3rdparty_other Other optional 3rd parties
We give also the way to install other 3rd party libraries to enable specific capabilities.
- You may also install PCL library using:
\code
$ sudo dnf install pcl-devel
\endcode
- Coin, to be able to support vrml cad model used by the model-based trackers
\code
$ sudo dnf install Coin3-devel
\endcode
- libjpeg, libpng to support jpeg and png images (only useful if OpenCV is not installed)
\code
$ sudo dnf install libjpeg-devel libpng-devel
\endcode
- Ogre 3D if you want to do augmented reality or simulation
\code
$ sudo dnf install ogre-devel ogre-samples ois-devel
\endcode
- Datamatrix code detection
\code
$ sudo dnf install libdmtx-devel
\endcode
- Gnu Scientific Library for additional mathematics capabilities
\code
$ sudo dnf install gsl-devel
\endcode
\subsection install_fedora_get_source Get ViSP source code
There are different ways to get ViSP source code in this workspace:
- You can download the <a href="http://visp.inria.fr/download">latest release</a> as a zip or a tarball. Once downloaded, uncompress the file using either
\code
$ tar xvzf visp-x.y.z.tar.gz -C $VISP_WS
\endcode
or
\code
$ unzip visp-x.y.z.zip -d $VISP_WS
\endcode
- You can also download a <a href="http://visp.inria.fr/download#snapshot">daily snapshot</a>. Once downloaded, uncompress the file using
\code
$ tar xvzf visp-snapshot-yyyy-mm-dd.tar.gz -C $VISP_WS
\endcode
- Or you get the cutting-edge ViSP from <a href="https://github.com/lagadic/visp">GitHub repository</a> using the following command
\code
$ cd $VISP_WS
$ git clone https://github.com/lagadic/visp.git
\endcode
We suppose now that ViSP source is in the directory `$VISP_WS/visp`. The following should be adapted if you downloaded ViSP from a zip or tarball. In that case, the source is rather in something like `$VISP_WS/visp-x.y.z`.
\subsection install_fedora_config Configure ViSP from source
These are the steps to configure ViSP from source with CMake:
- In the workspace, create first a directory named `visp-build` that will contain all the build material; generated Makefiles, object files, output libraries and binaries.
\code
$ mkdir $VISP_WS/visp-build
\endcode
- Enter the `visp-build` folder and configure the build:
\code
$ cd $VISP_WS/visp-build
$ cmake ../visp
\endcode
A more versatile way to configure the build is to use `ccmake`, the CMake GUI:
\code
$ ccmake ../visp
\endcode
The following image shows that this command allows to configure (just by pressing [c] key) the build in a more advanced way where some options could be easily turned ON/OFF. It allows also to see which are the 3rd parties that will be used. To generate the makefiles, just press [g] key in the ccmake gui.
\image html img-ccmake-fedora-all.png Snapshot of the `ccmake ../visp` command used to configure ViSP.
\subsection install_fedora_build Build ViSP libraries
To build ViSP libraries proceed with:
\code
$ cd $VISP_WS/visp-build
$ make -j4
\endcode
\subsection install_fedora_doc Build ViSP documentation
To build ViSP documentation, you have first to install Doxygen package:
\code
$ sudo dnf install doxygen graphviz
\endcode
Then you can proceed with:
\code
$ cd $VISP_WS/visp-build
$ cmake ../visp
$ make -j4 visp_doc
\endcode
The generated documentation is then available in `$VISP_WS/visp-build/doc/html/index.html`
\note It is also possible to generate a more complete documentation that includes also all the internal classes. This could be achieved setting CMake var `ENABLE_FULL_DOC` to `ON` like:
\code
$ cmake ../visp -DENABLE_FULL_DOC=ON
$ make -j4 visp_doc
\endcode
\subsection install_fedora_visp_dir Set VISP_DIR environment var
In order to ease ViSP detection by CMake when ViSP is used as a 3rd party in an external project, like the one described in the \ref tutorial-getting-started, you may set `VISP_DIR` environment variable with the path to the `VISPConfig.cmake` file:
\code
$ echo "export VISP_DIR=$VISP_WS/visp-build" >> ~/.bashrc
$ source ~/.bashrc
\endcode
\section install_fedora_dataset Install ViSP data set
Some ViSP examples and tests require a data set that contains images, video, models that is not part of ViSP source code. This data set is available in Github (https://github.com/lagadic/visp-images) or as a release in a separate archive named `visp-images-x.y.z.zip`. This archive could be downloaded from http://visp.inria.fr/download page. Note that ViSP tutorials are not using ViSP data set.
We give hereafter the two ways to get this data set:
<b>1. Get data set release</b>
- Download `visp-images-3.3.0.zip` from https://visp.inria.fr/download and uncompress it in your workspace `%%VISP_WS%`:
\code
$ unzip ~/Downloads/visp-images-3.2.0.zip -d $VISP_WS
\endcode
- We suppose now that the data are located in `$VISP_WS/visp-images-3.3.0`.
\code
$ ls $VISP_WS/visp-images-3.3.0
3dmodel LICENSE.txt circle ellipse-1 iv mbt-depth video
AprilTag README.md cube endianness line mire warp
Klimt calibration ellipse faces mbt mire-2 xml
\endcode
- Once downloaded, you need to set `VISP_INPUT_IMAGE_PATH` environment variable to help ViSP examples and tests to detect automatically the location of the requested data. In our case, this variable should be set to `$VISP_WS/visp-images-3.3.0`. It is more convenient if this environment variables is automatically added to your bash session every time a new shell is launched:
\code
$ echo "export VISP_INPUT_IMAGE_PATH=$VISP_WS/visp-images-3.3.0" >> ~/.bashrc
$ source ~/.bashrc
\endcode
<b>2. Get data set from github</b>
- Use git to get the data set latest version:
\code
C:\> cd $VISP_WS
C:\> git clone https://github.com/lagadic/visp-images.git
\endcode
- Once cloned, you need to set `VISP_INPUT_IMAGE_PATH` environment variable to help ViSP examples and tests to detect automatically the location of the requested data. In our case, this variable should be set to `$VISP_WS%/visp-images`. In a shell run:
\code
$ echo "export VISP_INPUT_IMAGE_PATH=$VISP_WS/visp-images" >> ~/.bashrc
$ source ~/.bashrc
\endcode
<b>Test data set usage</b>
- From now, you can try to run ViSP examples and tests. For example you can run `displayX` example that should open a windows with Klimt painting image and some overlay drawings:
\code
$ cd $VISP_WS/visp-build
$ ./example/device/display/displayX
A click to close the windows...
A click to display a cross...
Cross position: 201, 441
A click to exit the program...
Bye
\endcode
\section install_fedora_tips Tips and tricks
\subsection install_fedora_tips_new_3rdparty How to take into account a newly installed 3rd party
Since all 3rd parties are optional you may have started to install only some of them. Imagine that you just installed a new third-party, or that you upgraded the version of this 3rd party. The next step is to go back to the build folder, configure ViSP with CMake to detect the newly installed third-party library and build again ViSP. This could be achieved with:
\code
$ cd $VISP_WS/visp-build
$ cmake ../visp
\endcode
Here you can check the content of the `ViSP-third-party.txt` file and see if the newly installed 3rd party is well detected (see \ref install_fedora_tips_3rd_party).
Finally, you need to rebuild ViSP with:
\code
$ make -j4
\endcode
\subsection install_fedora_tips_install How to install ViSP
Installing ViSP is optional and not recommended, since ViSP could be used as a 3rd party without installation. If you still want to proceed with the installation run:
\code
$ cd $VISP_WS/visp-build
$ sudo make install
\endcode
\note The default install location is set to `/usr/local`. This location could be changed modifying `CMAKE_INSTALL_PREFIX` var:
\code
$ cd $VISP_WS/visp-build
$ cmake ../visp -DCMAKE_INSTALL_PREFIX=/usr
$ make -j4
$ sudo make install
\endcode
\note If you proceed to ViSP installation in a system folder like `/usr` or `/usr/local` there is no need to \ref install_fedora_visp_dir that helps CMake to find ViSP libraries in an external project that uses ViSP as a 3rd party. If you rather install ViSP in a non "standard" folder, let say `/my/install/folder`, you have to set `VISP_DIR` to `/my/install/folder/lib/cmake/visp` that contains the `VISPConfig.cmake` file:
\code
$ cd $VISP_WS/visp-build
$ cmake ../visp -DCMAKE_INSTALL_PREFIX=/my/install/folder
$ make -j4
$ sudo make install
$ echo "export VISP_DIR=/my/install/folder/lib/cmake/visp" >> ~/.bashrc
$ source ~/.bashrc
\endcode
\subsection install_fedora_tips_uninstall How to uninstall ViSP
After ViSP installation, you can remove installed material using:
\code
$ cd $VISP_WS/visp-build
$ sudo make uninstall
\endcode
\subsection install_fedora_tips_modules How to build only ViSP libraries
If you want to build only ViSP modules libraries, nor the examples, tutorials and tests:
\code
$ cd $VISP_WS/visp-build
$ make -j4 visp_modules
\endcode
\subsection install_fedora_tips_module_once How to build a ViSP specific module
If you want to build a given module and all the dependencies:
\code
$ cd $VISP_WS/visp-build
$ make -j4 visp_<module_name>
\endcode
For example to build the model-based tracker module named mbt, run:
\code
$ cd $VISP_WS/visp-build
$ make -j4 visp_mbt
\endcode
\subsection install_fedora_tips_target Which are the targets that could be run with make ?
To know which are the target available with `make`:
\code
$ make help | grep visp
... visp_tutorials
... visp_tests
... visp_modules
... visp_doc
... visp_examples
... visp_demos
... visp_clipper
... visp_apriltag
... visp_core
... visp_gui
... visp_imgproc
... visp_io
... gen_visp_java_source
... visp_klt
... visp_me
... visp_sensor
... visp_ar
... visp_blob
... visp_robot
... visp_visual_features
... visp_vs
... visp_vision
... visp_detection
... visp_mbt
... visp_tt
... visp_tt_mi
\endcode
\subsection install_fedora_tips_3rd_party Which are the 3rd party libraries that are used in ViSP ?
To see which are the optional 3rd parties that are found during the configuration stage and that will be used by ViSP during the build you can have a look to the text file named `ViSP-third-party.txt` and located in `$VISP_WS/visp-build`. We provide hereafter an example of a possible content of this file:
\code
$ cat $VISP_WS/visp-build/ViSP-third-party.txt
==========================================================
General configuration information for ViSP 3.3.0
Version control: 3.2.0-799-ge98496a15
Platform:
Timestamp: 2020-02-11T14:49:44Z
Host: Linux 5.3.7-301.fc31.x86_64 x86_64
CMake: 3.16.3
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/gmake
Configuration: Release
C/C++:
Built as dynamic libs?: yes
C++ Compiler: /usr/bin/c++ (ver 9.2.1)
C++ flags (Release): -Wall -Wextra -fopenmp -std=c++11 -fvisibility=hidden -msse2 -msse3 -mssse3 -fPIC -O2 -DNDEBUG
C++ flags (Debug): -Wall -Wextra -fopenmp -std=c++11 -fvisibility=hidden -msse2 -msse3 -mssse3 -fPIC -g
C Compiler: /usr/bin/cc
C flags (Release): -Wall -Wextra -fopenmp -std=c++11 -fvisibility=hidden -msse2 -msse3 -mssse3 -fPIC -O2 -DNDEBUG
C flags (Debug): -Wall -Wextra -fopenmp -std=c++11 -fvisibility=hidden -msse2 -msse3 -mssse3 -fPIC -g
Linker flags (Release):
Linker flags (Debug):
ViSP modules:
To be built: core gui imgproc io java_bindings_generator klt me sensor ar blob robot visual_features vs vision detection mbt tt tt_mi
Disabled: -
Disabled by dependency: -
Unavailable: java
Python (for build): /usr/bin/python3
Java:
ant: NO
JNI: NO
Build options:
Build deprecated: yes
Build with moment combine: no
Mathematics:
Use MKL: no
Use OpenBLAS: no
Use Atlas: no
Use Netlib Lapack: yes (ver 3.8.0)
Use Lapack (built-in): no
Use Eigen3: yes (ver 3.3.7)
Use OpenCV: yes (ver 3.4.8)
Use GSL: no
Simulator:
Ogre simulator:
\- Use Ogre3D: no
\- Use OIS: no
Coin simulator:
\- Use Coin3D: no
\- Use SoWin: no
\- Use SoXt: no
\- Use SoQt: no
\- Use Qt5: no
\- Use Qt4: no
\- Use Qt3: no
Media I/O:
Use JPEG: no
Use PNG: no
\- Use ZLIB: no
Use OpenCV: yes (ver 3.4.8)
Use stb_image (built-in): no
Real robots:
Use Afma4: no
Use Afma6: no
Use Franka: no
Use Viper650: no
Use Viper850: no
Use aria (Pioneer): no
Use PTU46: no
Use Biclops PTU: no
Use Flir PTU SDK: no
Use Parrot ARSDK: no
\-Use ffmpeg: no
Use Virtuose: no
Use qbdevice (built-in): yes (ver 2.6.0)
GUI:
Use X11: yes
Use GTK: no
Use OpenCV: yes (ver 3.4.8)
Use GDI: no
Use Direct3D: no
Cameras:
Use DC1394-2.x: yes (ver 2.2.2)
Use CMU 1394: no
Use V4L2: yes (ver 1.18.0)
Use directshow: no
Use OpenCV: yes (ver 3.4.8)
Use Flycapture: no
Use Pylon: no
RGB-D sensors:
Use Realsense: no
Use Realsense2: no
Use Kinect: no
\- Use libfreenect: no
\- Use libusb-1: no
\- Use pthread: yes
Use PCL: no
\- Use VTK: no
F/T sensors:
Use atidaq (built-in): no
Use comedi: no
Use IIT SDK: no
Detection:
Use zbar: yes (ver 0.23)
Use dmtx: no
Use AprilTag (built-in): yes (ver 3.1.1)
\- Use AprilTag big family: no
Misc:
Use Clipper (built-in): yes (ver 6.4.2)
Use pugixml (built-in): yes (ver 1.9.0)
Use libxml2: no
Optimization:
Use OpenMP: yes
Use pthread: yes
Use pthread (built-in): no
Use cxx standard: 11
Documentation:
Use doxygen: no
Tests and samples:
Use catch2 (built-in): yes (ver 2.9.2)
Tests: yes
Demos: yes
Examples: yes
Tutorials: yes
Install path: /usr/local
==========================================================
\endcode
\section install_fedora_next Next tutorial
You are now ready to see the next \ref tutorial-getting-started that will show you how to use ViSP as a 3rd party to build your own project.
*/