在ubuntu16.04下编译openMVS

  • Post author:
  • Post category:其他


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

  • 在最后编译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

然后关闭了所有终端,重新进入编译目录下,再次编译时又把

$main_path 直接替换为vcglib的路径目录

,之后执行就没有问题了

对~!没有问题了,我也不知道是我哪一步对了

摊手 ┑( ̄Д  ̄)┍

记录这个奇妙的时刻,于是作者写了这篇随笔。


当日更新:

后来我又编译了一遍,同时把环境变量给删了,依然采用

$main_path 直接替换为vcglib的路径目录

的方法,没有问题~!

OK,到此为止~!

感谢各位大佬看我直播讲故事~

ヾ( ̄▽ ̄)Bye~Bye~



版权声明:本文为ZYX19950825原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。