symforce-org / symforce

Fast symbolic computation, code generation, and nonlinear optimization for robotics
https://symforce.org
Apache License 2.0
1.44k stars 147 forks source link

`find_package(spdlog 1.9.0 QUIET)` accepts spdlog version 1.11.0, but it is not compatible #347

Closed arbor-arthur closed 1 year ago

arbor-arthur commented 1 year ago

Describe the bug Can't link against spdlog 1.11.0, but the find package command find_package(spdlog 1.9.0 QUIET) thinks it can:

Undefined symbols for architecture arm64:
  "spdlog::details::log_msg::log_msg(spdlog::source_loc, fmt::v8::basic_string_view<char>, spdlog::level::level_enum, fmt::v8::basic_string_view<char>)", referenced from:
      void spdlog::logger::log_<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&, std::__1::vector<sym::key_t, std::__1::allocator<sym::key_t>>&>(spdlog::source_loc, spdlog::level::level_enum, fmt::v8::basic_string_view<char>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&, std::__1::vector<sym::key_t, std::__1::allocator<sym::key_t>>&) in dense_linearizer.cc.o
      void spdlog::logger::log_<double>(spdlog::source_loc, spdlog::level::level_enum, fmt::v8::basic_string_view<char>, double&&) in gnc_optimizer.cc.o
      void spdlog::logger::log_<float>(spdlog::source_loc, spdlog::level::level_enum, fmt::v8::basic_string_view<char>, float&&) in gnc_optimizer.cc.o
      void spdlog::logger::log_<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, fmt::v8::basic_string_view<char> const&>(spdlog::source_loc, spdlog::level::level_enum, fmt::v8::basic_string_view<char>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, fmt::v8::basic_string_view<char> const&) in logging_configure.cc.o
      void spdlog::logger::log_<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>&>(spdlog::source_loc, spdlog::level::level_enum, fmt::v8::basic_string_view<char>, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>&) in logging_configure.cc.o
      void spdlog::logger::log_<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&>(spdlog::source_loc, spdlog::level::level_enum, fmt::v8::basic_string_view<char>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in logging_configure.cc.o
      void spdlog::logger::log_<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::vector<sym::Key, std::__1::allocator<sym::Key>> const&>(spdlog::source_loc, spdlog::level::level_enum, fmt::v8::basic_string_view<char>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::vector<sym::Key, std::__1::allocator<sym::Key>> const&) in linearizer.cc.o

To Reproduce brew install spdlog for version 1.11.0 Use the cmake instructions to build symforce v0.9.0

Expected behavior find_package(spdlog 1.9.0 QUIET) should specify a maximum usable version. Alternatively, an option can be given to force symforce to download and use its own version of spdlog.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Additional context I can work around by uninstalling spdlog, building symforce, and then I can reinstall spdlog.

chao-qu-skydio commented 1 year ago

Thanks for reporting. Will fix it.

aaron-skydio commented 1 year ago

This was fixed by 592b535