【发布时间】:2018-06-14 08:09:01
【问题描述】:
我需要在一些 XLA 通道上运行测试并使用 bazel test
--config=opt --config=cuda //tensorflow/compiler/xla/service 来做同样的事情(来自 here)。构建失败并显示以下消息,暗示缺少 googletest 依赖项。
/usr/lib/x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
依赖关系 libgtest.a 和 libgtest_main.a 是从 googletest 源构建的,并使用 --linkopt=/path/to/file 传递给链接器。
googletest/googletest/libgtest_main.a(gtest_main.cc.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
添加 -DCMAKE_CXX_FLAGS=-fPIC 没有帮助。如何更改 cmake 配置以使用 -fPIC 构建?
tensorflow (v1.8) 配置为由本地构建的版本 gcc (5.4) 构建,因为系统的版本 (5.5) 无法构建 tensorflow。这会是问题的原因吗?
【问题讨论】:
标签: tensorflow build googletest position-independent-code