我需要在一些 XLA 通行证上运行测试,并且曾经bazel test
--config=opt --config=cuda //tensorflow/compiler/xla/service
这样做过(从这里)。构建失败并显示以下消息,暗示缺少 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。那会是问题的原因吗?