1. 程式人生 > 其它 >在ubuntu16.04下編譯openMVS

在ubuntu16.04下編譯openMVS

ubuntu16.04下編譯openMVS–之我的經歷
點選左側參考官方編譯文件

官方文件如下:

#Prepare and empty machine for building:
sudo apt-get update -qq && sudo apt-get install -qq
sudo apt-get -y install build-essential git mercurial cmake libpng-dev libjpeg-dev libtiff-dev libglu1-mesa-dev
main_path=`pwd`

#Eigen (Required)
hg clone https://bitbucket.org/eigen/eigen#3.2
mkdir eigen_build && cd eigen_build
cmake . ../eigen
make && sudo make install
cd ..

#Boost (Required)
sudo apt-get -y install libboost-iostreams-dev libboost-program-options-dev libboost-system-dev libboost-serialization-dev

#OpenCV (Required)
sudo apt-get -y install libopencv-dev

#CGAL (Required)
sudo apt-get -y install libcgal-dev libcgal-qt5-dev

#VCGLib (Required)
git clone https://github.com/cdcseacave/VCG.git vcglib

#Ceres (Required)
sudo apt-get -y install libatlas-base-dev libsuitesparse-dev
git clone https://ceres-solver.googlesource.com/ceres-solver ceres-solver
mkdir ceres_build && cd ceres_build
cmake . ../ceres-solver/ -DMINIGLOG=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF
make -j2 && sudo make install
cd ..

#GLFW3 (Optional)
sudo apt-get -y install freeglut3-dev libglew-dev libglfw3-dev

#OpenMVS
git clone https://github.com/cdcseacave/openMVS.git openMVS
mkdir openMVS_build && cd openMVS_build
cmake . ../openMVS -DCMAKE_BUILD_TYPE=Release -DVCG_DIR="$main_path/vcglib"

#If you want to use OpenMVS as shared library, add to the CMake command:
-DBUILD_SHARED_LIBS=ON

#Install OpenMVS library (optional):
make -j2 && sudo make install

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

在最後編譯openmvs時,
#OpenMVS
git clone https://github.com/cdcseacave/openMVS.git openMVS
mkdir openMVS_build && cd openMVS_build
cmake . ../openMVS -DCMAKE_BUILD_TYPE=Release -DVCG_DIR="$main_path/vcglib
執行到這一步
cmake . ../openMVS -DCMAKE_BUILD_TYPE=Release -DVCG_DIR="$main_path/vcglib
顯示找不到VCG庫的路徑,讓我指定VCG_ROOT的環境變數名,後來感覺可能是$main_path變數沒有指定對,更改後還是不行,再然後還通過新增環境變數的方式

sudo gedit ~/.bashrc
接著輸入使用者密碼
前面的步驟會開啟.bashrc檔案,在其末尾新增:
export VCG_ROOT=xxx/vcglib:$VCG_ROOT
儲存後,使其立即生效,在終端執行下面的命令
source ~/.bashrc

1
2
3
4
5
6

然後關閉了所有終端,重新進入編譯目錄下,再次編譯時又把$main_path 直接替換為vcglib的路徑目錄,之後執行就沒有問題了
對~!沒有問題了,我也不知道是我哪一步對了
攤手 ┑( ̄Д  ̄)┍
記錄這個奇妙的時刻,於是作者寫了這篇隨筆。
當日更新:
後來我又編譯了一遍,同時把環境變數給刪了,依然採用$main_path 直接替換為vcglib的路徑目錄的方法,沒有問題~!
OK,到此為止~!
感謝各位大佬看我直播講故事~
ヾ( ̄▽ ̄)Bye~Bye~
————————————————
版權宣告:本文為CSDN博主「Zhyancy」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處連結及本宣告。
原文連結:https://blog.csdn.net/ZYX19950825/article/details/79558197