如何在Travis-CI上为TensorFlow构建共享库

我正在协助为TensorFlow Build 一个Ruby-wrapper . 明显 . 我们努力配置Travis-CI来构建项目并在我自己的机器上运行测试(OSX El Capitan) .

我的问题是:在 .travis.yml -file中需要为TensorFlow正确 bazel build 共享库( tensorflow.so )的魔力是什么?

据我所知,我已经成功安装了TensorFlow's dependencies,包括谷歌的构建工具Bazel,但是Travis-CI仍然无法构建 . 在撰写本文时, bazel build 命令失败并显示以下消息:

...
...
INFO: Building...
[1 / 13] Writing file external/gif_archive/libgif.so-2.params
[3 / 13] Compiling external/gif_archive/giflib-5.1.4/lib/egif_lib.c
ERROR: /home/travis/.cache/bazel/_bazel_travis/1a58902034d650eeef2a9da5b1248179/external/gif_archive/BUILD:14:1: C++ compilation of rule '@gif_archive//:gif' failed: namespace-sandbox failed: error executing command 
  (cd /home/travis/.cache/bazel/_bazel_travis/1a58902034d650eeef2a9da5b1248179/execroot/tensorflow && \
  exec env - \
...
...
The command "bazel build --verbose_failures=1 @gif_archive//:gif" failed and exited with 1 during .

https://travis-ci.org/chrhansen/tensorflow.rb/builds/145716589

注意:我注意到github.com/node-tensorflow/node-tensorflow上的那些人成功实现了这一点:https://travis-ci.org/node-tensorflow/node-tensorflow/builds

更新:https://github.com/tensorflow/tensorflow/issues/3374

回答(1)

2 years ago

问题已经解决(https://github.com/tensorflow/tensorflow/issues/3374),您应该能够在启用沙箱的情况下构建tensorflow .