colmap安装教程及问题解决

环境:
Ubuntu20.04.6
gcc 9.4.0
cuda 11.8
eigen 3.3.7

1.安装依赖

sudo apt-get install \
    git \
    cmake \
    build-essential \
    libboost-program-options-dev \
    libboost-filesystem-dev \
    libboost-graph-dev \
    libboost-system-dev \
    libboost-test-dev \
    libeigen3-dev \
    libsuitesparse-dev \
    libfreeimage-dev \
    libmetis-dev \
    libgoogle-glog-dev \
    libgflags-dev \
    libglew-dev \
    qtbase5-dev \
    libqt5opengl5-dev \
    libcgal-dev

2. 安装

git clone https://github.com/colmap/colmap.git
cd colmap
git checkout dev(这个我报错了,没管)
mkdir build
cd build
cmake .. 
make -j10
sudo make install

3.运行

colmap -h
colmap gui

遇到问题
1.CMake Error at cmake/FindDependencies.cmake:124 (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
Call Stack (most recent call first):
CMakeLists.txt:87 (include)
解决办法
进入cmake/FindDependencies.cmake
添加以下代码

set(CMAKE_CUDA_ARCHITECTURES "70")

2.usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfreeimage.so: undefined reference to TIFFFieldTag@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfreeimage.so: undefined reference to TIFFFieldName@LIBTIFF_4.0’
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfreeimage.so: undefined reference to TIFFFieldReadCount@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfreeimage.so: undefined reference to TIFFFieldPassCount@LIBTIFF_4.0’
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfreeimage.so: undefined reference to TIFFFieldDataType@LIBTIFF_4.0' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfreeimage.so: undefined reference to _TIFFDataSize@LIBTIFF_4.0’
/usr/bin/ld: /usr/lib/libceres.so.1.14.0: undefined reference to `google::kLogSiteUninitialized’
collect2: error: ld returned 1 exit status
make[2]: *** [src/colmap/exe/CMakeFiles/colmap_exe.dir/build.make:257:src/colmap/exe/colmap] 错误 1
make[1]: *** [CMakeFiles/Makefile2:687:src/colmap/exe/CMakeFiles/colmap_exe.dir/all] 错误 2
make: *** [Makefile:130:all] 错误 2

解决办法:该问题是anaconda的libtiff的问题,网上解决办法是

conda uninstall libtiff

我没试过这个方法.
我的解决方法如下
直接卸载anaconda
或者
在bashrc里注释掉anaconda路径
然后添加

conda deactivate

给anaconda文件夹改个名字
删除colmap/build里的文件,重新编译即可解决。
等编译完成再把路径改回来应该就可以

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值