参考官方文档:https://github.com/cdcseacave/openMVS/wiki/Building
vcglib的安装
cd /home/juling/lib
git clone -b v1.0.1 https://github.com/cdcseacave/VCG.git vcglib
git clone --recurse-submodules https://github.com/cdcseacave/openMVS.git
cd openMVS
mkdir openMVS_build
cmake .. -DCMAKE_BUILD_TYPE=Release -DVCG_ROOT=/home/juling/lib/vcglib -DOpenMVS_USE_CUDA=ON -DCMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs/ -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda/ -DCUDA_INCLUDE_DIRS=/usr/local/cuda/include/ -DCUDA_CUDART_LIBRARY=/usr/local/cuda/lib64 -DCUDA_NVCC_EXECUTABLE=/usr/local/cuda/bin/
make -j8
sudo make install
cmake时Eigen报错可能是因为低于3.4版本。ubuntu20.04通过sudo apt-get install libeigen3-dev
安装的Eigen为3.3.7版本,可以通过pkg-config --modversion eigen3
查看。我尝试卸载,然后自己安装3.4.0版本,但发现卸载的同时会卸载掉其他的依赖环境,导致PCL环境以及ROS的某些包环境都没了,因此直接安装3.4.0版本共存,在CmakeLists.txt中指定Eigen3的路径即可。自己安装的在/usr/local/下面,apt安装的在/usr根目录下。
# 安装3.4.0版本
git clone https://gitlab.com/libeigen/eigen --branch 3.4
cd eigen
mkdir build
cd build
cmake ..
make
sudo make install
set(EIGEN3_INCLUDE_DIR /usr/local/include/eigen3/)
参考:
[1] https://blog.csdn.net/weixin_61265732/article/details/125896332
[2] https://blog.csdn.net/qq_36313726/article/details/129964115