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里的文件,重新编译即可解决。
等编译完成再把路径改回来应该就可以
更多推荐
所有评论(0)