LoginSignup
0
0

More than 5 years have passed since last update.

Tenforflow-1.4.1 のビルド

Last updated at Posted at 2017-12-29

ビルド前に curl のビルド設定を修正する必要がある。

$ git diff
diff --git a/third_party/curl.BUILD b/third_party/curl.BUILD
index 882967d..805a30d 100644
--- a/third_party/curl.BUILD
+++ b/third_party/curl.BUILD
@@ -477,7 +477,6 @@ genrule(
         "#  define HAVE_RAND_EGD 1",
         "#  define HAVE_RAND_STATUS 1",
         "#  define HAVE_SSL_GET_SHUTDOWN 1",
-        "#  define HAVE_STROPTS_H 1",
         "#  define HAVE_TERMIOS_H 1",
         "#  define OS \"x86_64-pc-linux-gnu\"",
         "#  define RANDOM_FILE \"/dev/urandom\"",

HAVE_STROPTS_H の行を削除。

また、CUDAを利用する場合は、以下のシンボリックリンクを作成しておく。

$ sudo ln -s /usr/local/cuda/include/crt/math_functions.hpp /usr/local/cuda/include/math_functions.hpp

ビルド開始。

$ PYTHON_BIN_PATH=/usr/local/bin/python3 ./configure
$ bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
$ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
$ sudo pip3 install /tmp/tensorflow_pkg/tensorflow-1.4.1-cp36-cp36m-linux_x86_64.whl

ビルドした Tensorflow のディレクトリ以外の場所に cd してから動作確認。

$ python3
Python 3.6.3 (default, Dec 15 2017, 16:04:49) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
b'Hello, TensorFlow!'
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0