Search code examples
c++cmakedrakefmtspdlog

Integration of drake to OpenSUSE - build error with spdlog and fmt Part 2


I am trying to integrate drake to OpenSUSE in this repository

This question is most probably related to the problem state here. I am opening a different question on this topic, because this situation is advanced to a new state and can be seen as the follow-up to the previous question.

I have tried your advice of executing it with the official binaries of spdlog and fmt like you suggested in your previous answer

if SUSE already has any build of spdlog or fmt, it would be ideal to use those instead of building from source.

I tried to do this with the following Dockerfile

# Use OpenSUSE Leap 15.4 as base
FROM opensuse/leap:15.4

# Install vim, sudo, and other necessary tools and libraries for drake
RUN zypper --non-interactive update && \
    zypper --non-interactive install -y vim sudo git cmake make java-1_8_0-openjdk-devel \
    glib2-devel lapack-devel libX11-devel ocl-icd-devel opencl-headers patch patchelf \
    pkg-config python3-devel python3-pygame zlib-devel pkg-config eigen3-devel \
    libmumps5 mumps-devel gcc-fortran nasm wget\  
    spdlog-devel  # spdlog-devel install spdlog-devel and fmt-devel
    # llvm-clang llvm-clang-devel not installed as there are too old

# Add the repository for GCC 10
RUN zypper addrepo -f http://download.opensuse.org/repositories/devel:/gcc/openSUSE_Leap_15.4/ devel_gcc && \
    zypper --non-interactive --gpg-auto-import-keys refresh && \
    zypper --non-interactive install -y gcc10 gcc10-c++

# Set GCC 10 as the default compiler
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 && \
    update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30 && \
    update-alternatives --set cc /usr/bin/gcc && \
    update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30 && \
    update-alternatives --set c++ /usr/bin/g++

# Install Bazelisk
RUN curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.7.5/bazelisk-linux-amd64 > /usr/local/bin/bazelisk && \
    chmod +x /usr/local/bin/bazelisk && \
    ln -s /usr/local/bin/bazelisk /usr/local/bin/bazel

# Download and place jchart2d-3.3.2.jar in /usr/share/java/jchart2d.jar
RUN wget https://repo1.maven.org/maven2/net/sf/jchart2d/jchart2d/3.3.2/jchart2d-3.3.2.jar -O /usr/share/java/jchart2d.jar

# Create .pc files for LAPACK and BLAS
RUN echo -e "prefix=/usr\nexec_prefix=\${prefix}\nlibdir=\${exec_prefix}/lib64\nincludedir=\${prefix}/include\n\nName: LAPACK\nDescription: Linear Algebra Package\nVersion: 3.9.0\nLibs: -L\${libdir} -llapack\nCflags: -I\${includedir}" > /usr/share/pkgconfig/lapack.pc && \
    echo -e "prefix=/usr\nexec_prefix=\${prefix}\nlibdir=\${exec_prefix}/lib64\nincludedir=\${prefix}/include\n\nName: BLAS\nDescription: Basic Linear Algebra Subprograms\nVersion: 3.9.0\nLibs: -L\${libdir} -lblas\nCflags: -I\${includedir}" > /usr/share/pkgconfig/blas.pc

# Set up the environment for user 'dan'
RUN groupadd -r dan && \
    useradd -m -s /bin/bash -r -g dan dan && \
    mkdir -p /home/dan/drake && \
    chown -R dan:dan /home/dan/drake && \
    echo "dan ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

USER dan
ENV HOME /home/dan
WORKDIR $HOME

# Install dependencies for pyenv and Python build
RUN sudo zypper --non-interactive install -y git gcc make zlib-devel libbz2-devel libopenssl-devel readline-devel \
    sqlite3-devel tar gzip openmpi-devel python3-clang15 clang15-devel

# Install pyenv and Python 3.10
RUN git clone https://github.com/pyenv/pyenv.git $HOME/.pyenv && \
    echo 'export PYENV_ROOT="$HOME/.pyenv"' >> $HOME/.bashrc && \
    echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> $HOME/.bashrc && \
    echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init --path)"\nfi' >> $HOME/.bashrc && \
    /bin/bash -c "source $HOME/.bashrc && pyenv install 3.10.0 && pyenv global 3.10.0"

