首先上这里查看自己电脑GPU的CMAKE_CUDA_ARCHITECTURES
终端输入以下内容安装预先的前置依赖
bash
sudo apt-get install \
git cmake ninja-build build-essential \
libboost-program-options-dev libboost-filesystem-dev \
libboost-graph-dev libboost-system-dev libboost-test-dev \
libeigen3-dev libflann-dev libfreeimage-dev libmetis-dev \
libgoogle-glog-dev \
libgflags-dev libsqlite3-dev libglew-dev qtbase5-dev libqt5opengl5-dev \
libcgal-dev libceres-dev
再接着在终端中逐步输入以下内容来部署colmap即可
bash
git clone https://github.com/colmap/colmap.git
cd colmap
mkdir build
cd build
sudo cmake .. \
-D CMAKE_CUDA_COMPILER="/usr/local/cuda-11.8/bin/nvcc" ../CMakeLists.txt \
-D CMAKE_CUDA_ARCHITECTURES='89'
cd ..
sudo make -j24
sudo make install
其中CMAKE_CUDA_COMPILER是自己cuda的路径,如上所示,CMAKE_CUDA_ARCHITECTURES是自己GPU的计算能力,比如上图4090就是8.9,于是这里就输入89, 这俩都是按照自己的电脑来配置的。