forked from openMVG/openMVG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD
150 lines (116 loc) · 4.95 KB
/
BUILD
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
=====================================
OpenMVG (open Multiple View Geometry)
=====================================
------------------
Build instructions
------------------
Required tools:
* Cmake
* Git
* c/c++ compiler (gcc or visual studio or clang)
Getting the sources:
$ git clone --recursive https://github.com/openMVG/openMVG.git
or
$ git clone https://github.com/openMVG/openMVG.git
$ cd openMVG
$ git submodule init
$ git submodule update
As openMVG use some C++11 features you must have a c++11 ready compiler:
- Visual studio >= 2015 (recommended)
- GCC >= 4.8.1
- Clang >= 3.3
--------------------------
General informations
for openMVG cmake options
--------------------------
OpenMVG_BUILD_TESTS (ON/OFF(default))=> Build openMVG unit tests
OpenMVG_BUILD_EXAMPLES (ON/OFF(default))=> Build OpenMVG example applications.
Does not affect binaries under 'software'
--------------------------
General informations
for openMVG SfM pipelines
--------------------------
OpenMVG can export graphs as graphviz .dot files and render them as SVG files.
If you want consider this graph visualization feature, please consider to install Graphviz.
-----------------
Linux compilation
-----------------
Setup the required external library.
* sudo apt-get install libpng-dev libjpeg-dev libtiff-dev libxxf86vm1 libxxf86vm-dev libxi-dev libxrandr-dev
If you want see the view graph svg logs
* sudo apt-get install graphviz
$ git clone --recursive https://github.com/openMVG/openMVG.git
$ cd openMVG
$ ls
AUTHORS BUILD docs logo README src ...
$ cd ..
$ mkdir openMVG_Build
$ cd openMVG_Build
$ cmake -DCMAKE_BUILD_TYPE=RELEASE . ../openMVG/src/
If you want enable unit tests and examples to the build:
$ cmake -DCMAKE_BUILD_TYPE=RELEASE -DOpenMVG_BUILD_TESTS=ON -DOpenMVG_BUILD_EXAMPLES=ON . ../openMVG/src/
=> In order to use the MOSEK 6 back-end for the linear programming openMVG module
- Check that you have an up-to-date MOSEK licence, else openMVG MOSEK unit test will fail.
$ cmake -DCMAKE_BUILD_TYPE=RELEASE
-DMOSEK_SEARCH_HEADER="~/Documents/Lib/mosek/6/tools/platform/linux64x86/h"
-DMOSEK_SEARCH_LIB="~/Documents/Lib/mosek/6/tools/platform/linux64x86/bin"
. ../openMVG/src/
If you want have an IDE openable project with codeblocks:
$ cmake -G "CodeBlocks - Unix Makefiles" -DCMAKE_BUILD_TYPE=RELEASE . ../openMVG/src/
Compile the project
$ make
For a multi-core compilation (Replace NBcore with the number of threads)
$ make -j NBcore
Launch test (if asked at cmake step)
$ make test
Have fun with the samples
$ cd openMVG_Samples
-------------------
Windows compilation
-------------------
Checkout the project
$ git clone --recursive https://github.com/openMVG/openMVG.git
Open cmake-gui
Fill the source path with the src openMVG path.
Fill the build path with a new directory
Select your Visual Studio IDE and click configure and then generate
Open the .sln solution created in your build directory.
Change the target to Release.
Compile the libraries and binaries samples.
-------------------
Mac compilation
-------------------
$ git clone --recursive https://github.com/openMVG/openMVG.git
$ cd openMVG
$ ls
AUTHORS BUILD docs logo README src ...
$ cd ..
$ mkdir openMVG_Build
$ cd openMVG_Build
$ cmake -DCMAKE_BUILD_TYPE=RELEASE -G "Xcode" . ../openMVG/src/
If you want enable unit tests and examples to the build:
$ cmake -DCMAKE_BUILD_TYPE=RELEASE -DOpenMVG_BUILD_TESTS=ON -DOpenMVG_BUILD_EXAMPLES=ON -G "Xcode" . ../openMVG/src/
$ xcodebuild -configuration Release
--------------------
Using openCV sample
--------------------
Add -DOpenMVG_USE_OPENCV=ON to your cmake command line and set OpenCV_DIR variable to your openCV build directory
=> i.e.: -DOpenCV_DIR="/home/user/Dev/github/itseez/opencv_Build" -DOpenMVG_USE_OPENCV=ON
------------------------------------------------------------
Using OpenMVG as a third party library dependency in cmake
-------------------------------------------------------------
OpenMVG can be used as a third party once it have been installed.
Because it can use it's own ceres version, it's better to install it locally and not in system files.
So please consider using the CMAKE_INSTALL_PREFIX cmake variable to specify a local installation directory.
Here the syntax to add the variable to the cmake command line (use absolute path):
-DCMAKE_INSTALL_PREFIX:STRING="YourInstallPath"
i.e: -DCMAKE_INSTALL_PREFIX:STRING="/home/user/Dev/github/openMVG_Build/openMVG_install"
Perform "make" and "make install"
Once the library has been installed, go to your project that want use OpenMVG as an external library and add:
FIND_PACKAGE(OpenMVG REQUIRED)
INCLUDE_DIRECTORIES(${OPENMVG_INCLUDE_DIRS})
ADD_EXECUTABLE(main main.cpp)
TARGET_LINK_LIBRARIES(main ${OPENMVG_LIBRARIES})
Specify to CMAKE where OpenMVG have been installed by using the cmake OpenMVG_DIR variable that must point to:
-DOpenMVG_DIR:STRING="YourInstallPath"/share/openMVG/cmake
A message will be displayed if OpenMVG is found or not at the cmake configure step.