# Ensure the selected Python version 3.10 is used and install PyYAML
RUN /bin/bash -c "source $HOME/.bashrc && pyenv rehash && pip install PyYAML"

# Set environment variables for GCC to ensure Bazel uses the correct version
ENV CC=/usr/bin/gcc-10
ENV CXX=/usr/bin/g++-10
ENV PYENV_ROOT $HOME/.pyenv
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
ENV LD_LIBRARY_PATH=/usr/lib/llvm-14/lib:$LD_LIBRARY_PATH

Installing spdlog-devel with zypper you automatically get spdlog-devel version 1.9.2-bp154.1.41 + fmt-devel version 8.0.1-150400.1.8 installed together.

They are located here

dan@169dafd51f9a:~/drake/cmake> find /usr -name fmt*
/usr/bin/fmt
/usr/lib64/pkgconfig/fmt.pc
/usr/lib64/cmake/fmt
/usr/lib64/cmake/fmt/fmt-config-version.cmake
/usr/lib64/cmake/fmt/fmt-targets.cmake
/usr/lib64/cmake/fmt/fmt-targets-relwithdebinfo.cmake
/usr/lib64/cmake/fmt/fmt-config.cmake
/usr/share/doc/packages/fmt-devel
/usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi/fmtmsg.ph
/usr/include/spdlog/details/fmt_helper.h
/usr/include/spdlog/fmt
/usr/include/spdlog/fmt/fmt.h
/usr/include/fmtmsg.h
/usr/include/fmt
dan@169dafd51f9a:~/drake/cmake> find /usr -name spdlog*
/usr/lib64/pkgconfig/spdlog.pc
/usr/lib64/cmake/spdlog
/usr/lib64/cmake/spdlog/spdlogConfigVersion.cmake
/usr/lib64/cmake/spdlog/spdlogConfig.cmake
/usr/lib64/cmake/spdlog/spdlogConfigTargets.cmake
/usr/lib64/cmake/spdlog/spdlogConfigTargets-release.cmake
/usr/share/doc/packages/spdlog-devel
/usr/share/licenses/spdlog-devel
/usr/include/spdlog
/usr/include/spdlog/spdlog-inl.h
/usr/include/spdlog/spdlog.h

That's the reason I modify the following cmake command to

cmake .. -DWITH_USER_FMT:BOOLEAN=ON -DWITH_USER_SPDLOG:BOOLEAN=ON -Dfmt_DIR="/usr/lib64/cmake/fmt" -Dspdlog_DIR="/usr/lib64/cmake/spdlog"

I get the following error with it:

dan@169dafd51f9a:~/drake/cmake> cmake .. -DWITH_USER_FMT:BOOLEAN=ON -DWITH_USER_SPDLOG:BOOLEAN=ON -Dfmt_DIR="/usr/lib64/cmake/fmt" -Dspdlog_DIR="/usr/lib64/cmake/spdlog" 
-- The C compiler identification is GNU 10.5.0
-- The CXX compiler identification is GNU 10.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc-10 - 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/g++-10 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning at CMakeLists.txt:60 (message):
  Could NOT find the lsb_release executable


-- Found Bazel: /usr/local/bin/bazel (Required is at least version "5.1") 
-- Found Python: /home/dan/.pyenv/shims/python3.10 (found suitable exact version "3.10.0") found components: Development Interpreter Development.Module Development.Embed 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- 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  
-- Found Git: /usr/bin/git (found version "2.35.3") 
fatal: not a git repository: /home/dan/drake/../.git/modules/drake
Starting local Bazel server and connecting to it...
INFO: Reading 'startup' options from /home/dan/drake/cmake/drake_build_cwd/.bazelrc: --output_base=/home/dan/.cache/bazel/_bazel_/7ea85213ca47cc67b02970ecea7788b3
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=0 --terminal_columns=80
INFO: Reading rc options for 'info' from /home/dan/drake/tools/bazel.rc:
  Inherited 'common' options: --enable_bzlmod=false
