在 mac 上编译 drake 时如何解决关于 g_iprint 的错误?

How to solve error about g_iprint while compiling drake on mac?

我在 mac 上编译程序时遇到此错误。

external/drake/solvers/snopt_solver.cc:118:34: error: variable 'g_iprint' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
  thread_local inline static int g_iprint;

更多信息

Mac os:Catalina 10.15.4

语言:C++

构建系统: bazel 版本

Build label: 2.1.0
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Feb 7 13:04:00 2020 (1581080640)
Build timestamp: 1581080640
Build timestamp as int: 1581080640

bazel 运行 @drake//常见:print_host_settings

INFO: Analyzed target @drake//common:print_host_settings (0 packages loaded, 8 targets configured).
INFO: Found 1 target...
Target @drake//tools/cc_toolchain:print_host_settings up-to-date:
  bazel-bin/external/drake/tools/cc_toolchain/print_host_settings
INFO: Elapsed time: 0.456s, Critical Path: 0.03s
INFO: 1 process: 1 darwin-sandbox.
INFO: Build completed successfully, 5 total actions
INFO: Running command line: bazel-bin/external/drake/tools/cc_toolchain/print_hoINFO: Build completed successfully, 5 total actions
++ uname -s
+ [[ Darwin == Darwin ]]
++ xcode-select --print-path
+ export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
+ DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
++ xcrun --show-sdk-path
+ export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
+ SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
+ capture_cc_env=external/drake/tools/cc_toolchain/capture_cc.env
+ source external/drake/tools/cc_toolchain/capture_cc.env
++ BAZEL_CC=external/local_config_cc/cc_wrapper.sh
++ BAZEL_CC_FLAGS=
+ [[ ! -z external/local_config_cc/cc_wrapper.sh ]]
++ python3 -c 'import os; print(os.path.realpath("external/local_config_cc/cc_wrapper.sh"))'
+ BAZEL_CC=/private/var/tmp/_bazel_jason-hu/239eeadb9c6f4e0686cc26e4bb87a14a/external/local_config_cc/cc_wrapper.sh
+ /private/var/tmp/_bazel_jason-hu/239eeadb9c6f4e0686cc26e4bb87a14a/external/local_config_cc/cc_wrapper.sh --version
Apple clang version 11.0.3 (clang-1103.0.32.59)
Target: x86_64-apple-darwin19.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

重复以上内容以便我们接受答案:此问题已在 https://github.com/RobotLocomotion/drake/releases/tag/v0.17.0 中修复。升级到最新版本应该可以解决问题。