ubuntu 编译 openMVS

主要记录ubuntu16.04下编译openMVS的问题。
主要是按照官网的教程,Linux compilation进行编译。

遇到的两个问题:
1、git clone ceres库的时候,克隆不了,官网命令如下:
git clone https://ceres-solver.googlesource.com/ceres-solver ceres-solver
因为这个项目要从google git下克隆,然后单纯的git没法下下来,就进入网页端下载了master分支的ceres,并解压缩到ceres-solver/里。

ubuntu 编译 openMVS_第1张图片
ubuntu 编译 openMVS_第2张图片

2、在make -j2, openMVS的时候,出现了下面的错误

/usr/bin/cmake: /home/ar443/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /home/ar443/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /home/ar443/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /home/ar443/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 16%] Built target Common
/usr/bin/cmake: /home/ar443/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /home/ar443/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /home/ar443/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 23%] Built target Math
/usr/bin/cmake: /home/ar443/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 43%] Built target IO
/usr/bin/cmake: /home/ar443/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /home/ar443/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 68%] Built target MVS
/usr/bin/cmake: /home/ar443/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /home/ar443/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /home/ar443/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /home/ar443/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 73%] Built target InterfaceCOLMAP
[ 71%] Linking CXX executable ../../bin/InterfaceVisualSFM
/usr/bin/cmake: /home/ar443/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /home/ar443/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /home/ar443/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[ 75%] Linking CXX executable ../../bin/DensifyPointCloud
/usr/bin/cmake: /home/ar443/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/ld: warning: libjpeg.so.8, needed by /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9, may conflict with libjpeg.so.9
//usr/lib/x86_64-linux-gnu/libSM.so.6: undefined reference to `uuid_generate@UUID_1.0'
//usr/lib/x86_64-linux-gnu/libSM.so.6: undefined reference to `uuid_unparse_lower@UUID_1.0'
collect2: error: ld returned 1 exit status
apps/InterfaceVisualSFM/CMakeFiles/InterfaceVisualSFM.dir/build.make:136: recipe for target 'bin/InterfaceVisualSFM' failed
make[2]: *** [bin/InterfaceVisualSFM] Error 1
CMakeFiles/Makefile2:463: recipe for target 'apps/InterfaceVisualSFM/CMakeFiles/InterfaceVisualSFM.dir/all' failed
make[1]: *** [apps/InterfaceVisualSFM/CMakeFiles/InterfaceVisualSFM.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: warning: libjpeg.so.8, needed by /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9, may conflict with libjpeg.so.9
//usr/lib/x86_64-linux-gnu/libSM.so.6: undefined reference to `uuid_generate@UUID_1.0'
//usr/lib/x86_64-linux-gnu/libSM.so.6: undefined reference to `uuid_unparse_lower@UUID_1.0'
collect2: error: ld returned 1 exit status
apps/DensifyPointCloud/CMakeFiles/DensifyPointCloud.dir/build.make:136: recipe for target 'bin/DensifyPointCloud' failed
make[2]: *** [bin/DensifyPointCloud] Error 1
CMakeFiles/Makefile2:521: recipe for target 'apps/DensifyPointCloud/CMakeFiles/DensifyPointCloud.dir/all' failed
make[1]: *** [apps/DensifyPointCloud/CMakeFiles/DensifyPointCloud.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

错误原因:
网上搜了搜,应该是因为我装了anaconda3,并且在~/.bashrc里加了anaconda3/lib到LD_LIBRARY_PATH环境变量的原因。

解决方法:
参考链接:https://blog.csdn.net/u014734886/article/details/93029349

ubuntu 编译 openMVS_第3张图片
按照链接里把/usr/lib/x86_64-linux-gnu放在LD_LIBRARY_PATH环境变量里(如上图),解决了
/usr/bin/cmake: /home/ar443/anaconda3/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)问题,最后变成了这样。
ubuntu 编译 openMVS_第4张图片
然后
按照链接里的终极大法:把anaconda3/lib下的libuuid库文件移走,命令如下图:
ubuntu 编译 openMVS_第5张图片Note:我的是anaconda3,上面的命令里的路径要改一下。
然后就变成了
ubuntu 编译 openMVS_第6张图片
到此,openMVS就编译成功了,然后就可以去bin下面快乐的玩耍,了如下图所示。
ubuntu 编译 openMVS_第7张图片

但是在viewer还有点问题,如下图,但是感觉和上面一样移动libxxx库就好了,因为我没有要用到viewer的需求,就不接着弄了。
ubuntu 编译 openMVS_第8张图片

你可能感兴趣的:(项目)