欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Sophus安装问题及解决方法(slam14讲)

程序员文章站 2022-05-28 16:27:39
...

1.安装方法

进入终端后:

git clone https://github.com/strasdat/Sophus.git
cd Sophus
mkdir build
cd build
cmake ..
make
sudo make install

2.遇到问题

当进行到cmake ..时,会显示以下问题:

  CMake Error at CMakeLists.txt:42 (find_package):
  By not providing "Findfmt.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "fmt", but
  CMake did not find one.

  Could not find a package configuration file provided by "fmt" with any of
  the following names:

    fmtConfig.cmake
    fmt-config.cmake

  Add the installation prefix of "fmt" to CMAKE_PREFIX_PATH or set "fmt_DIR"
  to a directory containing one of the above files.  If "fmt" provides a
  separate development package or SDK, be sure it has been installed.


-- Configuring incomplete, errors occurred!

说的大约就是不能找到fmt这个东西。

3.解决办法

通过阅读sophus里的readme,最后有这么一句“However, it should work (with no to minor modification) on many other modern configurations as long they support c++14, CMake, Eigen 3.3.X and (optionally) fmt. The fmt dependency can be eliminated by passing "-DUSE_BASIC_LOGGING=ON" to cmake when configuring Sophus.”它说明了

安装sophus的一些依赖库,并标明fmt为可选项。

到此可以确定我的问题是缺少fmt,可以通过-DUSE_BASIC_LOGGING=ON来解除对于fmt的依赖,由于本人刚接触cmake,不明白这是什么意思,所以就用了最笨的方法安装一个fmt,以下是fmt的安装方法:

git clone https://github.com/fmtlib/fmt.git
cd fmt
mkdir build
cd build
cmake ..
make
sudo make install

安装完之后就可以顺利安装sophus了。