centos安装colmap
一、安装依赖
sudo yum install \
gflags-devel \
glog-devel \
glew-devel \
atlas \
atlas-devel \
lapack-devel \
blas-devel \
flann-devel \
lz4-devel \
sqlite-devel \
metis-devel \
qt5-qtbase-devel
二、编译安装colmap
git clone https://github.com/colmap/colmap.git
cd colmap
git checkout dev
mkdir build
cd build
cmake ..
sudo make install
报错:CMake Error at /usr/lib64/cmake/Ceres/CeresConfig.cmake:89
安装:cere-solver 1.14.0
wget ceres-solver.org/ceres-solver-1.14.0.tar.gz
tar xvf ceres-solver-1.14.0.tar.gz
cd ceres-solver-1.14.0
mkdir build
cd build
cmake ..
make -j4
sudo make install
重新cmake ..
,报错Could not find FreeImage
安装:FreeImage
git clone https://github.com/leapmotion/FreeImage
cd FreeImage
make
sudo make install
make clean
遇到报错:error: narrowing conversion of ‘128’ from ‘int’ to ‘signed char’ inside { } [-Wnarrowing]
解决:打开FreeImage/Makefile.gnu,30行添加CXXFLAGS += -Wno-narrowing
,编译成功
编译colmap期间如果遇到Could NOT find XXX,用sudo yum search xxx 搜索相关的库,如果有就用yum安装,没有就从源码编译安装。
继续编译colmap,遇到报错:The CUDA compiler identification is unknown colmap
这里系统使用cuda11.3
编译命令改成:
cmake .. -D CMAKE_CUDA_ARCHITECTURES='70' -D CMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc"
CUDA问题解决,遇到报错
Cannot generate a safe linker search path for target colmap_exe because
files in some directories may conflict with libraries in implicit
directories:
link library [libglog.so] in /usr/lib64 may be hidden by files in:
/home/liaobaoxin.lbx/miniconda3/lib
link library [liblz4.so] in /usr/lib64 may be hidden by files in:
/home/liaobaoxin.lbx/miniconda3/lib
link library [libsqlite3.so] in /usr/lib64 may be hidden by files in:
/home/liaobaoxin.lbx/miniconda3/lib
提示我们一些so跟miniconda3/lib中的so冲突,先把miniconda3目录重命名,编译colmap,然后再改回来
报错 Could NOT find Boost 待解决