ubuntu安装colmap

为了安装colmap处理数据集,中间踩了很多坑,大致记一下。

一、地址:

源码地址:GitHub - colmap/colmap: COLMAP - Structure-from-Motion and Multi-View Stereo

文档地址:Installation — COLMAP 3.9-dev documentation

二、安装步骤

2.1 安装ceres-solver

Installation — Ceres Solver

这个安装的1.14.0,总共试了三个版本,一个官网直接git,一个2.0,都报错。

网上找了个1.14.0安装很顺利。

解压后基本就是

mkdir ceres-bin
cd ceres-bin
cmake ..
make -j4

2.2 安装colmap问题汇总

主要参考:一些报错可以看这个

ubuntu16安装colmap的问题及解决方案_cudasetupargument 未定义的引用_WZJ&LSK的博客-CSDN博客

首先一个非常关键的地方是版本:

总之,回溯到3.7版本,应该会顺利,后面大部分都是别的版本的问题

git checkout 3.7

这是官网的安装介绍:

1. 安装依赖库

2. 下载colmap然后回滚版本到dev然后cmake make install三件套。

但是实际有问题:

目前安装依赖库和git下来很容易。然后回滚版本失败,找了半天好像dev标签的已经被作者删除了。之后现在23.9月下载的3.8版本当时报错很多:

总结一部分3.8版本的问题,以及也用3.6的几个版本,都没成功(如果3.7不行可以试试别的版本):

前面遇到的问题有:

1. cuda的问题:

CMake Error at CMakeLists.txt:255 (message):
  You must set CMAKE_CUDA_ARCHITECTURES to e.g.  'native', 'all-major', '70',
  etc.  More information at
  https://cmake.org/cmake/help/latest/prop_tgt/CUDA_ARCHITECTURES.html


-- Configuring incomplete, errors occurred!
See also "/home/mona/OnePose_Plus_Plus/submodules/colmap/build/CMakeFiles/CMakeOutput.log".

这个解决有:

cmake .. -DCMAKE_CUDA_ARCHITECTURES=native
cmake .. -DCMAKE_CUDA_ARCHITECTURES=all
cmake .. -DCMAKE_CUDA_ARCHITECTURES=70

但是前面两个未必能解决,后面的70需要命令行输入

nvidia-smi --query-gpu=compute_cap --format=csv

看看如果是8.6则写86,6.1写61,未必是70

2. gcc g++版本不够,改为7.0

大致是error: unable to find numeric literal operator ‘operator""Q’

有点忘记了,当时报错网上搜是gcc g++版本不够,一查是5.5,升级成7.0就好了

查询:

gcc -v
g++ -v

3. 未定义的引用

简单的一堆未定义引用,看上面提到的文章,改anaconda3的文件夹名字,最后install完了改回来就行

 undefined reference to `TIFFReadEncodedStrip@LIBTIFF_4.0`
 undefined reference to `TIFFReadEXIFDirectory@LIBTIFF_4.0`
 undefined reference to `TIFFFieldReadCount@LIBTIFF_4.0`
 undefined reference to `TIFFSetTagExtender@LIBTIFF_4.0`
 undefined reference to `TIFFCurrentDirectory@LIBTIFF_4.0`
 undefined reference to `TIFFReadTile@LIBTIFF_4.0`
 undefined reference to `TIFFSetDirectory@LIBTIFF_4.0`
 undefined reference to `TIFFClientOpen@LIBTIFF_4.0`

ubuntu16安装colmap的问题及解决方案_cudasetupargument 未定义的引用_WZJ&LSK的博客-CSDN博客

4. 未定义的引用

与上文类似,安装3.6版本遇到make 100%时的未定义引用

../libcolmap.a(misc.cc.o):在函数‘colmap::FileCopy(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, colmap::CopyType)’中:
misc.cc:(.text+0x57a):对‘boost::filesystem::detail::copy_file(boost::filesystem::path const&, boost::filesystem::path const&, boost::filesystem::copy_option, boost::system::error_code*)’未定义的引用
collect2: error: ld returned 1 exit status
src/exe/CMakeFiles/colmap_exe.dir/build.make:270: recipe for target 'src/exe/colmap' failed
make[2]: *** [src/exe/colmap] Error 1

当时是另一个文件,也没改成功

猜你喜欢

转载自blog.csdn.net/weixin_43907136/article/details/132673653