ubuntu20.04配置colmap

不讲版本对应的教程不是好教程
官方教程:https://colmap.github.io/install.html#linux
实践教程:
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

若在之后的步骤中,报错某个依赖没装上,依然用以上具体的某一条命令即可!

  1. eigen-3.3.7:去http://eigen.tuxfamily.org/index.php?title=Main_Pagedowanload下来压缩文件解压
# 文件解压之后
mkdir build
cd build
cmake ..
make -j12
sudo make install
# 默认安装路径为 /usr/local/include/eigen3
  1. ceres-sover-1.14.0:https://github.com/ceres-solver/ceres-solver/tree/1.14.0
# 安装相关依赖库
sudo apt-get install liblapack-dev libsuitesparse-dev libcxsparse3.1.2 libgflags-dev libgoogle-glog-dev libgtest-dev
# 下载压缩包ceres-sover-1.14.0
# 解压
mkdir build
cd build
cmake ..
make -j12
sudo make install
3.1 注:若出现无法定位libcxsparse3.1.2软件包的问题,进行以下操作
sudo gedit /etc/apt/sources.list
deb http://cz.archive.ubuntu.com/ubuntu trusty main universe
#更新源
sudo apt-get update
#重新执行安装依赖库的命令
sudo apt-get install liblapack-dev libsuitesparse-dev libcxsparse3.1.2 libgflags-dev libgoogle-glog-dev libgtest-dev
  1. colmap
git clone https://github.com/colmap/colmap.git
cd colmap
mkdir build
cd build
cmake ..
make -j12
sudo make install

4.1 注:执行make -j12编译时在接近100%时报错src/exe/CMakeFiles/colmap_exe.dir/build.make:143: recipe for target 'src/exe/colmap' failed make[2]: *** [src/exe/colmap] Error 1 CMakeFiles/Makefile2:1184: recipe for target 'src/exe/CMakeFiles/colmap_exe.dir/all' failed make[1]: *** [src/exe/CMakeFiles/colmap_exe.dir/all] Error 2 时解决方案:需要暂时性屏蔽anaconda,具体参考https://blog.csdn.net/Nismilesucc/article/details/124823261

cd ~
ls
mv anaconda3 axx
ls
# 安装完成记得move回去

之后重新make -j12继续即可,测试colmap安装成功命令:colmap -h

你可能感兴趣的:(tips,linux,ubuntu,bash)