ubuntu20.04 install colmap error: Cmake error while running “cmake .. -GNinja” command during installation

Daily Debug

When installing Colmap according to the official documentation ,
insert image description here
an error is reported during these two steps, such as:

1.

Call Stack (most recent call first):
  /usr/local/share/cmake-3.27/Modules/CMakeDetermineCompilerId.cmake:8 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  /usr/local/share/cmake-3.27/Modules/CMakeDetermineCompilerId.cmake:53 (__determine_compiler_id_test)
  /usr/local/share/cmake-3.27/Modules/CMakeDetermineCUDACompiler.cmake:307 (CMAKE_DETERMINE_COMPILER_ID)
  cmake/FindCOLMAPDependencies.cmake:122 (enable_language)
  CMakeLists.txt:85 (include)

Here is because the early cuda has been installed, you can execute:

sudo apt remove nvidia-cuda-toolkit

2.

CMake Error at cmake/FindCOLMAPDependencies.cmake:129 (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:85 (include)

This is because the new version of cmake needs to specifyCMAKE_CUDA_ARCHITECTURES

Refer to the official instructions and Colmap's issue#1805 to execute:

cmake .. -GNinja -DCMAKE_CUDA_ARCHITECTURES=native

Then install it normally.

Guess you like

Origin blog.csdn.net/weixin_43357695/article/details/131971799