相关疑难解决方法(0)

TensorFlow 不使用调试模式构建

我们正在尝试构建一个带有调试标志的 TensorFlow 测试用例:

bazel build -c dbg //tensorflow/python/kernel_tests:sparse_matmul_op_test

但是构建失败并出现以下错误:

/usr/include/features.h:330:4: 错误:#warning _FORTIFY_SOURCE 需要优化编译 (-O) [-Werror=cpp]
警告 _FORTIFY_SOURCE 需要优化编译 (-O)

cc1:所有警告都被视为错误

目标 //tensorflow/python/kernel_tests:sparse_matmul_op_test 构建失败

我们尝试了以下选项来解决此问题:

  1. 通过将 export CFLAGS 和 CXXFLAGS 导出到“-Wno-error”来构建

  2. bazel build -c dbg --cxxopt="-Wno-all" --cxxopt="-Wno-error" //tensorflow/python/kernel_tests:sparse_matmul_op_test

  3. 尝试从 third_party/gpus/crosstool/CROSSTOOL.tpl 评论 compiler_flag

抑制这些警告以使构建继续进行的正确方法是什么?

我们正在使用 gcc v5.4.0。

gcc gcc-warning tensorflow

6
推荐指数
1
解决办法
2454
查看次数

标签 统计

gcc ×1

gcc-warning ×1

tensorflow ×1