Google Benchmark:“ ***警告***库是作为调试的。时间可能会受到影响。
在〜/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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试告诉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
.