INFO: Reading rc options for 'info' from /home/dan/drake/cmake/drake_build_cwd/.bazelrc:
  Inherited 'common' options: --announce_rc=no --repo_env=CC=/usr/bin/gcc-10 --repo_env=CXX=/usr/bin/g++-10
INFO: Reading rc options for 'info' from /home/dan/drake/tools/bazel.rc:
  Inherited 'build' options: -c opt --strip=never --strict_system_includes --cxxopt=-std=c++20 --host_cxxopt=-std=c++20 --test_output=errors --test_summary=terse --test_tag_filters=-gurobi,-mosek,-snopt --test_env=DISPLAY --test_env=GRB_LICENSE_FILE --test_env=MOSEKLM_LICENSE_FILE --test_env=LCM_DEFAULT_URL=memq:// --test_env=MPLBACKEND=Template
INFO: Reading rc options for 'info' from /home/dan/drake/tools/ubuntu.bazelrc:
  Inherited 'build' options: --force_pic --fission=dbg --features=per_object_debug_info --action_env=PATH=/usr/bin:/bin --action_env=PYTHONNOUSERSITE=1 --test_env=PYTHONNOUSERSITE=1
INFO: Reading rc options for 'info' from /home/dan/drake/cmake/drake_build_cwd/.bazelrc:
  Inherited 'build' options: --symlink_prefix=/ --color=yes --subcommands=no --package_path=%workspace%:/home/dan/drake --notrim_test_configuration --action_env=CCACHE_DISABLE=1 --config=Release
