Google Benchmark:“ ***警告***库是作为调试的。时间可能会受到影响。

发布于 2025-01-31 10:52:10 字数 1070 浏览 2 评论 0原文

〜/install/Benchmark中,我已经检查了Google基准( https:// github .com/google/Google/Benchmark )并根据说明在发布模式下构建它模式“>在这里。

〜/personal-projects/Benchmarking中,我有自己的代码,带有build> build文件和workspace file。在workspace文件中,我已经有

local_repository(
    name = "com_google_benchmark",
    path = "../../install/benchmark",
)

并且在build文件中,我有

cc_binary(
    name = "fast_inverse_sqr_root",
    srcs = ["fast_inverse_sqr_root.cpp"],
    deps = [
        "@com_google_benchmark//:benchmark_main",
    ],
)

i bazel run // fast_inverse_sqr_root,它说:<代码> ***警告***库是作为调试而构建的。时间可能会受到影响。

我发现 this 相关问题,但是当我使用Bazel构建我的代码时,该人正在使用CMAKE。我不确定这里发生了什么。为什么说图书馆是作为调试的?

In ~/install/benchmark, I have checked out Google Benchmark (https://github.com/google/benchmark) and built it in Release mode according to the instructions here.

In ~/personal-projects/benchmarking, I have my own code with a BUILD file and a WORKSPACE file. In the WORKSPACE file, I've got

local_repository(
    name = "com_google_benchmark",
    path = "../../install/benchmark",
)

And in the BUILD file, I have

cc_binary(
    name = "fast_inverse_sqr_root",
    srcs = ["fast_inverse_sqr_root.cpp"],
    deps = [
        "@com_google_benchmark//:benchmark_main",
    ],
)

When I bazel run //fast_inverse_sqr_root, it says: ***WARNING*** Library was built as DEBUG. Timings may be affected.

I've found this related question but that person is using cmake while I'm using Bazel to build my code. I'm not sure what is going on here. Why is it saying the library was built as DEBUG?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

剩一世无双 2025-02-07 10:52:10

尝试告诉Bazel以优化模式编译所有内容:Bazel Run -C Opt // fast_inverse_sqr_root

Try telling Bazel to compile everything in optimized mode: bazel run -c opt //fast_inverse_sqr_root.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文