安装ceres-solver以及colmap遇到的坑

参考https://blog.csdn.net/Carry_all/article/details/103224043来进行的安装。途中遇到网络问题和make执行错误的问题。错误如下所示:

In file included from /root/wcf/ceres-solver/internal/ceres/compressed_row_sparse_matrix.h:43:0,
                 from /root/wcf/ceres-solver/internal/ceres/cuda_sparse_matrix.h:45,
                 from /root/wcf/ceres-solver/internal/ceres/cuda_sparse_matrix.cc:38:
/usr/include/glog/logging.h: In instantiation of ‘void google::MakeCheckOpValueString(std::ostream*, const T&) [with T = std::nullptr_t; std::ostream = std::basic_ostream<char>]’:
/usr/include/glog/logging.h:694:25:   required from ‘std::__cxx11::string* google::MakeCheckOpString(const T1&, const T2&, const char*) [with T1 = ceres::internal::ContextImpl*; T2 = std::nullptr_t; std::__cxx11::string = std::__cxx11::basic_string<char>]’
/usr/include/glog/logging.h:718:1:   required from ‘std::__cxx11::string* google::Check_NEImpl(const T1&, const T2&, const char*) [with T1 = ceres::internal::ContextImpl*; T2 = std::nullptr_t; std::__cxx11::string = std::__cxx11::basic_string<char>]’
/root/wcf/ceres-solver/internal/ceres/cuda_sparse_matrix.cc:69:3:   required from here
/usr/include/glog/logging.h:638:9: error: ambiguous overload for ‘operator<<’ (operand types are ‘std::ostream {aka std::basic_ostream<char>}’ and ‘std::nullptr_t’)
   (*os) << v;
   ~~~~~~^~~~
In file included from /usr/include/c++/7/istream:39:0,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/eigen3/Eigen/Core:80,
                 from /root/wcf/ceres-solver/include/ceres/internal/eigen.h:34,
                 from /root/wcf/ceres-solver/internal/ceres/sparse_matrix.h:38,
                 from /root/wcf/ceres-solver/internal/ceres/compressed_row_sparse_matrix.h:41,
                 from /root/wcf/ceres-solver/internal/ceres/cuda_sparse_matrix.h:45,
                 from /root/wcf/ceres-solver/internal/ceres/cuda_sparse_matrix.cc:38:
/usr/include/c++/7/ostream:108:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ostream_type& (*)(std::basic_ostream<_CharT, _Traits>::__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]
       operator<<(__ostream_type& (*__pf)(__ostream_type&))
       ^~~~~~~~
/usr/include/c++/7/ostream:117:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ios_type& (*)(std::basic_ostream<_CharT, _Traits>::__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>; std::basic_ostream<_CharT, _Traits>::__ios_type = std::basic_ios<char>]
       operator<<(__ios_type& (*__pf)(__ios_type&))
       ^~~~~~~~
/usr/include/c++/7/ostream:127:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]
       operator<<(ios_base& (*__pf) (ios_base&))
       ^~~~~~~~
/usr/include/c++/7/ostream:245:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]
       operator<<(const void* __p)
       ^~~~~~~~
In file included from /usr/include/c++/7/ostream:693:0,
                 from /usr/include/c++/7/istream:39,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/eigen3/Eigen/Core:80,
                 from /root/wcf/ceres-solver/include/ceres/internal/eigen.h:34,
                 from /root/wcf/ceres-solver/internal/ceres/sparse_matrix.h:38,
                 from /root/wcf/ceres-solver/internal/ceres/compressed_row_sparse_matrix.h:41,
                 from /root/wcf/ceres-solver/internal/ceres/cuda_sparse_matrix.h:45,
                 from /root/wcf/ceres-solver/internal/ceres/cuda_sparse_matrix.cc:38:
/usr/include/c++/7/bits/ostream.tcc:119:5: note: candidate: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__streambuf_type = std::basic_streambuf<char>]
     basic_ostream<_CharT, _Traits>::
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/7/istream:39:0,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/eigen3/Eigen/Core:80,
                 from /root/wcf/ceres-solver/include/ceres/internal/eigen.h:34,
                 from /root/wcf/ceres-solver/internal/ceres/sparse_matrix.h:38,
                 from /root/wcf/ceres-solver/internal/ceres/compressed_row_sparse_matrix.h:41,
                 from /root/wcf/ceres-solver/internal/ceres/cuda_sparse_matrix.h:45,
                 from /root/wcf/ceres-solver/internal/ceres/cuda_sparse_matrix.cc:38:
/usr/include/c++/7/ostream:574:5: note: candidate: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const unsigned char*) [with _Traits = std::char_traits<char>]
     operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
     ^~~~~~~~
/usr/include/c++/7/ostream:569:5: note: candidate: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const signed char*) [with _Traits = std::char_traits<char>]
     operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
     ^~~~~~~~
/usr/include/c++/7/ostream:556:5: note: candidate: std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char*) [with _Traits = std::char_traits<char>]
     operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
     ^~~~~~~~
In file included from /usr/include/c++/7/ostream:693:0,
                 from /usr/include/c++/7/istream:39,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/eigen3/Eigen/Core:80,
                 from /root/wcf/ceres-solver/include/ceres/internal/eigen.h:34,
                 from /root/wcf/ceres-solver/internal/ceres/sparse_matrix.h:38,
                 from /root/wcf/ceres-solver/internal/ceres/compressed_row_sparse_matrix.h:41,
                 from /root/wcf/ceres-solver/internal/ceres/cuda_sparse_matrix.h:45,
                 from /root/wcf/ceres-solver/internal/ceres/cuda_sparse_matrix.cc:38:
/usr/include/c++/7/bits/ostream.tcc:321:5: note: candidate: std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const char*) [with _CharT = char; _Traits = std::char_traits<char>]
     operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
     ^~~~~~~~
internal/ceres/CMakeFiles/ceres_internal.dir/build.make:1041: recipe for target 'internal/ceres/CMakeFiles/ceres_internal.dir/cuda_sparse_matrix.cc.o' failed
make[2]: *** [internal/ceres/CMakeFiles/ceres_internal.dir/cuda_sparse_matrix.cc.o] Error 1
CMakeFiles/Makefile2:154: recipe for target 'internal/ceres/CMakeFiles/ceres_internal.dir/all' failed
make[1]: *** [internal/ceres/CMakeFiles/ceres_internal.dir/all] Error 2
Makefile:145: recipe for target 'all' failed

通过搜索相关问题,发现是由于自己版本不对导致的(版本过旧和过新都有问题 我使用的是最新版本)。参照https://blog.csdn.net/weixin_43731435/article/details/117198844的方法,我将ceres-solver的版本库降低到1.14.0版本后,安装成功。使用的commit如下所示:

1.14.0
commit	facb199f3eda902360f9e1d5271372b7e54febe1	[log] [tgz]
author	Sameer Agarwal <sameeragarwal@google.com>	Wed Mar 21 21:00:14 2018 -0700
committer	Sameer Agarwal <sameeragarwal@google.com>	Wed Mar 21 21:00:14 2018 -0700
tree	ff8b99beacbd0ea25211d38f1b499202d68cb2b2
parent	b5d6ee4a88694efb9dadd25c8cf4ae1b14407d7e [diff]

此后在安装colmap的时候也出现了问题,使用cmake编译报错。
先是出现下述错误

CMake Error at cmake/FindSQLite3.cmake:91 (message):
  Could not find SQLite3

通过安装sqlite3以及dev套件解决

apt-get install libsqlite3
apt-get install libsqlite3-dev

然后是cmake编译问题