INFO: Found applicable config definition build:Release in file /home/dan/drake/cmake/drake_build_cwd/.bazelrc: --compilation_mode=opt
bazel-bin: /home/dan/.cache/bazel/_bazel_/7ea85213ca47cc67b02970ecea7788b3/execroot/drake/bazel-out/k8-opt/bin
bazel-genfiles: /home/dan/.cache/bazel/_bazel_/7ea85213ca47cc67b02970ecea7788b3/execroot/drake/bazel-out/k8-opt/bin
bazel-testlogs: /home/dan/.cache/bazel/_bazel_/7ea85213ca47cc67b02970ecea7788b3/execroot/drake/bazel-out/k8-opt/testlogs
character-encoding: file.encoding = ISO-8859-1, defaultCharset = ISO-8859-1
command_log: /home/dan/.cache/bazel/_bazel_/7ea85213ca47cc67b02970ecea7788b3/command.log
committed-heap-size: 520MB
execution_root: /home/dan/.cache/bazel/_bazel_/7ea85213ca47cc67b02970ecea7788b3/execroot/drake
gc-count: 4
gc-time: 32ms
install_base: /home/dan/.cache/bazel/_bazel_dan/install/117cee491f5c7d83be6e3c6d6b5b8ca4
java-home: /home/dan/.cache/bazel/_bazel_dan/install/117cee491f5c7d83be6e3c6d6b5b8ca4/embedded_tools/jdk
java-runtime: OpenJDK Runtime Environment (build 11.0.6+10-LTS) by Azul Systems, Inc.
java-vm: OpenJDK 64-Bit Server VM (build 11.0.6+10-LTS, mixed mode) by Azul Systems, Inc.
max-heap-size: 8304MB
output_base: /home/dan/.cache/bazel/_bazel_/7ea85213ca47cc67b02970ecea7788b3
output_path: /home/dan/.cache/bazel/_bazel_/7ea85213ca47cc67b02970ecea7788b3/execroot/drake/bazel-out
package_path: %workspace%:/home/dan/drake
release: release 6.4.0
repository_cache: /home/dan/.cache/bazel/_bazel_dan/cache/repos/v1
server_log: /home/dan/.cache/bazel/_bazel_/7ea85213ca47cc67b02970ecea7788b3/java.log.169dafd51f9a.dan.log.java.20240314-153358.25326
server_pid: 25326
used-heap-size: 83MB
workspace: /home/dan/drake/cmake/drake_build_cwd
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dan/drake/cmake
dan@169dafd51f9a:~/drake/cmake> make install
INFO: Analyzed target //:install (324 packages loaded, 26689 targets configured).
INFO: Found 1 target...
ERROR: /home/dan/drake/common/symbolic/expression/BUILD.bazel:19:17: Compiling common/symbolic/expression/formula_cell.cc failed: (Exit 1): gcc-10 failed: error executing command (from target //common/symbolic/expression:_everything_compiled_cc_impl) /usr/bin/gcc-10 -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 88 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from bazel-out/k8-opt/bin/common/_virtual_includes/fmt/drake/common/fmt.h:6,
                 from bazel-out/k8-opt/bin/common/_virtual_includes/copyable_unique_ptr/drake/common/copyable_unique_ptr.h:18,
                 from bazel-out/k8-opt/bin/common/_virtual_includes/_random_headers_cc_impl/drake/common/random.h:8,
                 from bazel-out/k8-opt/bin/common/symbolic/expression/_virtual_includes/_everything_compiled_cc_impl/drake/common/symbolic/expression/formula_cell.h:17,
                 from common/symbolic/expression/formula_cell.cc:2:
external/fmt/include/fmt/format.h: In instantiation of 'std::string fmt::v8::to_string(const T&) [with T = drake::symbolic::Expression; typename std::enable_if<(! std::is_integral<_Tp>::value), int>::type <anonymous> = 0; std::string = std::__cxx11::basic_string<char>]':
bazel-out/k8-opt/bin/common/_virtual_includes/fmt/drake/common/fmt_eigen.h:80:38:   required from 'fmt::v8::formatter<drake::internal::fmt_eigen_ref<Derived> >::format<fmt::v8::basic_format_context<fmt::v8::appender, char> >::<lambda(const auto:19&)> [with auto:19 = drake::symbolic::Expression; std::string = std::__cxx11::basic_string<char>]'
external/eigen/include/_usr_include_eigen3/Eigen/src/Core/CoreEvaluators.h:583:22:   required from 'Eigen::internal::unary_evaluator<Eigen::CwiseUnaryOp<UnaryOp, ArgType>, Eigen::internal::IndexBased>::CoeffReturnType Eigen::internal::unary_evaluator<Eigen::CwiseUnaryOp<UnaryOp, ArgType>, Eigen::internal::IndexBased>::coeff(Eigen::Index, Eigen::Index) const [with UnaryOp = fmt::v8::formatter<drake::internal::fmt_eigen_ref<Derived> >::format<fmt::v8::basic_format_context<fmt::v8::appender, char> >::<lambda(const auto:19&)>; ArgType = const Eigen::Ref<const Eigen::Matrix<drake::symbolic::Expression, -1, -1, 0, -1, -1> >; typename Eigen::CwiseUnaryOp<UnaryOp, ArgType>::Scalar = std::__cxx11::basic_string<char>; Eigen::internal::unary_evaluator<Eigen::CwiseUnaryOp<UnaryOp, ArgType>, Eigen::internal::IndexBased>::CoeffReturnType = const std::__cxx11::basic_string<char>; Eigen::Index = long int]'
external/eigen/include/_usr_include_eigen3/Eigen/src/Core/AssignEvaluator.h:654:63:   required from 'void Eigen::internal::generic_dense_assignment_kernel<DstEvaluatorTypeT, SrcEvaluatorTypeT, Functor, Version>::assignCoeff(Eigen::Index, Eigen::Index) [with DstEvaluatorTypeT = Eigen::internal::evaluator<Eigen::Matrix<std::__cxx11::basic_string<char>, -1, -1, 0, -1, -1> >; SrcEvaluatorTypeT = Eigen::internal::evaluator<Eigen::CwiseUnaryOp<fmt::v8::formatter<drake::internal::fmt_eigen_ref<Derived> >::format<fmt::v8::basic_format_context<fmt::v8::appender, char> >::<lambda(const auto:19&)>, const Eigen::Ref<const Eigen::Matrix<drake::symbolic::Expression, -1, -1, 0, -1, -1> > > >; Functor = Eigen::internal::assign_op<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >; int Version = 0; Eigen::Index = long int]'
external/eigen/include/_usr_include_eigen3/Eigen/src/Core/AssignEvaluator.h:668:16:   required from 'void Eigen::internal::generic_dense_assignment_kernel<DstEvaluatorTypeT, SrcEvaluatorTypeT, Functor, Version>::assignCoeffByOuterInner(Eigen::Index, Eigen::Index) [with DstEvaluatorTypeT = Eigen::internal::evaluator<Eigen::Matrix<std::__cxx11::basic_string<char>, -1, -1, 0, -1, -1> >; SrcEvaluatorTypeT = Eigen::internal::evaluator<Eigen::CwiseUnaryOp<fmt::v8::formatter<drake::internal::fmt_eigen_ref<Derived> >::format<fmt::v8::basic_format_context<fmt::v8::appender, char> >::<lambda(const auto:19&)>, const Eigen::Ref<const Eigen::Matrix<drake::symbolic::Expression, -1, -1, 0, -1, -1> > > >; Functor = Eigen::internal::assign_op<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >; int Version = 0; Eigen::Index = long int]'
external/eigen/include/_usr_include_eigen3/Eigen/src/Core/AssignEvaluator.h:347:39:   required from 'static void Eigen::internal::dense_assignment_loop<Kernel, 0, 0>::run(Kernel&) [with Kernel = Eigen::internal::generic_dense_assignment_kernel<Eigen::internal::evaluator<Eigen::Matrix<std::__cxx11::basic_string<char>, -1, -1, 0, -1, -1> >, Eigen::internal::evaluator<Eigen::CwiseUnaryOp<fmt::v8::formatter<drake::internal::fmt_eigen_ref<Derived> >::format<fmt::v8::basic_format_context<fmt::v8::appender, char> >::<lambda(const auto:19&)>, const Eigen::Ref<const Eigen::Matrix<drake::symbolic::Expression, -1, -1, 0, -1, -1> > > >, Eigen::internal::assign_op<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >, 0>]'
external/eigen/include/_usr_include_eigen3/Eigen/src/Core/AssignEvaluator.h:785:37:   [ skipping 7 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
external/fmt/include/fmt/core.h:1172:19:   required from 'constexpr fmt::v8::detail::value<Context>::value(const T&) [with T = drake::internal::fmt_eigen_ref<Eigen::Ref<const Eigen::Matrix<drake::symbolic::Expression, -1, -1, 0, -1, -1> > >; Context = fmt::v8::basic_format_context<fmt::v8::appender, char>]'
external/fmt/include/fmt/core.h:1571:14:   required from 'constexpr fmt::v8::detail::value<Context> fmt::v8::detail::make_arg(const T&) [with bool IS_PACKED = true; Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; fmt::v8::detail::type <anonymous> = fmt::v8::detail::type::custom_type; T = drake::internal::fmt_eigen_ref<Eigen::Ref<const Eigen::Matrix<drake::symbolic::Expression, -1, -1, 0, -1, -1> > >; typename std::enable_if<IS_PACKED, int>::type <anonymous> = 0]'
external/fmt/include/fmt/core.h:1694:64:   required from 'constexpr fmt::v8::format_arg_store<Context, Args>::format_arg_store(const Args& ...) [with Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; Args = {drake::internal::fmt_eigen_ref<Eigen::Ref<const Eigen::Matrix<drake::symbolic::Expression, -1, -1, 0, -1, -1>, 0, Eigen::OuterStride<-1> > >}]'
external/fmt/include/fmt/core.h:1710:18:   required from 'constexpr fmt::v8::format_arg_store<Context, Args ...> fmt::v8::make_format_args(const Args& ...) [with Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; Args = {drake::internal::fmt_eigen_ref<Eigen::Ref<const Eigen::Matrix<drake::symbolic::Expression, -1, -1, 0, -1, -1>, 0, Eigen::OuterStride<-1> > >}]'
external/fmt/include/fmt/core.h:2886:44:   required from 'std::string fmt::v8::format(fmt::v8::format_string<T ...>, T&& ...) [with T = {drake::internal::fmt_eigen_ref<Eigen::Ref<const Eigen::Matrix<drake::symbolic::Expression, -1, -1, 0, -1, -1>, 0, Eigen::OuterStride<-1> > >}; std::string = std::__cxx11::basic_string<char>; fmt::v8::format_string<T ...> = fmt::v8::basic_format_string<char, drake::internal::fmt_eigen_ref<Eigen::Ref<const Eigen::Matrix<drake::symbolic::Expression, -1, -1, 0, -1, -1>, 0, Eigen::OuterStride<-1> > > >]'
common/symbolic/expression/formula_cell.cc:584:21:   required from here
external/fmt/include/fmt/format.h:2602:22: error: call of overloaded 'write<char>(std::back_insert_iterator<std::__cxx11::basic_string<char> >, const drake::symbolic::Expression&)' is ambiguous
 2602 |   detail::write<char>(std::back_inserter(result), value);
      |   ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/fmt/include/fmt/format.h:1819:6: note: candidate: 'OutputIt fmt::v8::detail::write(OutputIt, T) [with Char = char; OutputIt = std::back_insert_iterator<std::__cxx11::basic_string<char> >; T = drake::symbolic::Expression; typename std::enable_if<std::integral_constant<bool, (std::numeric_limits<_UIntType>::is_iec559 && (sizeof (T) <= sizeof (double)))>::value, int>::type <anonymous> = 0]'
 1819 | auto write(OutputIt out, T value) -> OutputIt {
      |      ^~~~~
external/fmt/include/fmt/format.h:1944:20: note: candidate: 'constexpr typename std::enable_if<(fmt::v8::detail::type_constant<decltype (fmt::v8::detail::arg_mapper<fmt::v8::basic_format_context<OutputIt, Char> >().map(declval<const T&>())), typename fmt::v8::basic_format_context<OutputIt, Char>::char_type>::value == fmt::v8::detail::type::custom_type), OutputIt>::type fmt::v8::detail::write(OutputIt, const T&) [with Char = char; OutputIt = std::back_insert_iterator<std::__cxx11::basic_string<char> >; T = drake::symbolic::Expression; typename std::enable_if<(fmt::v8::detail::type_constant<decltype (fmt::v8::detail::arg_mapper<fmt::v8::basic_format_context<OutputIt, Char> >().map(declval<const T&>())), typename fmt::v8::basic_format_context<OutputIt, Char>::char_type>::value == fmt::v8::detail::type::custom_type), OutputIt>::type = std::back_insert_iterator<std::__cxx11::basic_string<char> >]'
 1944 | FMT_CONSTEXPR auto write(OutputIt out, const T& value) ->
      |                    ^~~~~
Target //:install failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 12.924s, Critical Path: 5.35s
INFO: 12 processes: 9 internal, 3 processwrapper-sandbox.
FAILED: Build did NOT complete successfully
make[2]: *** [CMakeFiles/drake_cxx_python.dir/build.make:70: CMakeFiles/drake_cxx_python] Error 1
make[1]: *** [CMakeFiles/Makefile2:839: CMakeFiles/drake_cxx_python.dir/all] Error 2
make: *** [Makefile:146: all] Error 2


Solution

  • The lowest fmt version that Drake tests in its CI is 8.1.1.

    It looks like fmt version 8.0.1 is missing this bug fix: https://github.com/fmtlib/fmt/commit/ee0659f8b6dafa84f90576ae85adc77c20517286 that was released in 8.1.0.

    From reading the fmt source code, it looks like a work-around might be to make the Expression class larger than sizeof(double), e.g., with this patch:

    --- a/common/symbolic/expression/boxed_cell.h
    +++ b/common/symbolic/expression/boxed_cell.h
    @@ -360,6 +360,8 @@ class BoxedCell {
       // Leaving it non-redundantly initialized here is slightly faster.
       double value_;
     #endif
    +
    +  int fmt_v801_padding_;
     };
     
     }  // namespace internal