If you get an error similar to this when installing colmap under arch or manjaro:

  Compiling the CUDA compiler identification source file
  "CMakeCUDACompilerId.cu" failed.

...

  /usr/include/c++/14.1.1/x86_64-pc-linux-gnu/bits/c++config.h(827): error:
  user-defined literal operator not found

      typedef __decltype(0.0bf16) __bfloat16_t;

Maybe these steps can help you:

1. Install gcc-13

yay -S gcc13

2. Export CUDAHOSTCXX and yay

export CUDAHOSTCXX=/usr/bin/g++-13
yay -S colmap

My full error message

CMake Error at /home/myuan/.pyenv/versions/3.11.3/lib/python3.11/site-packages/cmake/data/share/cmake-3.26/Modules/CMakeDetermineCompilerId.cmake:751 (message):
  Compiling the CUDA compiler identification source file
  "CMakeCUDACompilerId.cu" failed.

  Compiler: /opt/cuda/bin/nvcc

  Build flags:

  Id flags: --keep;--keep-dir;tmp -v



  The output was:

  2

  #$ _NVVM_BRANCH_=nvvm

  #$ _SPACE_=

  #$ _CUDART_=cudart

  #$ _HERE_=/opt/cuda/bin

  #$ _THERE_=/opt/cuda/bin

  #$ _TARGET_SIZE_=

  #$ _TARGET_DIR_=

  #$ _TARGET_DIR_=targets/x86_64-linux

  #$ TOP=/opt/cuda/bin/..

  #$ CICC_PATH=/opt/cuda/bin/../nvvm/bin

  #$ CICC_NEXT_PATH=/opt/cuda/bin/../nvvm-next/bin

  #$ NVVMIR_LIBRARY_DIR=/opt/cuda/bin/../nvvm/libdevice

  #$ LD_LIBRARY_PATH=/opt/cuda/bin/../lib:

  #$
  PATH=/opt/cuda/bin/../nvvm/bin:/opt/cuda/bin:/home/myuan/.pyenv/versions/3.11.3/bin:/usr/share/pyenv/libexec:/usr/share/pyenv/plugins/python-build/bin:/home/myuan/.vscode-server/extensions/ms-python.python-2024.8.1/python_files/deactivate/fish:/home/myuan/projects/ssdna-totalRNA-registration/.venv/bin:/home/myuan/.pyenv/shims:/home/myuan/.cargo/bin:/opt/vcpkg:/opt/cuda/bin:/home/myuan/.local/bin:/home/myuan/projects/ANTs-bin/bin:/home/myuan/.vscode-server/extensions/ms-python.python-2024.8.1/python_files/deactivate/fish:/home/myuan/projects/ssdna-totalRNA-registration/.venv/bin:/home/myuan/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/snapd/snap/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl


  #$ INCLUDES="-I/opt/cuda/bin/../targets/x86_64-linux/include"

  #$ LIBRARIES= "-L/opt/cuda/bin/../targets/x86_64-linux/lib/stubs"
  "-L/opt/cuda/bin/../targets/x86_64-linux/lib"

  #$ CUDAFE_FLAGS=

  #$ PTXAS_FLAGS=

  #$ rm tmp/a_dlink.reg.c

  #$ gcc -D__CUDA_ARCH_LIST__=520 -D__NV_LEGACY_LAUNCH -E -x c++ -D__CUDACC__
  -D__NVCC__ "-I/opt/cuda/bin/../targets/x86_64-linux/include"
  -D__CUDACC_VER_MAJOR__=12 -D__CUDACC_VER_MINOR__=5
  -D__CUDACC_VER_BUILD__=40 -D__CUDA_API_VER_MAJOR__=12
  -D__CUDA_API_VER_MINOR__=5 -D__NVCC_DIAG_PRAGMA_SUPPORT__=1 -include
  "cuda_runtime.h" -m64 "CMakeCUDACompilerId.cu" -o
  "tmp/CMakeCUDACompilerId.cpp4.ii"

  #$ cudafe++ --c++17 --gnu_version=140101 --display_error_number
  --orig_src_file_name "CMakeCUDACompilerId.cu" --orig_src_path_name
  "/home/myuan/.cache/yay/colmap/src/build/CMakeFiles/3.26.3/CompilerIdCUDA/CMakeCUDACompilerId.cu"
  --allow_managed --m64 --parse_templates --gen_c_file_name
  "tmp/CMakeCUDACompilerId.cudafe1.cpp" --stub_file_name
  "CMakeCUDACompilerId.cudafe1.stub.c" --gen_module_id_file
  --module_id_file_name "tmp/CMakeCUDACompilerId.module_id"
  "tmp/CMakeCUDACompilerId.cpp4.ii"

  /usr/include/c++/14.1.1/x86_64-pc-linux-gnu/bits/c++config.h(827): error:
  user-defined literal operator not found

      typedef __decltype(0.0bf16) __bfloat16_t;
                         ^

  

  /usr/include/c++/14.1.1/type_traits(529): error: type name is not allowed

        : public __bool_constant<__is_array(_Tp)>
                                            ^

  

  /usr/include/c++/14.1.1/type_traits(529): error: identifier "__is_array" is
  undefined

        : public __bool_constant<__is_array(_Tp)>
                                 ^

  

  /usr/include/c++/14.1.1/type_traits(581): error: type name is not allowed

        : public __bool_constant<__is_member_object_pointer(_Tp)>
                                                            ^

  

  /usr/include/c++/14.1.1/type_traits(581): error: identifier
  "__is_member_object_pointer" is undefined

        : public __bool_constant<__is_member_object_pointer(_Tp)>
                                 ^

  

  /usr/include/c++/14.1.1/type_traits(603): error: type name is not allowed

        : public __bool_constant<__is_member_function_pointer(_Tp)>
                                                              ^

  

  /usr/include/c++/14.1.1/type_traits(603): error: identifier
  "__is_member_function_pointer" is undefined

        : public __bool_constant<__is_member_function_pointer(_Tp)>
                                 ^

  

  /usr/include/c++/14.1.1/type_traits(695): error: type name is not allowed

        : public __bool_constant<__is_reference(_Tp)>
                                                ^

  

  /usr/include/c++/14.1.1/type_traits(695): error: identifier
  "__is_reference" is undefined

        : public __bool_constant<__is_reference(_Tp)>
                                 ^

  

  /usr/include/c++/14.1.1/type_traits(731): error: type name is not allowed

        : public __bool_constant<__is_object(_Tp)>
                                             ^

  

  /usr/include/c++/14.1.1/type_traits(731): error: identifier "__is_object"
  is undefined

        : public __bool_constant<__is_object(_Tp)>
                                 ^

  

  /usr/include/c++/14.1.1/type_traits(760): error: type name is not allowed

        : public __bool_constant<__is_member_pointer(_Tp)>
                                                     ^

  

  /usr/include/c++/14.1.1/type_traits(760): error: identifier
  "__is_member_pointer" is undefined

        : public __bool_constant<__is_member_pointer(_Tp)>
                                 ^

  

  /usr/include/c++/14.1.1/type_traits(3247): error: type name is not allowed

      inline constexpr bool is_array_v = __is_array(_Tp);
                                                    ^

  

  /usr/include/c++/14.1.1/type_traits(3271): error: type name is not allowed

        __is_member_object_pointer(_Tp);
                                   ^

  

  /usr/include/c++/14.1.1/type_traits(3281): error: type name is not allowed

        __is_member_function_pointer(_Tp);
                                     ^

  

  /usr/include/c++/14.1.1/type_traits(3298): error: type name is not allowed

      inline constexpr bool is_reference_v = __is_reference(_Tp);
                                                            ^

  

  /usr/include/c++/14.1.1/type_traits(3315): error: type name is not allowed

      inline constexpr bool is_object_v = __is_object(_Tp);
                                                      ^

  

  /usr/include/c++/14.1.1/type_traits(3328): error: type name is not allowed

      inline constexpr bool is_member_pointer_v = __is_member_pointer(_Tp);
                                                                      ^

  

  /usr/include/c++/14.1.1/bits/utility.h(237): error: __type_pack_element is
  not a template

        { using type = __type_pack_element<_Np, _Types...>; };
                       ^

  

  20 errors detected in the compilation of "CMakeCUDACompilerId.cu".

  # --error 0x2 --





Call Stack (most recent call first):
  /home/myuan/.pyenv/versions/3.11.3/lib/python3.11/site-packages/cmake/data/share/cmake-3.26/Modules/CMakeDetermineCompilerId.cmake:8 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  /home/myuan/.pyenv/versions/3.11.3/lib/python3.11/site-packages/cmake/data/share/cmake-3.26/Modules/CMakeDetermineCompilerId.cmake:53 (__determine_compiler_id_test)
  /home/myuan/.pyenv/versions/3.11.3/lib/python3.11/site-packages/cmake/data/share/cmake-3.26/Modules/CMakeDetermineCUDACompiler.cmake:307 (CMAKE_DETERMINE_COMPILER_ID)
  cmake/FindDependencies.cmake:118 (enable_language)
  CMakeLists.txt:85 (include)


-- Configuring incomplete, errors occurred!
==> 错误: 在 build() 中发生一个错误。
    正在放弃...
 -> 生成时出错: colmap-exit status 4
 -> 无法安装以下软件包, 需要手动介入处理:
colmap - exit status 4