-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found installed version of Eigen: /usr/lib/cmake/eigen3
-- Found required Ceres dependency: Eigen version 3.3.4 in /usr/include/eigen3
-- Found required Ceres dependency: glog
-- Found installed version of gflags: /usr/lib/x86_64-linux-gnu/cmake/gflags
-- Detected gflags version: 2.2.1
-- Found required Ceres dependency: gflags
-- Found Ceres version: 1.14.0 installed in: /usr/local with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, OpenMP, Multithreading]
-- Found Boost: /usr/local/lib/cmake/Boost-1.80.0/BoostConfig.cmake (found version "1.80.0") found components: program_options filesystem graph system unit_test_framework 
-- Found Eigen3: /usr/include/eigen3 (Required is at least version "2.91.0") 
-- Found Eigen
--   Includes : /usr/include/eigen3
-- Found FreeImage
--   Includes : /usr/include
--   Libraries : /usr/lib/x86_64-linux-gnu/libfreeimage.so
-- Found FLANN
--   Includes : /usr/include
--   Libraries : /usr/lib/x86_64-linux-gnu/libflann.so
-- Found LZ4
--   Includes : /usr/include
--   Libraries : /usr/lib/x86_64-linux-gnu/liblz4.so
-- Found Glog
--   Includes : /usr/include
--   Libraries : /usr/lib/x86_64-linux-gnu/libglog.so
-- Found SQLite3
--   Includes : /usr/include
--   Libraries : /usr/lib/x86_64-linux-gnu/libsqlite3.so
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
-- Found Glew
--   Includes : /usr/include
--   Libraries : /usr/lib/x86_64-linux-gnu/libGLEW.so
-- Found Git: /usr/bin/git (found version "2.17.1") 
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- The CUDA compiler identification is NVIDIA 11.7.64
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Found Qt
--   Module : /root/anaconda3/lib/cmake/Qt5Core
--   Module : /root/anaconda3/lib/cmake/Qt5OpenGL
--   Module : /root/anaconda3/lib/cmake/Qt5Widgets
-- Found CGAL
--   Includes : /usr//include
--   Libraries : /usr/lib/x86_64-linux-gnu/libCGAL.so.13.0.1
-- Build type not specified, using Release
-- Enabling SIMD support
-- Enabling OpenMP support
-- Disabling interprocedural optimization
CMake Error at CMakeLists.txt:255 (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

排查问题,大概意思是编译时未指定显卡,在CMakeList中加入如下代码

set(CMAKE_CUDA_ARCHITECTURES "native")

然后继续报错:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
METIS_INCLUDE_DIRS
   used as include directory in directory /root/wcf/colmap
   used as include directory in directory /root/wcf/colmap/lib
   used as include directory in directory /root/wcf/colmap/lib/LSD
   used as include directory in directory /root/wcf/colmap/lib/PBA
   used as include directory in directory /root/wcf/colmap/lib/PoissonRecon
   used as include directory in directory /root/wcf/colmap/lib/SiftGPU
   used as include directory in directory /root/wcf/colmap/lib/VLFeat
   used as include directory in directory /root/wcf/colmap/src
   used as include directory in directory /root/wcf/colmap/src/base
   used as include directory in directory /root/wcf/colmap/src/controllers
   used as include directory in directory /root/wcf/colmap/src/estimators
   used as include directory in directory /root/wcf/colmap/src/exe

根据错误,在网上寻找解决方案,得知可以使用Metis库来进行处理。在Ubuntu安装Metis库。

sudo apt-get install libmetis-dev

然后将对应的头文件位置以下述方式写入CMakeList.txt

set(METIS_INCLUDE_DIRS /usr/include/metis.h)

然后再次cmake,出现了一个新的问题。

-- Found installed version of Eigen: /usr/lib/cmake/eigen3
-- Found required Ceres dependency: Eigen version 3.3.4 in /usr/include/eigen3
-- Found required Ceres dependency: glog
-- Found installed version of gflags: /usr/lib/x86_64-linux-gnu/cmake/gflags
-- Detected gflags version: 2.2.1
-- Found required Ceres dependency: gflags
-- Found Ceres version: 1.14.0 installed in: /usr/local with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, OpenMP, Multithreading]
-- Found Eigen
--   Includes : /usr/include/eigen3
-- Found FreeImage
--   Includes : /usr/include
--   Libraries : /usr/lib/x86_64-linux-gnu/libfreeimage.so
-- Found FLANN
--   Includes : /usr/include
--   Libraries : /usr/lib/x86_64-linux-gnu/libflann.so
-- Found LZ4
--   Includes : /usr/include
--   Libraries : /usr/lib/x86_64-linux-gnu/liblz4.so
-- Found Glog
--   Includes : /usr/include
--   Libraries : /usr/lib/x86_64-linux-gnu/libglog.so
-- Found SQLite3
--   Includes : /usr/include
--   Libraries : /usr/lib/x86_64-linux-gnu/libsqlite3.so
-- Found Glew
--   Includes : /usr/include
--   Libraries : /usr/lib/x86_64-linux-gnu/libGLEW.so
-- Found Qt
--   Module : /root/anaconda3/lib/cmake/Qt5Core
--   Module : /root/anaconda3/lib/cmake/Qt5OpenGL
--   Module : /root/anaconda3/lib/cmake/Qt5Widgets
-- Found CGAL
--   Includes : /usr//include
--   Libraries : /usr/lib/x86_64-linux-gnu/libCGAL.so.13.0.1
-- Build type not specified, using Release
-- Enabling SIMD support
-- Enabling OpenMP support
-- Disabling interprocedural optimization
-- Enabling CUDA support (version: 11.7.64, archs: native)
-- Enabling GUI support
-- Enabling OpenGL support
-- Disabling ccache support
-- Disabling profiling support
-- Enabling CGAL support
-- Configuring done
CMake Warning at cmake/CMakeHelper.cmake:137 (add_executable):
  Cannot generate a safe runtime search path for target colmap_exe because
  files in some directories may conflict with libraries in implicit
  directories:

    runtime library [liblz4.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /root/anaconda3/lib
    runtime library [libtbbmalloc.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /root/anaconda3/lib
    runtime library [libtbb.so.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /root/anaconda3/lib
    runtime library [libsqlite3.so.0] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /root/anaconda3/lib
    runtime library [libgmp.so.10] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /root/anaconda3/lib

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  src/exe/CMakeLists.txt:38 (COLMAP_ADD_EXECUTABLE)

大概意思是在构建colmap_exe目标时,由于存在潜在的冲突,无法为它生成安全的运行时搜索路径。CMake发现/usr/lib/x86_64-linux-gnu目录中的某些库可能会被/root/anaconda3/lib目录中的库隐藏,这可能会导致colmap_exe找不到正确的库。解决方案很简单,将anaconda3改名,编译后再改回来即可。
如果jax版本不兼容会出现找不到GPU的情况。使用下述代码对jax重新安装

pip install --upgrade "jax[cuda]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html

此后成功安装。

重新安装又遇到几个问题

-- The CUDA compiler identification is unknown
CMake Error at CMakeLists.txt:155 (enable_language):
  No CMAKE_CUDA_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CUDACXX" or the CMake cache entry CMAKE_CUDA_COMPILER to the full
  path to the compiler, or to the compiler name if it is in the PATH.

是由于cmake未指定cuda导致。使用下列操作既可

cmake -D CMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" CMmakeLists.txt ..
-- Disabling interprocedural optimization
CMake Error at CMakeLists.txt:255 (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

CMAKEList.txt文件中没有设置指定的CUDA,在其中添加下列代码

set(CMAKE_CUDA_ARCHITECTURES 86) # rtx3090的值是86

使用make运行时报错

-- Disabling interprocedural optimization
CMake Error at CMakeLists.txt:253 (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

这是因为显卡算力与cuda版本不匹配导致的,参考https://blog.csdn.net/weixin_43678195/article/details/123574385添加环境变量既可解决此问题。

export TORCH_CUDA_ARCH_LIST="8.0"
  • 7
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 如果您在Ubuntu 18.04系统上安装ceres-solver,您可以使用以下步骤进行安装: 1. 更新您的系统: ``` sudo apt-get update sudo apt-get upgrade ``` 2. 安装必要的软件包: ``` sudo apt-get install libatlas-base-dev libsuitesparse-dev ``` 3. 下载并安装Ceres Solver: ``` wget http://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 sudo make install ``` 4. 检查安装是否成功: ``` ceres_version ``` 如果它输出了Ceres Solver的版本号,则说明安装成功。 请注意,在安装过程中,您可能需要先安装一些其他的依赖项,如果您在安装过程中遇到问题,请检查您的系统是否缺少任何必要的软件包。 ### 回答2: Ubuntu18.04是一种广泛使用的开源操作系统,而Ceres-solver则是一种用于最小化非线性代数方程的C ++库,被广泛应用于计算机视觉和机器人领域。在本文中,我们将探讨如何在Ubuntu18.04上安装Ceres-solver。 方法一:通过软件包管理器安装 Ubuntu18.04已经包含了Ceres-solver,因此我们可以通过软件包管理器轻松地安装它。具体步骤如下: 1. 通过终端窗口打开软件包管理器: ``` sudo apt-get update sudo apt-get install libceres-dev ``` 2. 安装后,我们可以检查Ceres-solver是否成功安装。通过终端窗口输入以下命令进行检查: ``` pkg-config --modversion ceres ``` 如果Ceres-solver成功安装,则会显示Ceres-solver的版本号。 方法二:通过源代码安装 如果您想安装最新版本的Ceres-solver,或者如果软件包管理器无法提供所需的版本,则可以通过源代码安装。具体步骤如下: 1. 从Ceres-solver官方网站下载 Ceres-solver的源代码:http://ceres-solver.org/installation.html 2. 下载后,将压缩文件解压缩。在终端窗口中进入解压缩后的文件夹,并运行以下命令: ``` sudo mkdir build cd build sudo cmake .. sudo make sudo make install ``` 3. 安装完成后,我们可以检查Ceres-solver是否成功安装。通过终端窗口输入以下命令进行检查: ``` pkg-config --modversion ceres ``` 如果Ceres-solver成功安装,则会显示Ceres-solver的版本号。 总结: 通过软件包管理器安装Ceres-solver可能更为简单,但这并不意味着源代码安装不是好选择。如果您想安装最新版本的软件,或者 Ubuntu 软件包管理器没有所需软件包。我们希望这篇文章对您有所帮助,让您成功在Ubuntu18.04上安装Ceres-solver。 ### 回答3: ceres-solver是一个广泛应用于计算机视觉、机器人和自动驾驶领域的C++库,它提供了许多优秀的优化算法。在ubuntu18.04中安装ceres-solver非常简单,下面给出步骤: 1. 打开终端,安装必要的依赖库:sudo apt-get install cmake libgoogle-glog-dev libatlas-base-dev 2. 从官方网站下载ceres-solver的源代码包,解压tar.gz包到/home/user/文件夹中(user为当前用户名),并进入解压后的文件夹 3. 在终端中进入解压后的文件夹,先建立build文件夹:`mkdir build`, 然后进入该文件夹:`cd build` 4. 对于64位系统的用户,可以在终端中使用如下命令设置编译器参数:cmake .. -DCMAKE_CXX_FLAGS="-std=c++11"【注:-std=c++11是C++11标准,用于支持新的特性】;对于32位系统的用户,使用cmake .. 就可以了 5. 在终端中输入:make -j4(其中- j 后面的数字是并行编译的数量,按实际情况进行调整),编译源代码,此时电脑会开始编译并生成ceres-solver库,时间较长,请耐心等待。 6. 输入如下命令进行安装:sudo make install 7. 检查是否安装成功,在终端中输入:pkg-config --modversion ceres。若显示版本号,则代表安装成功。 这样,ceres-solver已经成功安装到了ubuntu18.04系统中。此时您可以在自己的程序中使用ceres-solver库,实现自动优化和计算。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值